FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/ccd/gsm5_tlv.c @ 648:970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
|---|---|
| date | Thu, 04 Sep 2014 05:48:57 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 647:a60b375014e3 | 648:970d6199f2c5 |
|---|---|
| 1 /* | |
| 2 +----------------------------------------------------------------------------- | |
| 3 | Project : | |
| 4 | Modul : gsm5_tlv.c | |
| 5 +----------------------------------------------------------------------------- | |
| 6 | Copyright 2002 Texas Instruments Berlin, AG | |
| 7 | All rights reserved. | |
| 8 | | |
| 9 | This file is confidential and a trade secret of Texas | |
| 10 | Instruments Berlin, AG | |
| 11 | The receipt of or possession of this file does not convey | |
| 12 | any rights to reproduce or disclose its contents or to | |
| 13 | manufacture, use, or sell anything it may describe, in | |
| 14 | whole, or in part, without the specific written consent of | |
| 15 | Texas Instruments Berlin, AG. | |
| 16 +----------------------------------------------------------------------------- | |
| 17 | Purpose : Definition of encoding and decoding functions for GSM5_TLV elements | |
| 18 +----------------------------------------------------------------------------- | |
| 19 */ | |
| 20 | |
| 21 | |
| 22 /* | |
| 23 * standard definitions like GLOBAL, UCHAR, ERROR etc. | |
| 24 */ | |
| 25 #include "typedefs.h" | |
| 26 #include "header.h" | |
| 27 | |
| 28 /* | |
| 29 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only | |
| 30 * look at ccdapi.h | |
| 31 */ | |
| 32 #undef USE_DRIVER | |
| 33 #include "ccdapi.h" | |
| 34 | |
| 35 /* | |
| 36 * Types and functions for bit access and manipulation | |
| 37 */ | |
| 38 #include "ccd_globs.h" | |
| 39 #include "bitfun.h" | |
| 40 | |
| 41 /* | |
| 42 * Prototypes of ccd internal functions | |
| 43 */ | |
| 44 #include "ccd.h" | |
| 45 | |
| 46 /* | |
| 47 * Declaration of coder/decoder tables | |
| 48 */ | |
| 49 #include "ccdtable.h" | |
| 50 #include "ccddata.h" | |
| 51 | |
| 52 #ifndef RUN_INT_RAM | |
| 53 /* | |
| 54 +--------------------------------------------------------------------+ | |
| 55 | PROJECT : CCD (6144) MODULE : CDC_GSM | | |
| 56 | STATE : code ROUTINE : cdc_gsm5tlv_decode | | |
| 57 +--------------------------------------------------------------------+ | |
| 58 | |
| 59 PURPOSE : Decoding of the GSM Type 5TLV element. This element | |
| 60 consists of a 8 bit T component a | |
| 61 8 or 16 Bit L component and a V component wich | |
| 62 length depends on the value of the L component. | |
| 63 If the length is in the range 0x00-0x7f the L component | |
| 64 consist of one byte. For bigger length 0x80-0xff the | |
| 65 L component consists of two bytes. The first byte is | |
| 66 tied to 0x81 and the second byte contains a value in the | |
| 67 range 0x80 to 0xff. | |
| 68 | |
| 69 | |
| 70 */ | |
| 71 | |
| 72 SHORT cdc_gsm5tlv_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) | |
| 73 { | |
| 74 T_TLV_SORT tlv_inf; | |
| 75 | |
| 76 tlv_inf.gotTag = TRUE; | |
| 77 tlv_inf.gotLen = TRUE; | |
| 78 | |
| 79 #ifdef DEBUG_CCD | |
| 80 #ifndef CCD_SYMBOLS | |
| 81 TRACE_CCD (globs, "cdc_gsm5tlv_decode()"); | |
| 82 #else | |
| 83 TRACE_CCD (globs, "cdc_gsm5tlv_decode() %s", ccddata_get_alias((USHORT) e_ref, 1)); | |
| 84 #endif | |
| 85 #endif | |
| 86 | |
| 87 return cdc_tlv_decode (c_ref, e_ref, &tlv_inf, globs); | |
| 88 } | |
| 89 #endif /* !RUN_INT_RAM */ | |
| 90 | |
| 91 #ifndef RUN_INT_RAM | |
| 92 /* | |
| 93 +--------------------------------------------------------------------+ | |
| 94 | PROJECT : CCD (6144) MODULE : CDC_GSM | | |
| 95 | STATE : code ROUTINE : cdc_gsm5tlv_encode | | |
| 96 +--------------------------------------------------------------------+ | |
| 97 | |
| 98 PURPOSE : Encoding of the GSM Type 5TLV element. This element | |
| 99 consists of a 8 bit T component a | |
| 100 8 or 16 Bit L component and a V component wich | |
| 101 length depends on the value of the L component. | |
| 102 If the length is in the range 0x00-0x7f the L component | |
| 103 consist of one byte. For bigger length 0x80-0xff the | |
| 104 L component consists of two bytes. The first byte is | |
| 105 tied to 0x81 and the second byte contains a value in the | |
| 106 range 0x80 to 0xff. | |
| 107 | |
| 108 */ | |
| 109 | |
| 110 SHORT cdc_gsm5tlv_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) | |
| 111 { | |
| 112 #ifdef DEBUG_CCD | |
| 113 #ifndef CCD_SYMBOLS | |
| 114 TRACE_CCD (globs, "cdc_gsm5tlv_encode()"); | |
| 115 #else | |
| 116 TRACE_CCD (globs, "cdc_gsm5tlv_encode() %s", ccddata_get_alias((USHORT) e_ref, 1)); | |
| 117 #endif | |
| 118 #endif | |
| 119 | |
| 120 cdc_tlv_encode (e_ref, 8, 8, globs); | |
| 121 | |
| 122 return 1; | |
| 123 } | |
| 124 #endif /* !RUN_INT_RAM */ |
