package bx

type BxError struct {
	ErrorCode   byte
	Name        string
	Description string
}

var bxErrors = []BxError{
	BxError{0, "ERR_NO", "No Err"},
	BxError{1, "ERR_OUTOFGROUP", "Command Group Err"},
	BxError{2, "ERR_NOCMD", "Not Found"},
	BxError{3, "ERR_BUSY", "The Controller is busy now"},
	BxError{4, "ERR_MEMORYVOLUME", "Out of the Memory Volume"},
	BxError{5, "ERR_CHECKSUM", "CRC16 Checksum Err"},
	BxError{6, "ERR_FILENOTEXIST", "File Not Exist"},
	BxError{7, "ERR_FLASH", "Flash Access Err"},
	BxError{8, "ERR_FILE_DOWNLOAD", "File Download Err"},
	BxError{9, "ERR_FILE_NAME", "Filename Err"},
	BxError{10, "ERR_FILE_TYPE", "File type Err"},
	BxError{11, "ERR_FILE_CRC16", "File CRC16 Err"},
	BxError{12, "ERR_FONT_NOT_EXIST", "Font Library Not Exist"},
	BxError{13, "ERR_FIRMWARE_TYPE", "Firmware Type Err (Check the controller type)"},
	BxError{14, "ERR_DATE_TIME_FORMAT", "Date Time format Err"},
	BxError{15, "ERR_FILE_EXIST", "File Exist for File overwrite"},
	BxError{16, "ERR_FILE_BLOCK_NUM", "File block number Err"},
}

func GetError(code byte) BxError {
	return bxErrors[code]
}
