| 1 | /** |
|---|
| 2 | @file |
|---|
| 3 | DLIB_SDDS.h |
|---|
| 4 | |
|---|
| 5 | @brief |
|---|
| 6 | Type defines used for SDDS (software download data service) |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | #ifndef __DLIB_SDDS_H__ |
|---|
| 11 | #define __DLIB_SDDS_H__ |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include "DHL_Types.h" |
|---|
| 15 | //#include "DLIB_BitOp.h" |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #ifdef __cplusplus |
|---|
| 20 | extern "C" { |
|---|
| 21 | #endif |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | #if COMMENT |
|---|
| 26 | ____Overview____(){} |
|---|
| 27 | #endif |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | #if COMMENT |
|---|
| 32 | ____Config____(){} |
|---|
| 33 | #endif |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | #define SUPPORT_SDDS_DST_EXTENSION 1 |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | #if COMMENT |
|---|
| 41 | ____Types_Base____(){} |
|---|
| 42 | #endif |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | #define SDDS_Table_ID_Msg 0x3B |
|---|
| 47 | #define SDDS_Table_ID_Data 0x3C |
|---|
| 48 | |
|---|
| 49 | #define SDDS_Message_ID_DSI 0x1006 |
|---|
| 50 | #define SDDS_Message_ID_DII 0x1002 |
|---|
| 51 | #define SDDS_Message_ID_DDB 0x1003 |
|---|
| 52 | #define SDDS_Message_ID_DC 0x1005 |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | typedef struct { |
|---|
| 59 | UINT8 protocolDiscriminator; |
|---|
| 60 | UINT8 dsmccType; |
|---|
| 61 | UINT16 messageId; |
|---|
| 62 | UINT32 transactionId; |
|---|
| 63 | UINT8 adaptationLength; |
|---|
| 64 | UINT16 messageLength; |
|---|
| 65 | //dsmccAdaptationHeaderPtr_t adaptationHeader; |
|---|
| 66 | } sddsMessageHeader_t; |
|---|
| 67 | |
|---|
| 68 | typedef struct { |
|---|
| 69 | UINT8 table_id; |
|---|
| 70 | UINT8 section_syntax_indicator; |
|---|
| 71 | UINT16 table_id_extension; |
|---|
| 72 | UINT8 version_number; // not used. always 0 |
|---|
| 73 | UINT8 current_next_indicator; // not used. always 1 |
|---|
| 74 | UINT8 section_number; |
|---|
| 75 | UINT8 last_section_number; |
|---|
| 76 | } sddsSectionHeader_t; |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | #if COMMENT |
|---|
| 82 | ____Compat_Desc____(){} |
|---|
| 83 | #endif |
|---|
| 84 | |
|---|
| 85 | /** ¾Æ·¡ µÑ ÀÌ¿ÜÀÇ °ªÀº ¿¹¾à.. |
|---|
| 86 | */ |
|---|
| 87 | typedef enum { |
|---|
| 88 | eSystemHardwareDescriptor = 0x01, |
|---|
| 89 | eSystemSoftwareDescriptor = 0x02, |
|---|
| 90 | } compatDescriptorType; |
|---|
| 91 | |
|---|
| 92 | /** sdds¿¡¼ ÇöÀç Áö¿øÇϴ ŸÀÔÀº IEEE OUI ÇÑ Á¾·ù »ÓÀÌ´Ù. |
|---|
| 93 | */ |
|---|
| 94 | #define compatSpecifierType_IEEE_OUI 0x01 |
|---|
| 95 | |
|---|
| 96 | /* µðÁöÅнºÆ®¸²Å×Å©³î·ÎÁö OUI */ |
|---|
| 97 | #define IEEE_OUI_DST 0x001E1B |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | /** |
|---|
| 101 | DST¿¡¼ Á¤ÀÇÇÑ µð½ºÅ©¸³ÅÍ. |
|---|
| 102 | °øÀå¿¡¼ sdds°¡ ½ÇÇàµÇ´Â °æ¿ì, ÇØ´ç ½ºÆ®¸²¿¡ ÀÌ µð½ºÅ©¸³ÅͰ¡ Á¸ÀçÇØ¾ß ÇÑ´Ù. |
|---|
| 103 | ¹æ¼Û±¹¿¡¼ ¼ÛÃâÇÏ´Â sdds ½ºÆ®¸²¿¡´Â ÀÌ µð½ºÅ©¸³ÅͰ¡ ¾ø¾î¾ß ÇÑ´Ù. |
|---|
| 104 | |
|---|
| 105 | tag ¿Í ÇѹÙÀÌÆ® µ¥ÀÌÅ͸¸À¸·Î ±¸¼ºµÈ ¾ÆÁÖ °£´ÜÇÑ µð½ºÅ©¸³ÅÍ ÀÌ´Ù. length=1. |
|---|
| 106 | TAG (8 bit), LENGTH (8 bit), DATA (8 bit) |
|---|
| 107 | */ |
|---|
| 108 | #define compatSubDescFactoryLocationTag 0xF7 |
|---|
| 109 | #define compatSubDescFactoryLocationData 0x3E |
|---|
| 110 | |
|---|
| 111 | typedef struct |
|---|
| 112 | { |
|---|
| 113 | UINT8 subDescriptorType; |
|---|
| 114 | // ÀÌ subdescriptor ÀÇ Å¸ÀÔ. ŸÀÔ °ªÀº specifier°¡ ¾Ë¾Æ¼ Á¤ÇÔ. |
|---|
| 115 | |
|---|
| 116 | UINT8 subDescriptorLength; |
|---|
| 117 | // ¾Æ·¡ additional InformationÀÇ ¹ÙÀÌÆ® ±æÀÌ. |
|---|
| 118 | |
|---|
| 119 | UINT8 *additionalInformation; |
|---|
| 120 | // specifier(Á¦Á¶»ç)°¡ ÀÓÀÇ·Î »ç¿ë ÇÒ ¼ö ÀÖ´Â ¿µ¿ª. |
|---|
| 121 | |
|---|
| 122 | } sddsCompatSubDesc_t; |
|---|
| 123 | |
|---|
| 124 | typedef struct |
|---|
| 125 | { |
|---|
| 126 | UINT8 descriptorType; // one of compatDescriptorType |
|---|
| 127 | // sdds ¿¡¼´Â system HW, system SW µÎ°¡Áö¸¸ Áö¿øÇÑ´Ù. |
|---|
| 128 | |
|---|
| 129 | //UINT8 descriptorLength; |
|---|
| 130 | // descriptorType, descriptorLength (ÀÚ½Å)À» Á¦¿ÜÇÑ ¹ÙÀÌÆ® Å©±â. |
|---|
| 131 | // parsing µÈ ÀÌÈÄ¿¡´Â º° ÀÇ¹Ì ¾øÀ¸¹Ç·Î Á¦°Å. |
|---|
| 132 | |
|---|
| 133 | UINT8 specifierType; // should be compatSpecifierType_IEEE_OUI |
|---|
| 134 | UINT32 specifierData; // actually this is 24 bits OUI. |
|---|
| 135 | |
|---|
| 136 | UINT16 model; |
|---|
| 137 | UINT16 version; |
|---|
| 138 | |
|---|
| 139 | // ¾Æ·¡ Á¤º¸´Â Á¦Á¶»ç ¸¶À½´ë·Î »ç¿ëÇÒ ¼ö ÀÖ´Â ºÎºÐÀÌ´Ù. |
|---|
| 140 | // ÀÏ´Ü ÇÊ¿ä ÇÒ °ÍÀ¸·Î º¸À̹ǷΠparsingÀ» ÇØ ³õ¾Æ¾ß ÇÑ´Ù. |
|---|
| 141 | // |
|---|
| 142 | UINT8 subDescriptorCount; |
|---|
| 143 | // ¾Æ·¡ subDescriptors °¹¼ö. |
|---|
| 144 | sddsCompatSubDesc_t *subDescriptors; |
|---|
| 145 | // subDescriptor array. |
|---|
| 146 | |
|---|
| 147 | } sddsCompatDescEntry_t; |
|---|
| 148 | |
|---|
| 149 | typedef struct |
|---|
| 150 | { |
|---|
| 151 | //UINT16 descriptorLength; |
|---|
| 152 | // ÀÌ compat descriptor ÀÇ Àüü ¹ÙÀÌÆ® Å©±â. (ÀÚ½ÅÀº Á¦¿Ü) |
|---|
| 153 | // parsing µÈ ÈÄ¿¡´Â ÀÌ Á¤º¸´Â º° ÀÇ¹Ì ¾øÀ¸¹Ç·Î »èÁ¦. |
|---|
| 154 | |
|---|
| 155 | UINT16 descriptorCount; |
|---|
| 156 | // ¾Æ·¡ desc °¹¼ö. |
|---|
| 157 | // sdds ±Ô°Ý¿¡ ÀÇÇØ ÃÖ´ë 2°³¸¸ Áö¿øÇÑ´Ù. ÃÖ´ë°ª:2 |
|---|
| 158 | |
|---|
| 159 | sddsCompatDescEntry_t desc[2]; |
|---|
| 160 | // ÃÖ´ë 2°³ ¸¸ Áö¿øÇϹǷΠ2·Î Á¦ÇÑ. |
|---|
| 161 | // sdds ±Ô°Ý¿¡ ÀÇÇϸé desc[0]Àº HW Á¤º¸, desc[1]Àº SW Á¤º¸ÀÌ´Ù. |
|---|
| 162 | |
|---|
| 163 | } sddsCompatDesc_t; |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | #if COMMENT |
|---|
| 167 | ____Types_Desc____(){} |
|---|
| 168 | #endif |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | /** @name SDDS descriptor types |
|---|
| 172 | @{ |
|---|
| 173 | */ |
|---|
| 174 | #define SDDS_module_info_tag 0xB7 |
|---|
| 175 | #define SDDS_schedule_tag 0xBA |
|---|
| 176 | |
|---|
| 177 | // ¾Æ·¡´Â SDDS´Â ¾Æ´ÏÁö¸¸, A/90 ¿¡¼ Á¤ÀÇµÈ descriptor µéÀÌ´Ù. |
|---|
| 178 | #define A90_module_link_tag 0xB4 |
|---|
| 179 | #define A90_CRC32_tag 0xB5 |
|---|
| 180 | #define A90_group_link_tag 0xB8 |
|---|
| 181 | |
|---|
| 182 | #define A90_download_tag 0xA6 |
|---|
| 183 | #define A90_multiprotocol_encapsulation_tag 0xA7 |
|---|
| 184 | #define A90_data_service_tag 0xA4 |
|---|
| 185 | #define A90_PID_count_tag 0xA5 |
|---|
| 186 | #define A90_association_tag 0x14 |
|---|
| 187 | |
|---|
| 188 | #if SUPPORT_SDDS_DST_EXTENSION |
|---|
| 189 | // 100809, module info descÀÇ private data ºÎºÐÀ» descriptors list·Î ±¸¼ºÇÔ. |
|---|
| 190 | // ÇöÀç´Â ¾Æ·¡ descriptor Çϳª¸¸ Á¸Àç. |
|---|
| 191 | #define SDDS_DST_module_info_tag 0xC0 |
|---|
| 192 | |
|---|
| 193 | #endif |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | /** @} */ |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | #define ModuleType_BootLoader 0x01 |
|---|
| 202 | #define ModuleType_Application 0x08 |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | #if SUPPORT_SDDS_DST_EXTENSION |
|---|
| 206 | |
|---|
| 207 | /* |
|---|
| 208 | ÀÌ ¸ðµâ(firmware)ÀÇ Å¸ÀÔ ¹× µ¿ÀÛ °¡´ÉÇÑ Hardware º¸µå ¹öÀü ¸®½ºÆ®¸¦ ³ª¿ÇÑ´Ù. |
|---|
| 209 | |
|---|
| 210 | ÀÌ Å¸ÀÔÀÇ ÇʵåµéÀº ¸ðµÎ UINT8 ŸÀÔÀ̹ǷÎ, ÀÓÀÇ Æ÷ÀÎÅÍ¿¡ casting ÇØ¼ »ç¿ë °¡´ÉÇÏ´Ù. |
|---|
| 211 | */ |
|---|
| 212 | typedef struct |
|---|
| 213 | { |
|---|
| 214 | // descriptor tag: SDDS_DST_module_info_tag (0xc0) |
|---|
| 215 | |
|---|
| 216 | // Æß¿þ¾î ŸÀÔ. |
|---|
| 217 | // one of ModuleType_XXXX above.. |
|---|
| 218 | UINT8 moduleType; |
|---|
| 219 | |
|---|
| 220 | UINT8 moduleName[16+1]; // parser¿¡¼ null-term Ãß°¡ ÇÔ. |
|---|
| 221 | UINT8 moduleVer[8+1]; // parser¿¡¼ null-term Ãß°¡ ÇÔ. |
|---|
| 222 | |
|---|
| 223 | // ÀÌ Æß¿þ¾î°¡ µ¿ÀÛ °¡´ÉÇÑ Çϵå¿þ¾î ¹öÀü (¸®ºñÀü) ¸®½ºÆ®. |
|---|
| 224 | UINT8 numSupportedHwVersions; |
|---|
| 225 | UINT8 *supportedHwVersions; |
|---|
| 226 | // ÇÑ ÇÁ·ÎÁ§Æ®¿¡¼ º¸µå 20°³ Á¤µµ¸é ÃæºÐÇÒ µí.. |
|---|
| 227 | // |
|---|
| 228 | // HW ¹öÀü ÇÒ´çÀº º¸Åë ³ª¿Â ¼ø¼´ë·Î ¸í·ÉÀ» ÇÑ´Ù. |
|---|
| 229 | // º¸ÅëÀº 00 prototype, 01:ES 02:DS 03:PP 04:MP ¼ø¼°¡ µÈ´Ù. |
|---|
| 230 | // ÆÄ»ý ¸ðµ¨ÀÌ ¸¹Àºµ¥ (¿¹: tuner dual vendor, flash size variation..) |
|---|
| 231 | // ¸ðµ¨ ºÐ±â¸¦ ÇÏÁö ¾Ê°í HW ¹öÀü ¸¸À¸·Î ¼·Î °øÀ¯ÇÒ ¼ö ÀÖ´Ù. |
|---|
| 232 | |
|---|
| 233 | UINT32 fileCRC32; |
|---|
| 234 | |
|---|
| 235 | } sddsDstModuleInfoDesc_t; |
|---|
| 236 | |
|---|
| 237 | #endif // SUPPORT_SDDS_DST_EXTENSION |
|---|
| 238 | |
|---|
| 239 | |
|---|
| 240 | |
|---|
| 241 | /** ¸ðµâ Á¤º¸ µð½ºÅ©¸³ÅÍ |
|---|
| 242 | sdds¿¡¼´Â DIIÀÇ moduleInfoLength ´ÙÀ½ÀÇ µð½ºÅ©¸³ÅÍ ¸®½ºÆ®¿¡ Æ÷ÇԵȴÙ. |
|---|
| 243 | ¸ðµâ »ó¼¼ Á¤º¸¸¦ Ç¥ÇöÇÒ ¼ö ÀÖ´Ù. |
|---|
| 244 | */ |
|---|
| 245 | |
|---|
| 246 | typedef struct |
|---|
| 247 | { |
|---|
| 248 | // tag: SDDS_module_info_tag 0xB7 |
|---|
| 249 | |
|---|
| 250 | UINT8 encoding; |
|---|
| 251 | |
|---|
| 252 | UINT8 nameLength; |
|---|
| 253 | UINT8 *nameBytes; // UTF-8 format. |
|---|
| 254 | // parser¿¡¼´Â null-terminateµÉ ¼ö ÀÖµµ·Ï Ãß°¡ °ø°£ È®º¸ÇØ µÐ´Ù. |
|---|
| 255 | |
|---|
| 256 | UINT8 signatureType; |
|---|
| 257 | UINT8 signatureLength; |
|---|
| 258 | UINT8 *signatureBytes; |
|---|
| 259 | // parser¿¡¼´Â null-terminateµÉ ¼ö ÀÖµµ·Ï Ãß°¡ °ø°£ È®º¸ÇØ µÐ´Ù. |
|---|
| 260 | |
|---|
| 261 | UINT8 privateModuleLength; |
|---|
| 262 | UINT8 *privateModuleBytes; |
|---|
| 263 | |
|---|
| 264 | #if SUPPORT_SDDS_DST_EXTENSION |
|---|
| 265 | // dst Á¦Ç°¿¡¼´Â privateModuleBytes ´Â °¢ firmwareÀÇ »ó¼¼ Á¤º¸Àε¥, |
|---|
| 266 | // sddsDstModuleInfoDesc_t ŸÀÔÀ» Ȱ¿ëÇÑ´Ù. |
|---|
| 267 | |
|---|
| 268 | // privateModule Á¤º¸ Áß¿¡¼ ¾Æ·¡ Á¤º¸´Â º°µµ·Î ÃßÃâÇØ ³õµµ·Ï ÇÑ´Ù. |
|---|
| 269 | // Âü°í·Î ÀÌ ¾ÈÀÇ Æ÷ÀÎÅÍ´Â malloc µÈ °ÍÀº ¾Æ´Ï°í privateModuleBytes ³»ÀÇ À§Ä¡ Æ÷ÀÎÅÍÀÓ. |
|---|
| 270 | // ¾îÂ÷ÇÇ memChainÀ¸·Î °ü¸®ÇÒ °ÍÀ̹ǷΠÇԺηΠfree ÇÏÁö¸¸ ¾Ê´Â´Ù¸é ¹®Á¦µÇÁö´Â ¾ÊÀ½. |
|---|
| 271 | // |
|---|
| 272 | sddsDstModuleInfoDesc_t dstinfo; |
|---|
| 273 | #endif |
|---|
| 274 | |
|---|
| 275 | } sddsModuleInfoDesc_t; |
|---|
| 276 | |
|---|
| 277 | |
|---|
| 278 | /** ½ºÄÉÁÙ µð½ºÅ©¸³ÅÍ |
|---|
| 279 | */ |
|---|
| 280 | |
|---|
| 281 | typedef struct { |
|---|
| 282 | UINT32 startTime; |
|---|
| 283 | // ´Ù¿î·Îµå °¡´ÉÇÑ window ½ÃÀÛ ½Ã°£. |
|---|
| 284 | UINT32 lengthInSeconds; |
|---|
| 285 | // 20 bit ±æÀÌ´Ù. ÃÖ´ë Ç¥Çö °¡´É ½Ã°£Àº ~291 hour = ~12 days |
|---|
| 286 | } sddsScheduleEntry_t; |
|---|
| 287 | |
|---|
| 288 | typedef struct |
|---|
| 289 | { |
|---|
| 290 | // tag: SDDS_schedule_tag 0xBA |
|---|
| 291 | |
|---|
| 292 | // ½ºÄÉÁÙ Á¤º¸´Â Çϳª ÀÌ»óÀ» Àü´Þ ÇÒ ¼ö ÀÖÀ½. |
|---|
| 293 | UINT8 numSchedules; |
|---|
| 294 | sddsScheduleEntry_t *schedules; |
|---|
| 295 | |
|---|
| 296 | } sddsScheduleDesc_t; |
|---|
| 297 | |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | |
|---|
| 301 | |
|---|
| 302 | #if COMMENT |
|---|
| 303 | ____Types_DSI____(){} |
|---|
| 304 | #endif |
|---|
| 305 | |
|---|
| 306 | /** dsi ¸Þ½ÃÁöÀÇ groupInfoIndication ¿¡ ÇØ´çµÇ´Â ºÎºÐ */ |
|---|
| 307 | typedef struct |
|---|
| 308 | { |
|---|
| 309 | UINT32 groupId; |
|---|
| 310 | // ÀÌ id´Â dii ¸Þ½ÃÁöÀÇ transactionId¿Í ÀÏÄ¡ÇÑ´Ù. |
|---|
| 311 | |
|---|
| 312 | UINT32 groupSize; |
|---|
| 313 | // ÀÌ ±×·ì¿¡ ¼ÓÇÏ´Â ¸ðµç ¸ðµâµéÀÇ Å©±â ÃÑ ÇÕ. |
|---|
| 314 | |
|---|
| 315 | sddsCompatDesc_t compat; |
|---|
| 316 | // ÀÌ ±×·ìÀÇ compatibility. |
|---|
| 317 | // sdds ±Ô°Ý¿¡ ÀÇÇϸé ÃÖ¼ÒÇÑ ÇѰ³ÀÇ compat Á¤º¸¸¦ Æ÷ÇÔÇØ¾ß ÇÑ´Ù. |
|---|
| 318 | |
|---|
| 319 | UINT16 groupInfoLength; |
|---|
| 320 | UINT8 *groupDescriptors; |
|---|
| 321 | // ÀÌ ±×·ì¿¡ ÇØ´çµÇ´Â Á¤º¸¸¦ Àü´ÞÇϴµ¥, |
|---|
| 322 | // sdds¿¡¼´Â ¿©±â¿¡ schedule descriptor°¡ Àü´Þ µÈ´Ù. |
|---|
| 323 | |
|---|
| 324 | sddsScheduleDesc_t scheduleDescriptor; |
|---|
| 325 | // Ưº°È÷ schedule descriptor¿¡ ÇÑÁ¤ÇÏ¿©, µû·Î parsingÀ» ÇØ ³õ´Â´Ù. |
|---|
| 326 | // ÀÏ¹Ý ´Ù¸¥ descriptor´Â ÇÊ¿äÇÑ °æ¿ì¿¡ ÇÑÇÏ¿© client°¡ parsing. |
|---|
| 327 | // schedule descriptor°¡ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì´Â ³»ºÎÀÇ numSchedule ÀÌ 0ÀÌ´Ù.. |
|---|
| 328 | |
|---|
| 329 | } sddsDsiGroup_t; |
|---|
| 330 | |
|---|
| 331 | |
|---|
| 332 | /** download server initiate */ |
|---|
| 333 | typedef struct |
|---|
| 334 | { |
|---|
| 335 | BOOL section_syntax_indicator; // TRUE if CRC32 used, FALSE if checksum used. |
|---|
| 336 | UINT32 transactionId; |
|---|
| 337 | |
|---|
| 338 | //UINT16 messageLength; // client will not want this info |
|---|
| 339 | // server id ºÎÅÍ crc Á÷Àü±îÁöÀÇ ±æÀÌ. |
|---|
| 340 | |
|---|
| 341 | //UINT8 serverId[20]; // fixed value. don't keep here. |
|---|
| 342 | // Ç×»ó °íÁ¤µÈ 0xff ÆÐÅÏÀ» °¡Áö¹Ç·Î, ÀúÀåÇÒ Çʿ䰡 ¾ø´Ù. »èÁ¦. |
|---|
| 343 | |
|---|
| 344 | sddsCompatDesc_t compat; |
|---|
| 345 | // A/91 ±Ô°Ý¿¡ ÀÇÇϸé dsiÀÇ top-level compatÀº ¾ø´Ù°í ÇÔ. |
|---|
| 346 | // compat.descriptorCount °¡ 0ÀÏ °ÍÀÓ. |
|---|
| 347 | |
|---|
| 348 | // UINT16 privateDataLength; |
|---|
| 349 | // ¾Æ·¡ group info indication Á¤º¸ÀÇ ¹ÙÀÌÆ® ±æÀ̸¦ ÀǹÌ. |
|---|
| 350 | // checksum Á÷ Àü±îÁöÀÇ ±æÀÌ´Ù. |
|---|
| 351 | // ÆÄ½Ì µÈ ÀÌÈÄ¿¡´Â ÀÇ¹Ì ¾øÀ¸¹Ç·Î »èÁ¦ÇÔ. |
|---|
| 352 | |
|---|
| 353 | UINT16 numberOfGroups; // ¾Æ·¡ groups ¹è¿ÀÇ ¿ä¼Ò °¹¼ö. |
|---|
| 354 | sddsDsiGroup_t *groups; // group ¹è¿ Æ÷ÀÎÅÍ. |
|---|
| 355 | |
|---|
| 356 | UINT16 groupInfoPrivateDataLength; // ¾Æ·¡ groupInfoPrivateDataBytesÀÇ ±æÀÌ. |
|---|
| 357 | UINT8 *groupInfoPrivateDataBytes; |
|---|
| 358 | |
|---|
| 359 | UINT32 checksum_CRC32; |
|---|
| 360 | |
|---|
| 361 | } sddsDsi_t, *sddsDsiPtr_t; |
|---|
| 362 | |
|---|
| 363 | |
|---|
| 364 | |
|---|
| 365 | #if COMMENT |
|---|
| 366 | ____Types_DII____(){} |
|---|
| 367 | #endif |
|---|
| 368 | |
|---|
| 369 | |
|---|
| 370 | typedef struct |
|---|
| 371 | { |
|---|
| 372 | UINT16 moduleId; |
|---|
| 373 | // 0x0000 ºÎÅÍ 0xFFEF »çÀÌÀÇ unique id °ª. |
|---|
| 374 | |
|---|
| 375 | UINT32 moduleSize; |
|---|
| 376 | // ¸ðµâÀÇ ¹ÙÀÌÆ® ´ÜÀ§ Å©±â. |
|---|
| 377 | // ÀÌ ¸ðµâ¿¡ ¼ÓÇÏ´Â ¸ðµç DDB ¸Þ½ÃÁöÀÇ payload ÇÕÀÌ´Ù. (Çì´õ, crc µîÀÇ Á¤º¸ Á¦¿Ü) |
|---|
| 378 | // 0ÀÌ¸é ¸ðµâ Å©±â°¡ ¹Ì¸® Á¤ÇØÁöÁö ¾Ê¾Ò´Ù´Â ÀǹÌÀ̸ç, streaming¿¡ »ç¿ëµÈ´Ù. |
|---|
| 379 | |
|---|
| 380 | UINT8 moduleVersion; |
|---|
| 381 | // ½ÇÁ¦ ÆÄÀÏÀÇ ¹öÀü Á¤º¸¸¦ Ç¥½ÃÇϱ⿡´Â ÃæºÐÄ¡ ¾ÊÀ¸¹Ç·Î »ç¿ëÇÏÁö ¾Ê´Â´Ù. |
|---|
| 382 | |
|---|
| 383 | UINT8 moduleInfoLength; // ¾Æ·¡ descriptor listÀÇ ¹ÙÀÌÆ® Å©±â. |
|---|
| 384 | UINT8 *moduleDescriptors; |
|---|
| 385 | // A/91¿¡ µû¸£¸é moduleId°¡ 0x0000~0xFFEF ÀÎ °æ¿ì¿¡´Â |
|---|
| 386 | // ´ÙÀ½ µð½ºÅ©¸³Å͵éÀÌ ¿Ã ¼ö ÀÖ´Ù. |
|---|
| 387 | // module_link_desc, CRC32_desc, .. |
|---|
| 388 | // A/97 ¿¡¼´Â Ãß°¡·Î sddsModuleInfoDesc_t ¸¦ Á¤ÀÇÇϰí ÀÖ´Ù. |
|---|
| 389 | |
|---|
| 390 | sddsModuleInfoDesc_t *moduleInfoDesc; |
|---|
| 391 | // ÆíÀǸ¦ À§Çؼ À§ÀÇ moduleDescriptors Áß¿¡¼ |
|---|
| 392 | // moduleInfoDescriptor ÇϳªÀÇ Á¤º¸¸¦ parsing ÇØ¼ º°µµÀÇ Æ÷ÀÎÅÍ·Î ÁغñÇØ ³õ´Â´Ù. |
|---|
| 393 | // |
|---|
| 394 | // !!!! ÁÖÀÇ !!!! |
|---|
| 395 | // ÀÌ Æ÷ÀÎÅÍ ¿ª½Ã sddsDiiModule_tÀÇ memChain¿¡ ¿¬°áµÇ¾î ÀÖ´Ù. |
|---|
| 396 | // ÇԺηΠpointer¸¦ ¶¼¾î¼ °¡Á®°¡°Å³ª free ½ÃŰ¸é ¾ÈµÈ´Ù. |
|---|
| 397 | |
|---|
| 398 | } sddsDiiModule_t; |
|---|
| 399 | |
|---|
| 400 | |
|---|
| 401 | |
|---|
| 402 | /** download info indication */ |
|---|
| 403 | typedef struct |
|---|
| 404 | { |
|---|
| 405 | /* table ID is 0x3B fixed. do not keep here. */ |
|---|
| 406 | |
|---|
| 407 | BOOL section_syntax_indicator; |
|---|
| 408 | // TRUE if CRC32 used, FALSE if checksum used. |
|---|
| 409 | |
|---|
| 410 | UINT32 transactionId; |
|---|
| 411 | // dsi ¸Þ½ÃÁöÀÇ groupId¿Í ÀÏÄ¡ÇÑ´Ù. |
|---|
| 412 | |
|---|
| 413 | //UINT16 messageLength; |
|---|
| 414 | // ÆÄ½Ì µÈ ÀÌÈÄ¿¡´Â ÀÌ Á¤º¸´Â º°·Î ÇÊ¿ä ¾ø´Ù. »èÁ¦. |
|---|
| 415 | |
|---|
| 416 | UINT32 downloadId; // == carousel_id |
|---|
| 417 | UINT16 blockSize; // typical value: 4066 |
|---|
| 418 | |
|---|
| 419 | sddsCompatDesc_t compat; |
|---|
| 420 | // A/91 ¿¡¼´Â ÀÌ descriptor´Â »ç¿ëÇÏÁö ¾Ê´Â´Ù°í ÇÑ´Ù. |
|---|
| 421 | |
|---|
| 422 | UINT16 numberOfModules; |
|---|
| 423 | sddsDiiModule_t *modules; |
|---|
| 424 | |
|---|
| 425 | UINT16 privateDataLength; |
|---|
| 426 | UINT8 *privateDataBytes; |
|---|
| 427 | // »ç¿ëÀÚ private data. |
|---|
| 428 | |
|---|
| 429 | UINT32 checksum_CRC32; |
|---|
| 430 | |
|---|
| 431 | } sddsDii_t, *sddsDiiPtr_t; |
|---|
| 432 | |
|---|
| 433 | |
|---|
| 434 | |
|---|
| 435 | #if COMMENT |
|---|
| 436 | ____Types_DDB____(){} |
|---|
| 437 | #endif |
|---|
| 438 | |
|---|
| 439 | /** ÁÖÀÇ »çÇ×. |
|---|
| 440 | |
|---|
| 441 | DDB´Â section size°¡ °ÅÀÇ ÃÖ´ë Å©±âÀε¥ (~4096) |
|---|
| 442 | ÀÌ payload¸¦ À§ÇÑ ¸Þ¸ð¸® mallocÀº ÇÏÁö ¾Ê°í, |
|---|
| 443 | parser´Â ±×³É psi section buffer ³»ÀÇ Æ÷ÀÎÅ͸¸ keepÇØ ³õ´Â´Ù. |
|---|
| 444 | |
|---|
| 445 | client´Â parsing ÈÄ¿¡ tDHL_PSI_DataArray¸¦ Free Çϱâ Àü¿¡ |
|---|
| 446 | ÇÊ¿äÇÑ Á¤º¸¸¦ ó¸® ÇØ¾ß ÇÑ´Ù. |
|---|
| 447 | */ |
|---|
| 448 | |
|---|
| 449 | /** data download block */ |
|---|
| 450 | typedef struct |
|---|
| 451 | { |
|---|
| 452 | /* table ID is 0x3B fixed. do not keep here. */ |
|---|
| 453 | BOOL section_syntax_indicator; // TRUE if CRC32 used, FALSE if checksum used. |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | // table_id_extension |
|---|
| 457 | |
|---|
| 458 | // ¼½¼Ç Çì´õÀÇ table_id_extensionÀº ÀϹÝÀûÀÎ °æ¿ì¿Í ´Ù¸£°Ô, downloadId°¡ ¾Æ´Ñ, moduleId °ªÀ» °®´Â´Ù. |
|---|
| 459 | // ¼½¼Ç Çì´õÀÇ versionÀº moduleVersionÀÇ LSB 5 ºñÆ® °ªÀ» °®´Â´Ù. |
|---|
| 460 | // ¼½¼Ç Çì´õÀÇ section_number´Â blockNumberÀÇ ÇÏÀ§ 1¹ÙÀÌÆ® ÀÌ´Ù. |
|---|
| 461 | // ÀÌ °ªµéÀº ´Ù¸¥ Çʵå·ÎºÎÅÍ ÃßÃâÀÌ °¡´ÉÇϹǷΠº°µµ·Î keep ÇÏÁö´Â ¾Ê´Â´Ù. |
|---|
| 462 | |
|---|
| 463 | // version_number |
|---|
| 464 | // moduleVersion ÀÇ ÇÏÀ§ 5ºñÆ®¿Í °ªÀÌ µ¿ÀÏÇÏ´Ù. |
|---|
| 465 | |
|---|
| 466 | // section_number |
|---|
| 467 | // section_number´Â blockNumberÀÇ LSB 8-bits¿Í µ¿ÀÏÇÏ´Ù. |
|---|
| 468 | |
|---|
| 469 | UINT32 downloadId; |
|---|
| 470 | // sddsÀÇ °æ¿ì carousel id ¿Í µ¿ÀÏÇÏ´Ù. |
|---|
| 471 | |
|---|
| 472 | //UINT8 adaptationLength; |
|---|
| 473 | |
|---|
| 474 | // PTS°¡ Æ÷ÇÔµÈ µ¥ÀÌÅÍ ºí·°ÀÌ ±Ô°Ý »ó °¡´ÉÇѰ¡?? |
|---|
| 475 | // ÀÏ´Ü °í·ÁÇÏÁö ¾Ê´Â´Ù. |
|---|
| 476 | // ÇÏÁö¸¸ parser´Â adaptionLength°¡ ÀÖÀ» °æ¿ì ÀûÀýÇÏ°Ô skipÇϵµ·Ï ÇØ¾ß ÇÔ. |
|---|
| 477 | |
|---|
| 478 | //UINT16 messageLength; |
|---|
| 479 | // ÆÄ½Ì µÈ ÀÌÈÄ¿¡´Â ÀÌ Á¤º¸´Â º°·Î ÇÊ¿ä ¾ø´Ù. »èÁ¦. |
|---|
| 480 | |
|---|
| 481 | |
|---|
| 482 | UINT16 moduleId; // ÀÌ ºí·°ÀÌ ¼ÓÇÑ ¸ðµâ id. |
|---|
| 483 | UINT8 moduleVersion; |
|---|
| 484 | |
|---|
| 485 | UINT16 blockNumber; // 0 ºÎÅÍ ½ÃÀÛÇÏ´Â block index. |
|---|
| 486 | |
|---|
| 487 | UINT8 *blockDataBytePtr; // ÀÌ Æ÷ÀÎÅÍ´Â mallocÀ¸·Î ÇÒ´ç ¹ÞÀº °ÍÀÌ ¾Æ´Ô. |
|---|
| 488 | UINT16 blockDataLength; // ÀÌ °ªÀº messageLength °ªÀ¸·ÎºÎÅÍ °è»ê µÈ °ªÀÌ´Ù. |
|---|
| 489 | |
|---|
| 490 | UINT32 checksum_CRC32; |
|---|
| 491 | |
|---|
| 492 | } sddsDdb_t, *sddsDdbPtr_t; |
|---|
| 493 | |
|---|
| 494 | |
|---|
| 495 | |
|---|
| 496 | |
|---|
| 497 | #ifdef __cplusplus |
|---|
| 498 | } /* extern "C" */ |
|---|
| 499 | #endif |
|---|
| 500 | |
|---|
| 501 | |
|---|
| 502 | #endif /* __DLIB_SDDS_H__ */ |
|---|
| 503 | |
|---|