/*                       Munich,  Germany
                     COMPANY CONFIDENTIAL
                     All Rights Reserved

.AUTHOR         U. Schmitt, ICM MP PO8 MCH53

.PROJECT        WINSWUP

.SHORT_DESCR    Interface to the lowlayer-DLL

.SW_COMPONENT

.SW_TYPE

.VERSION        0.5             please increase the two defines !!!

.DATE           2001-12-17

.EXIT_CODES

.STATUS         FIRST_TRY

.CHANGE_CONTROL

Version |  Date    | Changed by | Reason for Change
--------+----------+------------+----------------------------------------------
 0.1    |26.07.2001| Schmittu   | file created
--------+----------+------------+----------------------------------------------
 0.2    |2001-08-21| JKue       | made it compileable ... ( one komma was missing and one comma was a dot )
--------+----------+------------+----------------------------------------------
 0.3    |2001-08-31| J.Garrido  | new error string added for BGJ.
--------+----------+------------+----------------------------------------------
 0.4    |2001-08-28| Schmittu   | new: en_CANT_CONNECT
		|          |            |      en_ERASE_AREA_NOT_OK
        |          |            |      en_MALLOC_REQUEST_FLASH_BLOCKS
		|          |            |      en_INCOMPATIBLE_VERSION
		|          |            |      en_MUTEX
		|          |            |      en_COMPRESS_NOT_SUPPORTED
        |          |            |      en_FLASHBLOCK_SIZE_DEFAULT
		|          |            |      en_INVALID_HANDLE_VALUE
		|          |            |      en_MOBILE_SW_TRANS
		|          |            |      en_TIMEOUT_REQUEST_FLASH_BLOCKS
		|          |            |      en_WAIT_ACK_EOT
		|          |            |      en_DATA_ACCESS
		|          |            |      en_ALTER_CONNECT
		|          |            |      en_ALTER_TRANSMISSION
		|          |            |      en_ALTER_SW_VERSION
		|          |            |      en_ALTER_MOBILE
		|          |            |      en_ALTER_SW
		|          |            |      en_ALTER_MOBILE_DEFECT
		|          |            |      en_ALTER_FILE_ERROR
	    |          |            |      en_ALTER_FILE_ALLOC_ERROR,
		|          |            | deleted: en_NO_SPECIAL_ERROR
--------+----------+------------+----------------------------------------------
 0.5    |2001-12-17| Schmittu   | new : en_WAIT_SW_VERSION
--------+----------+------------+----------------------------------------------
 0.6    |2002-04-25| L.Sillge   | new : en_BOOTCORE_MASK, en_BOOTCORE_BAUDRATE
		|          |            |       en_SIG_WRONGHASH, en_SIG_NOSIGNATURE, 
		|          |            |       en_SIG_SIGNREJECT,en_SIG_GENERAL
--------+----------+------------+----------------------------------------------

.STILL_TODO
*/

/* INDENT: -nbr -nce -ei -ip -lp -pro -sc -c:33 -cci:3 -cd:33 -ci:3 -cli:3 -cp:0 -d:0 -di:0 -i:3 -l:78 -lc:78 -tabs:3  -tabu */



/*********************************************************************************************************/


#define ERR_TEXT_VERS_MAJOR  0
#define ERR_TEXT_VERS_MINOR  51
#define ERR_TEXT_DEVELOPER   "sillgel"


typedef struct
{
    unsigned int ui_enError;
    unsigned int ui_enAltError;     // if 0 : not relevant
    char * pszDescription;
} t_enumErrorDescription;



t_enumErrorDescription ErrorDescription[] =
{

                                    // wseril1.c
    { en_ALREADY_OPEN ,         en_ALTER_CONNECT , "ComPort is alrady open"},
    { en_CREATE_FILE ,          en_ALTER_CONNECT , "ComOpen : error on CreateFile"},
    { en_SET_COMMSTATE ,        en_ALTER_TRANSMISSION , "Error on Changing Com-State"},
    { en_NOT_OPEN ,             en_ALTER_CONNECT , "ComPort is not open"},
    { en_TIMEOUT ,              en_ALTER_CONNECT , "Error on Changing Timeout"},
    { en_GET_BAUD ,             en_ALTER_CONNECT , "Error on getting baudrate"},
    { en_BAUDRATE ,             en_ALTER_CONNECT , "Error on configuring, false baudrate"},
    { en_WRITE_FILE ,           en_ALTER_CONNECT , "Error on WriteFile"},
    { en_READ_FILE ,            en_ALTER_CONNECT , "Error on ReadFile"},
	{ en_INVALID_HANDLE_VALUE , en_ALTER_CONNECT , "Invalid Handle for Com-Port"},

                                    // wseril2.c
    { en_NO_VERSION ,           0 , "No version number of Serial Low-DLL available"},
    { en_DEFAULT_CMD_BLOCKS ,   en_ALTER_TRANSMISSION , "Error in HandleDefaultCmdBlocks"},		// not used
    { en_WAIT_ON_CMD_BLOCK ,    en_ALTER_TRANSMISSION , "Error on waiting for CMD-Block"},
    { en_MAX_BIN_LEN_REACHED ,  en_ALTER_TRANSMISSION , "Maximum Bin-length reached"},
    { en_UNKNOWN_BYTE ,         en_ALTER_TRANSMISSION , "Unknown Byte %02X received"},
    { en_REC_TIMEOUT ,          en_ALTER_TRANSMISSION , "Receive-Timeout, nothing received"},
    { en_UNKNOWN_CHAR ,         en_ALTER_TRANSMISSION , "Unknown character received, now flushing inbuf"},
    { en_UNKNOWN_REC_VALUE ,    en_ALTER_TRANSMISSION , "Unknown retval %d from ReceiveValue Value received = %02Xh"},
    { en_COMM_ERROR ,           en_ALTER_TRANSMISSION , "Aborting due to transmission-error"},
    { en_CHECK_SUM_ERROR ,      en_ALTER_TRANSMISSION , "Check sum error"},
    { en_CMD_REC ,              en_ALTER_TRANSMISSION , "Unexpected Cmd-Block received"},
    { en_SERIAL_ERROR ,         en_ALTER_TRANSMISSION , "Error on serial interface"},
    { en_READ_CMD ,             en_ALTER_TRANSMISSION , "Error on read CMD-Block"},		// not used
    { en_WAIT_FF ,              en_ALTER_TRANSMISSION , "Timeout on waiting for FF"},

                                    // wseril3.c
    { en_NO_READY_FLASH_ERASE , en_ALTER_TRANSMISSION , "Error on waiting for FlashBlock-EraseReady"},
    { en_SEND_FLASH_ERASE ,     en_ALTER_TRANSMISSION , "Error on sending Erase-Flash-Block-CMD"},
	{ en_ERASE_AREA_NOT_OK ,    en_ALTER_SW_VERSION , "Wrong Erase-Address, not possible from %lXh to %lXh"},
	{ en_MALLOC_REQUEST_FLASH_BLOCKS , 0 , "No memory on malloc for Flash-Areas"},
	{ en_FLASHBLOCK_SIZE_DEFAULT , en_ALTER_TRANSMISSION , "Unknown Answer from Mobile on request for Erase-Area"},
	{ en_TIMEOUT_REQUEST_FLASH_BLOCKS , en_ALTER_TRANSMISSION , "Timeout-Error waiting for Test-Area-ACK"},

                                    // wmob_err.c
    { en_RAM_FF ,               en_ALTER_MOBILE_DEFECT , "Error on RAM-Test with FF"},
    { en_RAM_PATTERN ,          en_ALTER_MOBILE_DEFECT , "Error on RAM-Test with pattern"},
    { en_RAM_00 ,               en_ALTER_MOBILE_DEFECT , "Error on RAM-Test with 00"},
    { en_RAM_UNKNOWN ,          en_ALTER_MOBILE_DEFECT , "Unknown Error on RAM-Test"},
    { en_VOLTAGE_RANGE ,        0 , "Erase-Error Block %d : Vpp voltage range"},
    { en_CMD_SEQUENCE ,         0 , "Erase-Error Block %d : Error in the command sequence"},
    { en_ERASE_NOT_POSSIBLE ,   0 , "Erase-Error Block %d : Erase not possible"},
    { en_NO_BLOCK ,             0 , "Erase-Error Block %d : Block does not exist"},
    { en_BYTE_PROG ,            0 , "Byte-Program-Error Nr:  %d on adress %02X%02X%02X"},
    { en_FINAL_CHECK ,          0 , "Check-sum-error final test"},
    { en_UNKNOWN_FLASH ,        0,  "Unknown flash"},
    { en_NOT_SUPPORTED ,        0 , "Function not supported until now in Mobile"},
    { en_UNKNOWN_ERROR ,        0 , "Unknown Mobile-Error: %02X"},

                                    // wbfbtool.c
    { en_BFB_NO_CALLBACK ,      0 , "No CallBackFunctions for BFB-Lib installed"},
    { en_BFB_COMM_NOT_OPEN ,    0 , "Could not open Comport for BFB-Lib, maybe Comport is in use"},
    { en_BFB_MOBILE_NO_SWITCHON,0 , "Could not switch on Mobile"},
    { en_BFB_MOBILE_NO_PING ,   en_ALTER_CONNECT , "Could not Ping Mobile"},
    { en_THIS_FILE_NO_NEW_UPDATE ,  0 , "This file can\'t be updated with new concept"},
    { en_BFB_NO_NEW_UPDATE ,    0 , "No answer from Mobile, maybe not with new Update-Concept ?"},
    { en_BFB_READY_FALSE ,      0 , "BFB : ready and false"},		// not used
    { en_CUSTOMER_REBOOT ,      0 , "Error on requesting customer reboot"},
    { en_PUT_COUNT ,            0 , "Error on requesting put count"},

                                    // swupwork.c
    { en_NO_DATE_TIME ,         en_ALTER_SW_VERSION , "No Date/Time-Info available, impossible to DIFF-Swup"},
    { en_WRONG_DATE_TIME ,      en_ALTER_SW_VERSION , "Wrong Date/Time for DIFF-SWUP ! XDI must fit exactly to SW in Mobile"},
    { en_NO_REQUEST ,           en_ALTER_TRANSMISSION , "No Request for Update-SW after Bootstraploader"},
    { en_ERR_SEND_UPDATE ,      0 , "Error on requesting update-sw"},
    { en_CANT_OPEN ,            en_ALTER_TRANSMISSION , "Opening Comport %d with Speed %d Baud not possible"},
    { en_ERR_WAIT_FLASH_CODE ,  en_ALTER_TRANSMISSION , "Error on waiting for Flash-Code"},
    { en_UNKNOWN_FLASH_CODE ,   0 , "Unknown Flashcode %02X%02X"},
    { en_WAIT_FLASH_SIZE ,      en_ALTER_TRANSMISSION , "Error on Requesting Flash-Size"},
    { en_WRONG_FLASH_SIZE ,     en_ALTER_SW_VERSION , "Error : you are trying to update a SW for %ld Bytes into a Mobile with only space for %ld Bytes !"},
    { en_NO_UPDATE ,            en_ALTER_SW_VERSION , "Error : Update of %s SW not possible into a %s !"},
    { en_INCOMPATIBLE ,         en_ALTER_SW_VERSION , "Error : SW-Date and Version are incompatible, Mobile : %s  Date : %s  <=>  File : %s  Date : %s !"},
    { en_INCOMPATIBLE_VERS ,    en_ALTER_SW_VERSION , "Error : SW-Version is incompatible, Mobile: %s <=> File: %s !"},
    { en_WAIT_SPLIT_ID_ANSWER , 0 , "Error on waiting for Split-ID-Answer"},
    { en_WRONG_SPLIT_ID ,       0 , "Wrong Split-ID, SW and LanguageGroup dont fit together"},
    { en_MALLOC_ERROR ,         0 , "Malloc error"},			// not used
    { en_ENABLE_FLASHBLOCK ,    0 , "Error on enabling flash block"},
    { en_WAIT_COMPRESS_ANSWER , 0 , "Error on waiting for Compression-Answer"},
    { en_WAIT_LANGINFO_ANSWER , 0 , "Error on waiting for LanguageGroup-Answer"},
    { en_WAIT_CALC_SPLIT_INFO_ANSWER , 0 , "Error on waiting for Splitinfo answer"},
    { en_WAIT_STAT_DATA ,       0 , "Error on waiting for Stat-Data"},
    { en_SW_PROJECT ,           0 , "No Update-SW found for Project : %s SVN %2X %s SynchStation"},
	{ en_UNABLE_WRITE_BGJ,      0 , "Unable to write BGJ"},
	{ en_CANT_CONNECT ,         en_ALTER_CONNECT , "Cant connect to Mobile with BootstrapLoader on Com %d"},
	{ en_INCOMPATIBLE_VERSION , 0 , "Library and Executable have different Interface-Versions !"},
	{ en_MUTEX ,                0 , "Error opening Mutex. Update Nr: %d"},
	{ en_COMPRESS_NOT_SUPPORTED, 0, "Error : Compression/ Algorithm not supported"},
	{ en_MOBILE_SW_TRANS ,      en_ALTER_TRANSMISSION , "Error on Transmission"},
	{ en_WAIT_ACK_EOT ,         en_ALTER_TRANSMISSION , "Error on waiting for Ack EOT"},
	{ en_WAIT_SW_VERSION ,      en_ALTER_TRANSMISSION , "Error on waiting for SW-Version"},

                                    // dyna_dll.c
    { en_SCAN_PROJECTS ,        0 , "Error on ScanDirectoryForAvailableProjects"},
    { en_DLL_OUT_OF_DATE ,      en_ALTER_SW_VERSION , "DLL is out of date, get a new package !"},
    { en_LOAD_FAILED ,          0 , "Load failed : %s"},

                                    // hehawrap.c / fihawrap.c
    { en_LIB_EXE_DIFF ,         0 , "Library and Executable have different Interface-Versions, Executable must be compiled new !"},
    { en_FILE_READ ,            en_ALTER_FILE_ERROR , "Alread a file read ! Please release first !"},
    { en_INIT_READ ,            en_ALTER_FILE_ERROR , "Error occured Initialization for READ : %d"},
    { en_CHK_SUM ,              en_ALTER_FILE_ERROR , "ChecksummError in HEADER of XBI-File"},
    { en_HEAP_NOT_INI ,         en_ALTER_FILE_ERROR , "HeapLib not initialized !"},
    { en_HEAP_LEN ,             en_ALTER_FILE_ERROR , "Data len in heap zero, HeapLib initialized ?"},
    { en_STRANGE_ERROR ,        en_ALTER_FILE_ERROR , "Strange Error :-)) Number %d !"},
    { en_ONLY_EGOLD ,           en_ALTER_FILE_ERROR , "Currently only EGOLD-Projects supported !"},
    { en_NO_SW ,                en_ALTER_FILE_ERROR , "No Update-SW found !"},
    { en_READ_XBI ,             en_ALTER_FILE_ERROR , "Some Error : %d occured on reading XBI-Data"},
    { en_OUTDATED ,             en_ALTER_FILE_ERROR , "Your version of WINSWUP/LIBRARY is outdated ! Software-Update not possible ! Get a new version !"},
    { en_OPEN_FILE ,            en_ALTER_FILE_ERROR , "Can't open file %s"},
    { en_XBI_LEN ,              en_ALTER_FILE_ERROR , "XBI-Length 0 !"},
    { en_NO_SIEMENS ,           en_ALTER_MOBILE , "Not a Siemens-Mobile-Phones-File"},
    { en_FILE_SIZE ,            en_ALTER_FILE_ERROR , "Error occured during FileSize-Detection : %d"},
    { en_CANT_ALLOC ,           en_ALTER_FILE_ALLOC_ERROR , "Could not allocate %lu Bytes for XBI-File"},

                                    // heaphand.c / filehand.c
    { en_CANT_ADD ,             en_ALTER_FILE_ERROR  , "Can't add element for erase info!"},
    { en_CANT_COPY ,            en_ALTER_FILE_ERROR  , "Could not copy element to list!"},
    { en_CANT_MALLOC ,          en_ALTER_FILE_ERROR  , "Can't malloc heap for add. map info!"},
    { en_MORE_INFO ,            en_ALTER_FILE_ERROR  , "More map info in xbi header than expected!"},
    { en_LOCATER_ENTRY ,        en_ALTER_FILE_ALLOC_ERROR , "Error mallocing heap for locater entry!"},
    { en_SPLIT_INSERT ,         en_ALTER_FILE_ALLOC_ERROR , "SplitElementInsert returns error!"},
    { en_HEAP_CORRUPT ,         en_ALTER_FILE_ERROR , "Heap data corrupt at location %d"},
    { en_MEM_ALLOC ,            en_ALTER_FILE_ERROR , "Heapchk: no memory allocated!"},
    { en_HEAP_INCON ,           en_ALTER_FILE_ERROR , "Heapchk: detected inconsistency!"},
    { en_FSEEK ,                en_ALTER_FILE_ERROR , "Error on data access"},
    { en_FREAD ,                en_ALTER_FILE_ERROR , "Read error in file %s!"},
    { en_DESTROYED ,            en_ALTER_FILE_ERROR , "Data file destroyed at %lu"},
    { en_STAT_FILE ,            en_ALTER_FILE_ERROR , "Error on file access"},
    { en_READ_KENNUNG ,         en_ALTER_FILE_ERROR , "ReadKennung returned: %d"},
    { en_COUNT_BYTES ,          en_ALTER_FILE_ERROR , "Error: CountXbiHeaderBytes returnes %d"},
    { en_NO_READ_ACCESS ,       en_ALTER_FILE_ERROR , "No read access to file %s"},
    { en_FIND_FILE ,            en_ALTER_FILE_ERROR , "Can't find file %s"},
	{ en_DATA_ACCESS ,          en_ALTER_FILE_ERROR , "Error on data access"},

                                    // swup_eg.c
    { en_OPEN_COMPORT ,         en_ALTER_CONNECT , "Opening Comport %d with Speed %d Baud not possible"},
    { en_REC_BLOCK1 ,           en_ALTER_TRANSMISSION , "Nothing received after BOT-Block1"},
    { en_WRONG_BLOCK1 ,         en_ALTER_TRANSMISSION , "Wrong Char %02X received after BOT-Block1"},
    { en_REC_BLOCK2 ,           en_ALTER_TRANSMISSION , "Nothing received after BOT-Block2"},
    { en_WRONG_BLOCK2 ,         en_ALTER_TRANSMISSION , "Wrong Char %02X received after BOT-Block2"},
    { en_REC_BLOCK3 ,           en_ALTER_TRANSMISSION , "Nothing received after BOT-Block3"},
    { en_WRONG_BLOCK3 ,         en_ALTER_TRANSMISSION , "Wrong Char %02X received after BOT-Block3"},
    { en_REC_BLOCK4 ,           en_ALTER_TRANSMISSION , "Nothing received after BOT-Block4"},
    { en_WRONG_BLOCK4 ,         en_ALTER_TRANSMISSION , "Wrong Char %02X received after BOT-Block4"},
    { en_REC_BAUD_BLOCK ,       en_ALTER_TRANSMISSION , "Nothing received after Baud-BOT-Block"},
    { en_WRONG_BAUD_BLOCK ,     en_ALTER_TRANSMISSION , "Wrong Char %02X received after Baud-BOT-Block"},
    { en_CHANGE_SPEED ,         en_ALTER_TRANSMISSION , "Changing Speed on Comport %d to %d Baud not possible, possible errors: wrong Baudrate / not installed driver/ wrong serialcard ?"},
    { en_REC_PING ,             en_ALTER_TRANSMISSION , "Nothing received after Baud-Ping"},
    { en_WRONG_PING ,           en_ALTER_TRANSMISSION , "Wrong char %02X received after Baud-Ping"},
    { en_REC_FALLBACK ,         en_ALTER_TRANSMISSION , "Nothing received after fallback to 57kBaud"},
    { en_WRONG_FALLBACK ,       en_ALTER_TRANSMISSION , "Wrong char %02X after fallback to 57kBaud"},
    { en_REC_SYNC_BYTE ,        en_ALTER_TRANSMISSION , "Nothing received after synch-byte"},
    { en_WRONG_SYNC_BYTE ,      en_ALTER_TRANSMISSION , "Wrong char %02X after synch-byte"},
    { en_REC_BLOCK5K ,          en_ALTER_TRANSMISSION , "Nothing received after BOT-Block 5k"},
    { en_WRONG_BLOCK5K ,        en_ALTER_TRANSMISSION , "Wrong char %02X after BOT-Block 5k"},

	{ en_ALTER_CONNECT ,        0 , "Cant connect mobile !\nCheck if attached correctly or switch baudrate or comport"},
	{ en_ALTER_TRANSMISSION ,   0 , "Cant connect mobile !\nCheck if attached correctly"},
	{ en_ALTER_SW_VERSION ,     0 , "Update not possible !\nWrong SW-version"},
	{ en_ALTER_MOBILE ,         0 , "Update not possible !\nWrong mobile"},
	{ en_ALTER_SW ,             0 , "Update not possible !\nSW defect"},
	{ en_ALTER_MOBILE_DEFECT ,  0 , "Mobile defect"},
	{ en_ALTER_FILE_ERROR,      0 , "Error on reading new Mobile-SW" },
	{ en_ALTER_FILE_ALLOC_ERROR, 0 , "Error on reading new Mobile-SW, not enough memory" },

	{ en_BOOTCORE_MASK,         0 , "No Bootcore detected"},
	{ en_BOOTCORE_BAUDRATE,     0 , "Bootcore does't support selected baudrate"},

	{ en_SIG_WRONGHASH ,        0 , "Mobile requested signature, but software doesn't support it"},
	{ en_SIG_NOSIGNATURE,       0 , "Mobile requested signature, but signature data are not available"},
	{ en_SIG_SIGNREJECT,        0 , "Software signature was rejected"},
	{ en_SIG_GENERAL,           0 , "Software signature negotiation failure (%02X)"},


    { en_OVERFLOW ,             0 , "Overflow on error list"}
};

