| 1 | /* |
|---|
| 2 | DMW_Status.h |
|---|
| 3 | |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef __DMW_STATUS_H__ |
|---|
| 7 | #define __DMW_STATUS_H__ |
|---|
| 8 | |
|---|
| 9 | #include "DMW_Dummy.h" |
|---|
| 10 | |
|---|
| 11 | #ifdef __cplusplus |
|---|
| 12 | extern "C" { |
|---|
| 13 | #endif |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | enum enumSTATUS |
|---|
| 17 | { |
|---|
| 18 | statusOK = 0, |
|---|
| 19 | |
|---|
| 20 | /* General Error */ |
|---|
| 21 | statusError = -7100, |
|---|
| 22 | statusInvalidArgument = -7101, /* some of arguments are invalid. */ |
|---|
| 23 | statusOutOfMemory = -7102, /* out of memory */ |
|---|
| 24 | statusOutOfRange = -7103, |
|---|
| 25 | statusNotImpl = -7104, /* not implemented yet. */ |
|---|
| 26 | statusOutOfResource = -7105, /* out of resource (task, sema4, etc..) */ |
|---|
| 27 | statusTimeout = -7106, /* timeout.. */ |
|---|
| 28 | statusOverflow = -7107, /* something overflow. queue, stack, etc.. */ |
|---|
| 29 | statusNotFound = -7108, /* not found. */ |
|---|
| 30 | /*statusCancelled = -7109, */ /* request was cancelled. */ |
|---|
| 31 | statusNoResponse = -7110, /* need not response to caller. */ |
|---|
| 32 | statusNotInitialized = -7111, /* module/library not initialized. */ |
|---|
| 33 | statusInvalidState = -7112, /* invalid state for the request */ |
|---|
| 34 | statusNotChanged = -7113, /* nothing changed */ |
|---|
| 35 | |
|---|
| 36 | /* NVRAM °ü·Ã.. */ |
|---|
| 37 | statusEepromError = -7200, /* EEPROM¿¡ ÀϹÝÀûÀÎ ¿¡·¯ ¹ß»ý. */ |
|---|
| 38 | statusFlashError = -7201, /* Flash¿¡ ÀϹÝÀûÀÎ ¿¡·¯ ¹ß»ý. */ |
|---|
| 39 | statusNvRamBadAddress = -7202, /* ÁöÁ¤µÈ NVRAM ÁÖ¼Ò°¡ À¯È¿ÇÏÁö ¾Ê´Ù. (dangerous area) */ |
|---|
| 40 | statusInvalidRange = -7203, /* ...»ç¿ë±ÝÁö */ |
|---|
| 41 | statusNvRamNotFormatted = -7204, /* Æ÷¸ËÀÌ ¾ÆÁ÷ µÇÁö ¾Ê¾Ò°Å³ª, Áß¿ä ¿µ¿ªÀÌ ¼Õ»óµÇ¾ú´Ù. */ |
|---|
| 42 | statusBadBlock = -7205, /* Flash blockÀÌ invalid blockÀ̹ǷΠ»ç¿ë ºÒ°¡´ÉÇÏ´Ù */ |
|---|
| 43 | |
|---|
| 44 | /* ä³Î °ü·Ã..*/ |
|---|
| 45 | statusPSIPError = -7300, /* PSIP Á¤º¸ÀÇ ³»¿ëÀÌ ÀÌ»óÇÔ. */ |
|---|
| 46 | /*statusChannelNotFound = -7301, */ /* ¿øÇϴ ä³Î(Á¤º¸)ÀÌ Á¸ÀçÇÏÁö ¾ÊÀ½. */ |
|---|
| 47 | statusChannelTuneError = -7302, /* ä³Î Æ©´×¿¡ ½ÇÆÐ. */ |
|---|
| 48 | statusInvalidChannelType = -7303, /* À߸øµÈ ä³Î À¯Çü. (ex: QAM in terrestrial) */ |
|---|
| 49 | statusChannelDuplicated = -7304, /* Áߺ¹µÈ ä³ÎÀÌ ¹ß°ßµÇ¾úÀ½. */ |
|---|
| 50 | statusSkippedChannel = -7305, /* disabled channelÀÌ¹Ç·Î ÇØ´ç ÀÛ¾÷À» ÇÒ ¼ö ¾øÀ½. */ |
|---|
| 51 | statusScrambled = -7306, /* ä³ÎÀÌ scramble µÇ¾úÀ½ */ |
|---|
| 52 | |
|---|
| 53 | /* Callback result */ |
|---|
| 54 | statusNoSignal = -7401, /* ½ÅÈ£°¡ ³Ê¹« ¾àÇÔ. */ |
|---|
| 55 | statusNoVCT = -7402, /* VCT ¾øÀ½. Uid Æ©´× ÇÔ¼ö¿¡¼ */ |
|---|
| 56 | statusNoPSI = -7403, /* PSI ¾øÀ½. */ |
|---|
| 57 | statusNoVCTPSI = -7404, /* VCT/PSI ¸ðµÎ ¼ö½Å ¾ÈµÊ (Direct RF tuningÀÇ °æ¿ì) */ |
|---|
| 58 | statusVideoError = -7405, |
|---|
| 59 | statusCancelled = -7406, /* channel tuning command was cancelled. */ |
|---|
| 60 | statusInvalidVCT = -7407, /* VCT has no PID info, invalid PID, etc.. */ |
|---|
| 61 | statusInvalidPSI = -7408, /* PSI has no */ |
|---|
| 62 | statusAnalogError = -7409, |
|---|
| 63 | statusUidNotFound = -7410, |
|---|
| 64 | statusChannelNotFound = -7411, /* specified channel not found, no program found. */ |
|---|
| 65 | |
|---|
| 66 | /* 1394 */ |
|---|
| 67 | statusNodeNotFound = -7501, /* node not found. */ |
|---|
| 68 | statusNotCompatibleDevice = -7503, /* the device is not supported */ |
|---|
| 69 | statusConnectionFail = -7504, /* Isochronous connection failed. */ |
|---|
| 70 | statusControlFail = -7505, /* device control failed. */ |
|---|
| 71 | statusTooManyDevices = -7506, /* connected device are too many. some devices are skipped. */ |
|---|
| 72 | statusNoChangeDetected = -7507, /* there is no change */ |
|---|
| 73 | |
|---|
| 74 | /* ETC */ |
|---|
| 75 | statusQueueFull = -7601 /* only for use in Dmc_SendCommand */ |
|---|
| 76 | |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | typedef enum enumSTATUS STATUS; |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | /* conventional usage of STATUS: |
|---|
| 84 | // zero : success |
|---|
| 85 | // non-zero : failure, error code (probably negative value) |
|---|
| 86 | |
|---|
| 87 | // Çѹø Á¤ÀÇµÈ »ó¼ö°ªÀÌ ³ªÁß¿¡ ¹Ù²î´Â ÀÏÀÌ ¾ø¾î¾ß ÇÑ´Ù. |
|---|
| 88 | */ |
|---|
| 89 | |
|---|
| 90 | extern const char *DMW_CDB_ErrString(STATUS err); |
|---|
| 91 | /* extern const char *DMW_CDB_ErrString(DHL_RESULT err); */ |
|---|
| 92 | /* ¿¡·¯ ¹®ÀÚ¿ Äõ¸® ÇÔ¼ö. */ |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | #ifdef __DEFINE_ERR_STRING__ |
|---|
| 96 | /* |
|---|
| 97 | // ÀÌ ¸ÅÅ©·Î´Â application¿¡¼ Æ÷ÇÔÇÏ¸é ¾ÈµÊ. ¸µÅ©¿¡·¯.. |
|---|
| 98 | */ |
|---|
| 99 | |
|---|
| 100 | struct c2s_t { |
|---|
| 101 | STATUS status; |
|---|
| 102 | const char *string; |
|---|
| 103 | }; |
|---|
| 104 | |
|---|
| 105 | struct c2s_t g_ErrorStringTable[] = |
|---|
| 106 | { |
|---|
| 107 | { statusOK , "Success", }, |
|---|
| 108 | { statusError , "General Error", }, |
|---|
| 109 | { statusInvalidArgument , "Invalid Argument Error", }, |
|---|
| 110 | { statusOutOfMemory , "Out of Memory Error", }, |
|---|
| 111 | { statusOutOfRange , "Out of Range Error", }, |
|---|
| 112 | { statusNotImpl , "Not implemented yet", }, |
|---|
| 113 | { statusOutOfResource , "Out of Resource Error", }, |
|---|
| 114 | { statusTimeout , "Timeout", }, |
|---|
| 115 | { statusOverflow , "Overflow Error", }, |
|---|
| 116 | { statusNotFound , "Not found Error", }, |
|---|
| 117 | /*{ statusCancelled , "Cancelled", }, */ |
|---|
| 118 | { statusNoResponse , "No Response", }, |
|---|
| 119 | /* NVRAM °ü·Ã.. , */ |
|---|
| 120 | { statusEepromError , "EEPROM Error", }, |
|---|
| 121 | { statusFlashError , "FlashMemory Error", }, |
|---|
| 122 | { statusNvRamBadAddress , "Bad Address used in NvRam", }, |
|---|
| 123 | { statusInvalidRange , "Invalid Range Error", }, |
|---|
| 124 | { statusNvRamNotFormatted , "NvRam Not Formatted", }, |
|---|
| 125 | /* ä³Î °ü·Ã.. , */ |
|---|
| 126 | { statusPSIPError , "PSIP Error", }, |
|---|
| 127 | { statusChannelTuneError , "Channel Tune Error", }, |
|---|
| 128 | { statusInvalidChannelType , "Invalid Channel tyep", }, |
|---|
| 129 | { statusChannelDuplicated , "Channel Duplicated", }, |
|---|
| 130 | { statusSkippedChannel , "Skipped Channel", }, |
|---|
| 131 | { statusScrambled , "Scrambled", }, |
|---|
| 132 | /* Callback result , */ |
|---|
| 133 | { statusNoSignal , "No Signal", }, |
|---|
| 134 | { statusNoVCT , "VCT Loading Error", }, |
|---|
| 135 | { statusNoPSI , "PSI Loading Error", }, |
|---|
| 136 | { statusNoVCTPSI , "VCT/PSI Loading Error", }, |
|---|
| 137 | { statusVideoError , "Video Error", }, |
|---|
| 138 | { statusCancelled , "Command Cancelled", }, |
|---|
| 139 | { statusInvalidVCT , "Invalid VCT Error", }, |
|---|
| 140 | { statusInvalidPSI , "Invalid PSI Error", }, |
|---|
| 141 | { statusAnalogError , "Analog Tuning Error", }, |
|---|
| 142 | { statusUidNotFound , "UID Not Found", }, |
|---|
| 143 | { statusChannelNotFound , "Channel Not Found", }, |
|---|
| 144 | /* 1394 */ |
|---|
| 145 | { statusNodeNotFound , "1394 node not found", }, |
|---|
| 146 | { statusNotCompatibleDevice , "Not compatible 1394 device", }, |
|---|
| 147 | { statusConnectionFail , "Isochronous connection failed", }, |
|---|
| 148 | { statusControlFail , "1394 device control failed", }, |
|---|
| 149 | { statusTooManyDevices , "Too many devices connected", }, |
|---|
| 150 | { statusNoChangeDetected , "No change detected", }, |
|---|
| 151 | }; |
|---|
| 152 | |
|---|
| 153 | int g_nErrorStringTable = sizeof(g_ErrorStringTable)/sizeof(g_ErrorStringTable[0]); |
|---|
| 154 | |
|---|
| 155 | const char *DMW_CDB_ErrString(STATUS err) |
|---|
| 156 | { |
|---|
| 157 | int i; |
|---|
| 158 | |
|---|
| 159 | if (err > -8000 && err <= -7000) { |
|---|
| 160 | /* DMW error code. */ |
|---|
| 161 | for (i=0; i<g_nErrorStringTable; i++) { |
|---|
| 162 | if (err == g_ErrorStringTable[i].status) |
|---|
| 163 | return g_ErrorStringTable[i].string; |
|---|
| 164 | } |
|---|
| 165 | return("Unknown Error"); |
|---|
| 166 | } |
|---|
| 167 | else { |
|---|
| 168 | return ErrorString((DHL_RESULT) err); |
|---|
| 169 | } |
|---|
| 170 | } |
|---|
| 171 | |
|---|
| 172 | #endif /* __DEFINE_ERR_STRING__ */ |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | #ifdef __cplusplus |
|---|
| 176 | }; |
|---|
| 177 | #endif |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | #endif /* __DMW_STATUS_H__ */ |
|---|
| 181 | |
|---|
| 182 | /******************************************************************** |
|---|
| 183 | Updatehistory: |
|---|
| 184 | |
|---|
| 185 | 1.01 2004/12/01 statusNotChanged Ãß°¡ |
|---|
| 186 | 1.00 2004/11/? History °ü¸® ½ÃÀÛ |
|---|
| 187 | |
|---|
| 188 | 040601 statusDmcQFull, statusBadBlock Ãß°¡ |
|---|
| 189 | |
|---|
| 190 | ********************************************************************/ |
|---|
| 191 | |
|---|