[pok-devel] Generation of the Dataview to source code |
[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]
Dear all, We are experiencing some problems with the generation and compilation of the data model in ASN.1 when we initialize an OCTECT STRING using the reserved word DEFAULT in ASN.1. You can find the part of our ASN1 that is causing problems bellow in this mail. Attached you can find a compilation screenshot (Compilation.txt), the C file that produces the error (dataview-uniq.c) and error messages during the compilation (ShowNativeBuffers.stats.err). ASN.1 Byte1-T ::= OCTET STRING (SIZE(1)) DH-T ::= SEQUENCE { serviceType Byte1-T DEFAULT ‘00000011’B serviceSubType Byte1-T } Source code in Ada (it seems ok) TYPE asn1SccDFH_T IS RECORD serviceType: asn1SccByte1_T :=(Data=""> serviceSubTYpe: asn1SccByte1_T; Exist: asn1SccDFH_T_EXIST; END RECORD; Are we initializing the OCTECT stream correctly? I hope you can help us. Kind regards,
|
/* Code automatically generated by asn1scc tool Date was: 03/09/2012 Time was: 07:45:55 */ #include <string.h> #include <math.h> #include "dataview-uniq.h" #ifndef _MSC_VER #endif void Boolean_T_Initialize(Boolean_T* pVal) { *pVal = FALSE; } flag Boolean_T_IsConstraintValid(const Boolean_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Boolean_T_Encode(const Boolean_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Boolean_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_AppendBit(pBitStrm,*pVal); return TRUE; } flag Boolean_T_Decode(Boolean_T* pVal, BitStream* pBitStrm, int* pErrCode) { if (!BitStream_ReadBit(pBitStrm,pVal)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } return TRUE; } flag Boolean_T_ACN_Encode(const Boolean_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Boolean_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if(*pVal) { static byte tmp[] = {0x80}; BitStream_AppendBits(pBitStrm, tmp, 1); } else { static byte tmp[] = {0x7F}; BitStream_AppendBits(pBitStrm, tmp, 1); } return TRUE; } flag Boolean_T_ACN_Decode(Boolean_T* pVal, BitStream* pBitStrm, int* pErrCode) { { static byte tmp[] = {0x80}; BitStream_ReadBitPattern(pBitStrm, tmp, 1, pVal); } return TRUE; } void Integer_T_Initialize(Integer_T* pVal) { *pVal = -100000000; } flag Integer_T_IsConstraintValid(const Integer_T* pVal, int* pErrCode) { if ( !(((*pVal>=-100000000) && (*pVal<=100000000))) ) { *pErrCode = ERR_Integer_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Integer_T_Encode(const Integer_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Integer_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, *pVal, -100000000, 100000000); return TRUE; } flag Integer_T_Decode(Integer_T* pVal, BitStream* pBitStrm, int* pErrCode) { if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, pVal, -100000000, 100000000)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } return TRUE; } flag Integer_T_ACN_Encode(const Integer_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Integer_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, *pVal - (-100000000), 28); return TRUE; } flag Integer_T_ACN_Decode(Integer_T* pVal, BitStream* pBitStrm, int* pErrCode) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, pVal, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } *pVal += -100000000; return TRUE; } void Float_T_Initialize(Float_T* pVal) { *pVal = -100000000.0; } flag Float_T_IsConstraintValid(const Float_T* pVal, int* pErrCode) { if ( !(((*pVal>=-100000000.0) && (*pVal<=1000000000.0))) ) { *pErrCode = ERR_Float_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Float_T_Encode(const Float_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Float_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeReal(pBitStrm, *pVal); return TRUE; } flag Float_T_Decode(Float_T* pVal, BitStream* pBitStrm, int* pErrCode) { if (!BitStream_DecodeReal(pBitStrm, pVal)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } return TRUE; } flag Float_T_ACN_Encode(const Float_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !Float_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Real_IEEE754_64_big_endian(pBitStrm, *pVal); return TRUE; } flag Float_T_ACN_Decode(Float_T* pVal, BitStream* pBitStrm, int* pErrCode) { if (!Acn_Dec_Real_IEEE754_64_big_endian(pBitStrm, pVal)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } return TRUE; } void String_T_Initialize(String_T pVal) { memset(pVal, 0x0, 101); } flag String_T_IsConstraintValid(const String_T pVal, int* pErrCode) { if ( !(((strlen(pVal)>=1) && (strlen(pVal)<=100))) ) { *pErrCode = ERR_String_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag String_T_Encode(const String_T pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !String_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, (int)strlen(pVal), 1, 100); for(i1=0;i1<(int)strlen(pVal);i1++) { static byte allowedCharSet[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E, 0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C, 0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B, 0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A, 0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59, 0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68, 0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F}; int charIndex = GetCharIndex(pVal[i1], allowedCharSet,128); BitStream_EncodeConstraintWholeNumber(pBitStrm, charIndex, 0, 128-1); } return TRUE; } flag String_T_Decode(String_T pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* cns: 1 100*/ /* PER: 1 100*/ memset(pVal, 0x0, 101); if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 100)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } for(i1=0;i1<nCount;i1++) { static byte allowedCharSet[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E, 0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C, 0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B, 0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A, 0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59, 0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68, 0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F}; asn1SccSint charIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &charIndex, 0, 128-1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; }pVal[i1] = allowedCharSet[charIndex]; } return TRUE; } flag String_T_ACN_Encode(const String_T pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !String_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, (int)strlen(pVal), 7);for(i1=0;i1<(int)strlen(pVal);i1++) { BitStream_AppendByte0(pBitStrm, pVal[i1]); } return TRUE; } flag String_T_ACN_Decode(String_T pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; Acn_Dec_Length(pBitStrm, &nCount, 7); for(i1=0;i1<nCount;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal[i1] = 0x0; return TRUE; } void AllDataTypes_T_Initialize(AllDataTypes_T* pVal) { pVal->kind = AllDataTypes_T_NONE; } flag AllDataTypes_T_IsConstraintValid(const AllDataTypes_T* pVal, int* pErrCode) { switch(pVal->kind) { case myBoolean_PRESENT: if ( !Boolean_T_IsConstraintValid(&pVal->u.myBoolean, pErrCode)) return FALSE; break; case myInteger_PRESENT: if ( !Integer_T_IsConstraintValid(&pVal->u.myInteger, pErrCode)) return FALSE; break; case myFloat_PRESENT: if ( !Float_T_IsConstraintValid(&pVal->u.myFloat, pErrCode)) return FALSE; break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag AllDataTypes_T_Encode(const AllDataTypes_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !AllDataTypes_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case myBoolean_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 2); if (!Boolean_T_Encode(&pVal->u.myBoolean, pBitStrm, pErrCode, FALSE)) return FALSE; break; case myInteger_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 2); if (!Integer_T_Encode(&pVal->u.myInteger, pBitStrm, pErrCode, FALSE)) return FALSE; break; case myFloat_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 2); if (!Float_T_Encode(&pVal->u.myFloat, pBitStrm, pErrCode, FALSE)) return FALSE; break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } flag AllDataTypes_T_Decode(AllDataTypes_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint nChoiceIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: if (!Boolean_T_Decode(&pVal->u.myBoolean, pBitStrm, pErrCode)) return FALSE; pVal->kind = myBoolean_PRESENT; break; case 1: if (!Integer_T_Decode(&pVal->u.myInteger, pBitStrm, pErrCode)) return FALSE; pVal->kind = myInteger_PRESENT; break; case 2: if (!Float_T_Decode(&pVal->u.myFloat, pBitStrm, pErrCode)) return FALSE; pVal->kind = myFloat_PRESENT; break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } flag AllDataTypes_T_ACN_Encode(const AllDataTypes_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !AllDataTypes_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case myBoolean_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 2); if(pVal->u.myBoolean) { static byte tmp[] = {0x80}; BitStream_AppendBits(pBitStrm, tmp, 1); } else { static byte tmp[] = {0x7F}; BitStream_AppendBits(pBitStrm, tmp, 1); } break; case myInteger_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 2); Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->u.myInteger - (-100000000), 28); break; case myFloat_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 2); Acn_Enc_Real_IEEE754_64_big_endian(pBitStrm, pVal->u.myFloat); break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } flag AllDataTypes_T_ACN_Decode(AllDataTypes_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint nChoiceIndex = 0; /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: { static byte tmp[] = {0x80}; BitStream_ReadBitPattern(pBitStrm, tmp, 1, &pVal->u.myBoolean); } pVal->kind = myBoolean_PRESENT; break; case 1: if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->u.myInteger, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->u.myInteger += -100000000; pVal->kind = myInteger_PRESENT; break; case 2: if (!Acn_Dec_Real_IEEE754_64_big_endian(pBitStrm, &pVal->u.myFloat)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->kind = myFloat_PRESENT; break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } void KeyDataType_T_Initialize(KeyDataType_T* pVal) { *pVal = dataTypeNotDefined; } flag KeyDataType_T_IsConstraintValid(const KeyDataType_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag KeyDataType_T_Encode(const KeyDataType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !KeyDataType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case dataTypeNotDefined: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 3); break; case dataTypeBoolean: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 3); break; case dataTypeInteger: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 3); break; case dataTypeFloat: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 3); break; default: *pErrCode = ERR_KeyDataType_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag KeyDataType_T_Decode(KeyDataType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = dataTypeNotDefined; break; case 1: *pVal = dataTypeBoolean; break; case 2: *pVal = dataTypeInteger; break; case 3: *pVal = dataTypeFloat; break; default: *pErrCode = ERR_KeyDataType_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag KeyDataType_T_ACN_Encode(const KeyDataType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !KeyDataType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case dataTypeNotDefined: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case dataTypeBoolean: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case dataTypeInteger: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case dataTypeFloat: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_KeyDataType_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag KeyDataType_T_ACN_Decode(KeyDataType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = dataTypeNotDefined; break; case 1: *pVal = dataTypeBoolean; break; case 2: *pVal = dataTypeInteger; break; case 3: *pVal = dataTypeFloat; break; default: *pErrCode = ERR_KeyDataType_T_unknown_enumeration_value; return FALSE; } return TRUE; } void DataType_T_Initialize(DataType_T* pVal) { KeyDataType_T_Initialize(&pVal->key); AllDataTypes_T_Initialize(&pVal->dataType); } flag DataType_T_IsConstraintValid(const DataType_T* pVal, int* pErrCode) { if ( !KeyDataType_T_IsConstraintValid(&pVal->key, pErrCode)) return FALSE; if ( !AllDataTypes_T_IsConstraintValid(&pVal->dataType, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag DataType_T_Encode(const DataType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !DataType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!KeyDataType_T_Encode(&pVal->key, pBitStrm, pErrCode, FALSE)) return FALSE; if (!AllDataTypes_T_Encode(&pVal->dataType, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag DataType_T_Decode(DataType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; /*Decode key (KeyDataType-T)*/ if (!KeyDataType_T_Decode(&pVal->key, pBitStrm, pErrCode)) return FALSE; /*Decode dataType (AllDataTypes-T)*/ if (!AllDataTypes_T_Decode(&pVal->dataType, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag DataType_T_ACN_Encode(const DataType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !DataType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode key (DataView.DataType-T.key) ENUMERATED*/ switch(pVal->key) { case dataTypeNotDefined: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case dataTypeBoolean: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case dataTypeInteger: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case dataTypeFloat: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_DataType_T_key_unknown_enumeration_value; return FALSE; } /* Encode dataType (DataView.DataType-T.dataType) CHOICE*/ switch(pVal->dataType.kind) { case myBoolean_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 2); if(pVal->dataType.u.myBoolean) { static byte tmp[] = {0x80}; BitStream_AppendBits(pBitStrm, tmp, 1); } else { static byte tmp[] = {0x7F}; BitStream_AppendBits(pBitStrm, tmp, 1); } break; case myInteger_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 2); Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->dataType.u.myInteger - (-100000000), 28); break; case myFloat_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 2); Acn_Enc_Real_IEEE754_64_big_endian(pBitStrm, pVal->dataType.u.myFloat); break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } flag DataType_T_ACN_Decode(DataType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; /* Decode key (DataView.DataType-T.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->key = dataTypeNotDefined; break; case 1: pVal->key = dataTypeBoolean; break; case 2: pVal->key = dataTypeInteger; break; case 3: pVal->key = dataTypeFloat; break; default: *pErrCode = ERR_DataType_T_key_unknown_enumeration_value; return FALSE; } /* Decode dataType (DataView.DataType-T.dataType) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: { static byte tmp[] = {0x80}; BitStream_ReadBitPattern(pBitStrm, tmp, 1, &pVal->dataType.u.myBoolean); } pVal->dataType.kind = myBoolean_PRESENT; break; case 1: if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->dataType.u.myInteger, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->dataType.u.myInteger += -100000000; pVal->dataType.kind = myInteger_PRESENT; break; case 2: if (!Acn_Dec_Real_IEEE754_64_big_endian(pBitStrm, &pVal->dataType.u.myFloat)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->dataType.kind = myFloat_PRESENT; break; default: *pErrCode = ERR_AllDataTypes_T_unknown_choice_index; return FALSE; } return TRUE; } void Byte1_T_Initialize(Byte1_T* pVal) { memset(pVal->arr,0x0,1); } flag Byte1_T_IsConstraintValid(const Byte1_T* pVal, int* pErrCode) { if ( !(1==1) ) { *pErrCode = ERR_Byte1_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Byte1_T_Encode(const Byte1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte1_T_Decode(Byte1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } flag Byte1_T_ACN_Encode(const Byte1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte1_T_ACN_Decode(Byte1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void Byte2_T_Initialize(Byte2_T* pVal) { memset(pVal->arr,0x0,2); } flag Byte2_T_IsConstraintValid(const Byte2_T* pVal, int* pErrCode) { if ( !(2==2) ) { *pErrCode = ERR_Byte2_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Byte2_T_Encode(const Byte2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte2_T_Decode(Byte2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } flag Byte2_T_ACN_Encode(const Byte2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte2_T_ACN_Decode(Byte2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void Byte3_T_Initialize(Byte3_T* pVal) { memset(pVal->arr,0x0,3); } flag Byte3_T_IsConstraintValid(const Byte3_T* pVal, int* pErrCode) { if ( !(3==3) ) { *pErrCode = ERR_Byte3_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Byte3_T_Encode(const Byte3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<3;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte3_T_Decode(Byte3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 3; for(i1=0;i1<3;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } flag Byte3_T_ACN_Encode(const Byte3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<3;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte3_T_ACN_Decode(Byte3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 3; for(i1=0;i1<3;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void Byte4_T_Initialize(Byte4_T* pVal) { memset(pVal->arr,0x0,4); } flag Byte4_T_IsConstraintValid(const Byte4_T* pVal, int* pErrCode) { if ( !(4==4) ) { *pErrCode = ERR_Byte4_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Byte4_T_Encode(const Byte4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte4_T_Decode(Byte4_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } flag Byte4_T_ACN_Encode(const Byte4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte4_T_ACN_Decode(Byte4_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void Byte24_T_Initialize(Byte24_T* pVal) { memset(pVal->arr,0x0,24); } flag Byte24_T_IsConstraintValid(const Byte24_T* pVal, int* pErrCode) { if ( !(24==24) ) { *pErrCode = ERR_Byte24_T; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Byte24_T_Encode(const Byte24_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte24_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<24;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte24_T_Decode(Byte24_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 24; for(i1=0;i1<24;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } flag Byte24_T_ACN_Encode(const Byte24_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Byte24_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<24;i1++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1]); } return TRUE; } flag Byte24_T_ACN_Decode(Byte24_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; nCount = 24; for(i1=0;i1<24;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void CommandOperations_T_Initialize(CommandOperations_T* pVal) { *pVal = noneOperation; } flag CommandOperations_T_IsConstraintValid(const CommandOperations_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag CommandOperations_T_Encode(const CommandOperations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CommandOperations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noneOperation: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 3); break; case comp1Op1Commanding: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 3); break; case comp1Op2Commanding: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 3); break; case comp2Op1Commanding: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 3); break; default: *pErrCode = ERR_CommandOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CommandOperations_T_Decode(CommandOperations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noneOperation; break; case 1: *pVal = comp1Op1Commanding; break; case 2: *pVal = comp1Op2Commanding; break; case 3: *pVal = comp2Op1Commanding; break; default: *pErrCode = ERR_CommandOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CommandOperations_T_ACN_Encode(const CommandOperations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CommandOperations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noneOperation: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case comp1Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case comp1Op2Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case comp2Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_CommandOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CommandOperations_T_ACN_Decode(CommandOperations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noneOperation; break; case 1: *pVal = comp1Op1Commanding; break; case 2: *pVal = comp1Op2Commanding; break; case 3: *pVal = comp2Op1Commanding; break; default: *pErrCode = ERR_CommandOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } void ParamsCommandingOperations_T_Initialize(ParamsCommandingOperations_T* pVal) { *pVal = noneParams; } flag ParamsCommandingOperations_T_IsConstraintValid(const ParamsCommandingOperations_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ParamsCommandingOperations_T_Encode(const ParamsCommandingOperations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ParamsCommandingOperations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noneParams: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 3); break; case comp1Op1ParamName1: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 3); break; case comp1Op1ParamName2: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 3); break; case comp1Op2ParamName1: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 3); break; default: *pErrCode = ERR_ParamsCommandingOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ParamsCommandingOperations_T_Decode(ParamsCommandingOperations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noneParams; break; case 1: *pVal = comp1Op1ParamName1; break; case 2: *pVal = comp1Op1ParamName2; break; case 3: *pVal = comp1Op2ParamName1; break; default: *pErrCode = ERR_ParamsCommandingOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ParamsCommandingOperations_T_ACN_Encode(const ParamsCommandingOperations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ParamsCommandingOperations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noneParams: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case comp1Op1ParamName1: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case comp1Op1ParamName2: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case comp1Op2ParamName1: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_ParamsCommandingOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ParamsCommandingOperations_T_ACN_Decode(ParamsCommandingOperations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noneParams; break; case 1: *pVal = comp1Op1ParamName1; break; case 2: *pVal = comp1Op1ParamName2; break; case 3: *pVal = comp1Op2ParamName1; break; default: *pErrCode = ERR_ParamsCommandingOperations_T_unknown_enumeration_value; return FALSE; } return TRUE; } void CommandingAssociations_T_Initialize(CommandingAssociations_T* pVal) { pVal->functionID = -100000000; CommandOperations_T_Initialize(&pVal->opName); Boolean_T_Initialize(&pVal->isProtected); } flag CommandingAssociations_T_IsConstraintValid(const CommandingAssociations_T* pVal, int* pErrCode) { if ( !Integer_T_IsConstraintValid(&pVal->functionID, pErrCode)) return FALSE; if ( !CommandOperations_T_IsConstraintValid(&pVal->opName, pErrCode)) return FALSE; if ( !Boolean_T_IsConstraintValid(&pVal->isProtected, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag CommandingAssociations_T_Encode(const CommandingAssociations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CommandingAssociations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Integer_T_Encode(&pVal->functionID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!CommandOperations_T_Encode(&pVal->opName, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Boolean_T_Encode(&pVal->isProtected, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag CommandingAssociations_T_Decode(CommandingAssociations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode functionID (Integer-T)*/ if (!Integer_T_Decode(&pVal->functionID, pBitStrm, pErrCode)) return FALSE; /*Decode opName (CommandOperations-T)*/ if (!CommandOperations_T_Decode(&pVal->opName, pBitStrm, pErrCode)) return FALSE; /*Decode isProtected (Boolean-T)*/ if (!Boolean_T_Decode(&pVal->isProtected, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag CommandingAssociations_T_ACN_Encode(const CommandingAssociations_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CommandingAssociations_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode functionID (DataView.CommandingAssociations-T.functionID) INTEGER*/ Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->functionID - (-100000000), 28); /* Encode opName (DataView.CommandingAssociations-T.opName) ENUMERATED*/ switch(pVal->opName) { case noneOperation: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case comp1Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case comp1Op2Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case comp2Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_CommandingAssociations_T_opName_unknown_enumeration_value; return FALSE; } /* Encode isProtected (DataView.CommandingAssociations-T.isProtected) BOOLEAN*/ if(pVal->isProtected) { static byte tmp[] = {0x80}; BitStream_AppendBits(pBitStrm, tmp, 1); } else { static byte tmp[] = {0x7F}; BitStream_AppendBits(pBitStrm, tmp, 1); } return TRUE; } flag CommandingAssociations_T_ACN_Decode(CommandingAssociations_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode functionID (DataView.CommandingAssociations-T.functionID) INTEGER*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->functionID, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->functionID += -100000000; /* Decode opName (DataView.CommandingAssociations-T.opName) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->opName = noneOperation; break; case 1: pVal->opName = comp1Op1Commanding; break; case 2: pVal->opName = comp1Op2Commanding; break; case 3: pVal->opName = comp2Op1Commanding; break; default: *pErrCode = ERR_CommandingAssociations_T_opName_unknown_enumeration_value; return FALSE; } /* Decode isProtected (DataView.CommandingAssociations-T.isProtected) BOOLEAN*/ { static byte tmp[] = {0x80}; BitStream_ReadBitPattern(pBitStrm, tmp, 1, &pVal->isProtected); } return TRUE; } void ControlStatus_T_Initialize(ControlStatus_T* pVal) { *pVal = enable; } flag ControlStatus_T_IsConstraintValid(const ControlStatus_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ControlStatus_T_Encode(const ControlStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ControlStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case enable: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 1); break; case disable: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 1); break; default: *pErrCode = ERR_ControlStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ControlStatus_T_Decode(ControlStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = enable; break; case 1: *pVal = disable; break; default: *pErrCode = ERR_ControlStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ControlStatus_T_ACN_Encode(const ControlStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ControlStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case enable: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case disable: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_ControlStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ControlStatus_T_ACN_Decode(ControlStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = enable; break; case 1: *pVal = disable; break; default: *pErrCode = ERR_ControlStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } void IfStandard_T_Initialize(IfStandard_T* pVal) { *pVal = native; } flag IfStandard_T_IsConstraintValid(const IfStandard_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag IfStandard_T_Encode(const IfStandard_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !IfStandard_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case native: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 1); break; case pus: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 1); break; default: *pErrCode = ERR_IfStandard_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag IfStandard_T_Decode(IfStandard_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = native; break; case 1: *pVal = pus; break; default: *pErrCode = ERR_IfStandard_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag IfStandard_T_ACN_Encode(const IfStandard_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !IfStandard_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case native: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case pus: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_IfStandard_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag IfStandard_T_ACN_Decode(IfStandard_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = native; break; case 1: *pVal = pus; break; default: *pErrCode = ERR_IfStandard_T_unknown_enumeration_value; return FALSE; } return TRUE; } void TcFactoryStatus_T_Initialize(TcFactoryStatus_T* pVal) { *pVal = empty; } flag TcFactoryStatus_T_IsConstraintValid(const TcFactoryStatus_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TcFactoryStatus_T_Encode(const TcFactoryStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TcFactoryStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case empty: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 2); break; case full: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 2); break; case normal: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 2); break; default: *pErrCode = ERR_TcFactoryStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TcFactoryStatus_T_Decode(TcFactoryStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = empty; break; case 1: *pVal = full; break; case 2: *pVal = normal; break; default: *pErrCode = ERR_TcFactoryStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TcFactoryStatus_T_ACN_Encode(const TcFactoryStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TcFactoryStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case empty: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case full: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case normal: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; default: *pErrCode = ERR_TcFactoryStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TcFactoryStatus_T_ACN_Decode(TcFactoryStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = empty; break; case 1: *pVal = full; break; case 2: *pVal = normal; break; default: *pErrCode = ERR_TcFactoryStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } void OperationResult_T_Initialize(OperationResult_T* pVal) { *pVal = done; } flag OperationResult_T_IsConstraintValid(const OperationResult_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag OperationResult_T_Encode(const OperationResult_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !OperationResult_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case done: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 1); break; case failure: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 1); break; default: *pErrCode = ERR_OperationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag OperationResult_T_Decode(OperationResult_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = done; break; case 1: *pVal = failure; break; default: *pErrCode = ERR_OperationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag OperationResult_T_ACN_Encode(const OperationResult_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !OperationResult_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case done: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case failure: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_OperationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag OperationResult_T_ACN_Decode(OperationResult_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = done; break; case 1: *pVal = failure; break; default: *pErrCode = ERR_OperationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } void VerificationResult_T_Initialize(VerificationResult_T* pVal) { *pVal = successful; } flag VerificationResult_T_IsConstraintValid(const VerificationResult_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag VerificationResult_T_Encode(const VerificationResult_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !VerificationResult_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case successful: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 1); break; case error: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 1); break; default: *pErrCode = ERR_VerificationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag VerificationResult_T_Decode(VerificationResult_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = successful; break; case 1: *pVal = error; break; default: *pErrCode = ERR_VerificationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag VerificationResult_T_ACN_Encode(const VerificationResult_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !VerificationResult_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case successful: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case error: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_VerificationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag VerificationResult_T_ACN_Decode(VerificationResult_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = successful; break; case 1: *pVal = error; break; default: *pErrCode = ERR_VerificationResult_T_unknown_enumeration_value; return FALSE; } return TRUE; } void ErrorSeverity_T_Initialize(ErrorSeverity_T* pVal) { *pVal = normalSeverity; } flag ErrorSeverity_T_IsConstraintValid(const ErrorSeverity_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ErrorSeverity_T_Encode(const ErrorSeverity_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ErrorSeverity_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case normalSeverity: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 3); break; case lowSeverity: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 3); break; case mediumSeverity: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 3); break; case highSeverity: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 3); break; default: *pErrCode = ERR_ErrorSeverity_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorSeverity_T_Decode(ErrorSeverity_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = normalSeverity; break; case 1: *pVal = lowSeverity; break; case 2: *pVal = mediumSeverity; break; case 3: *pVal = highSeverity; break; default: *pErrCode = ERR_ErrorSeverity_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorSeverity_T_ACN_Encode(const ErrorSeverity_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ErrorSeverity_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case normalSeverity: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case lowSeverity: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case mediumSeverity: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case highSeverity: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_ErrorSeverity_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorSeverity_T_ACN_Decode(ErrorSeverity_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = normalSeverity; break; case 1: *pVal = lowSeverity; break; case 2: *pVal = mediumSeverity; break; case 3: *pVal = highSeverity; break; default: *pErrCode = ERR_ErrorSeverity_T_unknown_enumeration_value; return FALSE; } return TRUE; } void ErrorTypes_T_Initialize(ErrorTypes_T* pVal) { *pVal = segmentHeader; } flag ErrorTypes_T_IsConstraintValid(const ErrorTypes_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ErrorTypes_T_Encode(const ErrorTypes_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ErrorTypes_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case segmentHeader: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 6); break; case packetHeader: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 6); break; case dataField: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 6); break; case tc55RID: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 6); break; case tc56RID: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 6); break; case tc81CommandID: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 6); break; case tc81Params: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 6); break; default: *pErrCode = ERR_ErrorTypes_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorTypes_T_Decode(ErrorTypes_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = segmentHeader; break; case 1: *pVal = packetHeader; break; case 2: *pVal = dataField; break; case 3: *pVal = tc55RID; break; case 4: *pVal = tc56RID; break; case 5: *pVal = tc81CommandID; break; case 6: *pVal = tc81Params; break; default: *pErrCode = ERR_ErrorTypes_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorTypes_T_ACN_Encode(const ErrorTypes_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ErrorTypes_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_ErrorTypes_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ErrorTypes_T_ACN_Decode(ErrorTypes_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = segmentHeader; break; case 1: *pVal = packetHeader; break; case 2: *pVal = dataField; break; case 3: *pVal = tc55RID; break; case 4: *pVal = tc56RID; break; case 5: *pVal = tc81CommandID; break; case 6: *pVal = tc81Params; break; default: *pErrCode = ERR_ErrorTypes_T_unknown_enumeration_value; return FALSE; } return TRUE; } void RIDSControl_T_Initialize(RIDSControl_T* pVal) { ErrorTypes_T_Initialize(&pVal->errorTypeRID); ControlStatus_T_Initialize(&pVal->errorActiveStatus); } flag RIDSControl_T_IsConstraintValid(const RIDSControl_T* pVal, int* pErrCode) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->errorTypeRID, pErrCode)) return FALSE; if ( !ControlStatus_T_IsConstraintValid(&pVal->errorActiveStatus, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag RIDSControl_T_Encode(const RIDSControl_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !RIDSControl_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!ErrorTypes_T_Encode(&pVal->errorTypeRID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!ControlStatus_T_Encode(&pVal->errorActiveStatus, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag RIDSControl_T_Decode(RIDSControl_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode errorTypeRID (ErrorTypes-T)*/ if (!ErrorTypes_T_Decode(&pVal->errorTypeRID, pBitStrm, pErrCode)) return FALSE; /*Decode errorActiveStatus (ControlStatus-T)*/ if (!ControlStatus_T_Decode(&pVal->errorActiveStatus, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag RIDSControl_T_ACN_Encode(const RIDSControl_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !RIDSControl_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode errorTypeRID (DataView.RIDSControl-T.errorTypeRID) ENUMERATED*/ switch(pVal->errorTypeRID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_RIDSControl_T_errorTypeRID_unknown_enumeration_value; return FALSE; } /* Encode errorActiveStatus (DataView.RIDSControl-T.errorActiveStatus) ENUMERATED*/ switch(pVal->errorActiveStatus) { case enable: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case disable: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_RIDSControl_T_errorActiveStatus_unknown_enumeration_value; return FALSE; } return TRUE; } flag RIDSControl_T_ACN_Decode(RIDSControl_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode errorTypeRID (DataView.RIDSControl-T.errorTypeRID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->errorTypeRID = segmentHeader; break; case 1: pVal->errorTypeRID = packetHeader; break; case 2: pVal->errorTypeRID = dataField; break; case 3: pVal->errorTypeRID = tc55RID; break; case 4: pVal->errorTypeRID = tc56RID; break; case 5: pVal->errorTypeRID = tc81CommandID; break; case 6: pVal->errorTypeRID = tc81Params; break; default: *pErrCode = ERR_RIDSControl_T_errorTypeRID_unknown_enumeration_value; return FALSE; } /* Decode errorActiveStatus (DataView.RIDSControl-T.errorActiveStatus) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->errorActiveStatus = enable; break; case 1: pVal->errorActiveStatus = disable; break; default: *pErrCode = ERR_RIDSControl_T_errorActiveStatus_unknown_enumeration_value; return FALSE; } return TRUE; } void ExecutionStatus_T_Initialize(ExecutionStatus_T* pVal) { *pVal = taskRunning; } flag ExecutionStatus_T_IsConstraintValid(const ExecutionStatus_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ExecutionStatus_T_Encode(const ExecutionStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ExecutionStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case taskRunning: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 1); break; case taskNotRunning: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 1); break; default: *pErrCode = ERR_ExecutionStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ExecutionStatus_T_Decode(ExecutionStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = taskRunning; break; case 1: *pVal = taskNotRunning; break; default: *pErrCode = ERR_ExecutionStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ExecutionStatus_T_ACN_Encode(const ExecutionStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ExecutionStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case taskRunning: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case taskNotRunning: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_ExecutionStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag ExecutionStatus_T_ACN_Decode(ExecutionStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = taskRunning; break; case 1: *pVal = taskNotRunning; break; default: *pErrCode = ERR_ExecutionStatus_T_unknown_enumeration_value; return FALSE; } return TRUE; } void OperationsStatus_T_Initialize(OperationsStatus_T* pVal) { CommandOperations_T_Initialize(&pVal->operation); ExecutionStatus_T_Initialize(&pVal->status); } flag OperationsStatus_T_IsConstraintValid(const OperationsStatus_T* pVal, int* pErrCode) { if ( !CommandOperations_T_IsConstraintValid(&pVal->operation, pErrCode)) return FALSE; if ( !ExecutionStatus_T_IsConstraintValid(&pVal->status, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag OperationsStatus_T_Encode(const OperationsStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !OperationsStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!CommandOperations_T_Encode(&pVal->operation, pBitStrm, pErrCode, FALSE)) return FALSE; if (!ExecutionStatus_T_Encode(&pVal->status, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag OperationsStatus_T_Decode(OperationsStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode operation (CommandOperations-T)*/ if (!CommandOperations_T_Decode(&pVal->operation, pBitStrm, pErrCode)) return FALSE; /*Decode status (ExecutionStatus-T)*/ if (!ExecutionStatus_T_Decode(&pVal->status, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag OperationsStatus_T_ACN_Encode(const OperationsStatus_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !OperationsStatus_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode operation (DataView.OperationsStatus-T.operation) ENUMERATED*/ switch(pVal->operation) { case noneOperation: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case comp1Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case comp1Op2Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case comp2Op1Commanding: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_OperationsStatus_T_operation_unknown_enumeration_value; return FALSE; } /* Encode status (DataView.OperationsStatus-T.status) ENUMERATED*/ switch(pVal->status) { case taskRunning: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case taskNotRunning: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_OperationsStatus_T_status_unknown_enumeration_value; return FALSE; } return TRUE; } flag OperationsStatus_T_ACN_Decode(OperationsStatus_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode operation (DataView.OperationsStatus-T.operation) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->operation = noneOperation; break; case 1: pVal->operation = comp1Op1Commanding; break; case 2: pVal->operation = comp1Op2Commanding; break; case 3: pVal->operation = comp2Op1Commanding; break; default: *pErrCode = ERR_OperationsStatus_T_operation_unknown_enumeration_value; return FALSE; } /* Decode status (DataView.OperationsStatus-T.status) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->status = taskRunning; break; case 1: pVal->status = taskNotRunning; break; default: *pErrCode = ERR_OperationsStatus_T_status_unknown_enumeration_value; return FALSE; } return TRUE; } void TCServices_T_Initialize(TCServices_T* pVal) { *pVal = noservice; } flag TCServices_T_IsConstraintValid(const TCServices_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TCServices_T_Encode(const TCServices_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCServices_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noservice: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 19); break; case service1: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 19); break; case service2: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 19); break; case service3: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 19); break; case service4: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 19); break; case service5: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 19); break; case service6: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 19); break; case service8: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 19); break; case service9: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 19); break; case service11: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 19); break; case service12: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 19); break; case service13: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 19); break; case service14: BitStream_EncodeConstraintWholeNumber(pBitStrm, 12, 0, 19); break; case service15: BitStream_EncodeConstraintWholeNumber(pBitStrm, 13, 0, 19); break; case service17: BitStream_EncodeConstraintWholeNumber(pBitStrm, 14, 0, 19); break; case service18: BitStream_EncodeConstraintWholeNumber(pBitStrm, 15, 0, 19); break; case service19: BitStream_EncodeConstraintWholeNumber(pBitStrm, 16, 0, 19); break; case service128: BitStream_EncodeConstraintWholeNumber(pBitStrm, 17, 0, 19); break; case service129: BitStream_EncodeConstraintWholeNumber(pBitStrm, 18, 0, 19); break; case service130: BitStream_EncodeConstraintWholeNumber(pBitStrm, 19, 0, 19); break; default: *pErrCode = ERR_TCServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCServices_T_Decode(TCServices_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 19)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noservice; break; case 1: *pVal = service1; break; case 2: *pVal = service2; break; case 3: *pVal = service3; break; case 4: *pVal = service4; break; case 5: *pVal = service5; break; case 6: *pVal = service6; break; case 7: *pVal = service8; break; case 8: *pVal = service9; break; case 9: *pVal = service11; break; case 10: *pVal = service12; break; case 11: *pVal = service13; break; case 12: *pVal = service14; break; case 13: *pVal = service15; break; case 14: *pVal = service17; break; case 15: *pVal = service18; break; case 16: *pVal = service19; break; case 17: *pVal = service128; break; case 18: *pVal = service129; break; case 19: *pVal = service130; break; default: *pErrCode = ERR_TCServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCServices_T_ACN_Encode(const TCServices_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCServices_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case noservice: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 5); break; case service1: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 5); break; case service2: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 5); break; case service3: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 5); break; case service4: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 5); break; case service5: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 5); break; case service6: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 5); break; case service8: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 5); break; case service9: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 5); break; case service11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 5); break; case service12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 5); break; case service13: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 5); break; case service14: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 12, 5); break; case service15: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 13, 5); break; case service17: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 14, 5); break; case service18: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 15, 5); break; case service19: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 16, 5); break; case service128: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 17, 5); break; case service129: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 18, 5); break; case service130: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 19, 5); break; default: *pErrCode = ERR_TCServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCServices_T_ACN_Decode(TCServices_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = noservice; break; case 1: *pVal = service1; break; case 2: *pVal = service2; break; case 3: *pVal = service3; break; case 4: *pVal = service4; break; case 5: *pVal = service5; break; case 6: *pVal = service6; break; case 7: *pVal = service8; break; case 8: *pVal = service9; break; case 9: *pVal = service11; break; case 10: *pVal = service12; break; case 11: *pVal = service13; break; case 12: *pVal = service14; break; case 13: *pVal = service15; break; case 14: *pVal = service17; break; case 15: *pVal = service18; break; case 16: *pVal = service19; break; case 17: *pVal = service128; break; case 18: *pVal = service129; break; case 19: *pVal = service130; break; default: *pErrCode = ERR_TCServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } void TCSubServices_T_Initialize(TCSubServices_T* pVal) { *pVal = nosubservice; } flag TCSubServices_T_IsConstraintValid(const TCSubServices_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TCSubServices_T_Encode(const TCSubServices_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCSubServices_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case nosubservice: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 12); break; case subservice1: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 12); break; case subservice2: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 12); break; case subservice3: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 12); break; case subservice4: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 12); break; case subservice5: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 12); break; case subservice6: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 12); break; case subservice7: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 12); break; case subservice8: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 12); break; case subservice9: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 12); break; case subservice10: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 12); break; case subservice11: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 12); break; case subservice12: BitStream_EncodeConstraintWholeNumber(pBitStrm, 12, 0, 12); break; default: *pErrCode = ERR_TCSubServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCSubServices_T_Decode(TCSubServices_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 12)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = nosubservice; break; case 1: *pVal = subservice1; break; case 2: *pVal = subservice2; break; case 3: *pVal = subservice3; break; case 4: *pVal = subservice4; break; case 5: *pVal = subservice5; break; case 6: *pVal = subservice6; break; case 7: *pVal = subservice7; break; case 8: *pVal = subservice8; break; case 9: *pVal = subservice9; break; case 10: *pVal = subservice10; break; case 11: *pVal = subservice11; break; case 12: *pVal = subservice12; break; default: *pErrCode = ERR_TCSubServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCSubServices_T_ACN_Encode(const TCSubServices_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCSubServices_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case nosubservice: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case subservice1: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case subservice2: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case subservice3: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case subservice4: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case subservice5: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case subservice6: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case subservice7: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case subservice8: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; case subservice9: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 4); break; case subservice10: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 4); break; case subservice11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 4); break; case subservice12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 12, 4); break; default: *pErrCode = ERR_TCSubServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCSubServices_T_ACN_Decode(TCSubServices_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = nosubservice; break; case 1: *pVal = subservice1; break; case 2: *pVal = subservice2; break; case 3: *pVal = subservice3; break; case 4: *pVal = subservice4; break; case 5: *pVal = subservice5; break; case 6: *pVal = subservice6; break; case 7: *pVal = subservice7; break; case 8: *pVal = subservice8; break; case 9: *pVal = subservice9; break; case 10: *pVal = subservice10; break; case 11: *pVal = subservice11; break; case 12: *pVal = subservice12; break; default: *pErrCode = ERR_TCSubServices_T_unknown_enumeration_value; return FALSE; } return TRUE; } void FunctionParamsPairs_T_Initialize(FunctionParamsPairs_T* pVal) { Byte4_T_Initialize(&pVal->paramID); Byte4_T_Initialize(&pVal->paramValue); } flag FunctionParamsPairs_T_IsConstraintValid(const FunctionParamsPairs_T* pVal, int* pErrCode) { if ( !Byte4_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; if (pVal->exist.paramValue) { if ( !Byte4_T_IsConstraintValid(&pVal->paramValue, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag FunctionParamsPairs_T_Encode(const FunctionParamsPairs_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !FunctionParamsPairs_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.paramValue); if (!Byte4_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.paramValue) { if (!Byte4_T_Encode(&pVal->paramValue, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag FunctionParamsPairs_T_Decode(FunctionParamsPairs_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode paramID (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; /*Decode paramValue (Byte4-T)*/ pVal->exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.paramValue = 1; if (!Byte4_T_Decode(&pVal->paramValue, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag FunctionParamsPairs_T_ACN_Encode(const FunctionParamsPairs_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !FunctionParamsPairs_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.paramValue);/* Encode paramID (DataView.FunctionParamsPairs-T.paramID) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1]); } /* Encode paramValue (DataView.FunctionParamsPairs-T.paramValue) OCTET STRING*/ if (pVal->exist.paramValue ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->paramValue.arr[i1]); } } return TRUE; } flag FunctionParamsPairs_T_ACN_Decode(FunctionParamsPairs_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.FunctionParamsPairs-T.paramID) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.FunctionParamsPairs-T.paramValue) OCTET STRING*/ pVal->exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.paramValue = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramValue.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void FunctionParams_T_Initialize(FunctionParams_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<8; i1++) { FunctionParamsPairs_T_Initialize(&pVal->arr[i1]); } } flag FunctionParams_T_IsConstraintValid(const FunctionParams_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=8))) ) { *pErrCode = ERR_FunctionParams_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !FunctionParamsPairs_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag FunctionParams_T_Encode(const FunctionParams_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !FunctionParams_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 8); for(i1=0;i1<pVal->nCount;i1++) { if (!FunctionParamsPairs_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag FunctionParams_T_Decode(FunctionParams_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!FunctionParamsPairs_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag FunctionParams_T_ACN_Encode(const FunctionParams_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !FunctionParams_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.paramValue);/* Encode paramID (DataView.FunctionParams-T..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.FunctionParams-T..paramValue) OCTET STRING*/ if (pVal->arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].paramValue.arr[i2]); } } } return TRUE; } flag FunctionParams_T_ACN_Decode(FunctionParams_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.FunctionParams-T..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.FunctionParams-T..paramValue) OCTET STRING*/ pVal->arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void ParamIDandType_T_Initialize(ParamIDandType_T* pVal) { pVal->paramIdentifier = -100000000; KeyDataType_T_Initialize(&pVal->paramType); } flag ParamIDandType_T_IsConstraintValid(const ParamIDandType_T* pVal, int* pErrCode) { if ( !Integer_T_IsConstraintValid(&pVal->paramIdentifier, pErrCode)) return FALSE; if ( !KeyDataType_T_IsConstraintValid(&pVal->paramType, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ParamIDandType_T_Encode(const ParamIDandType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ParamIDandType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Integer_T_Encode(&pVal->paramIdentifier, pBitStrm, pErrCode, FALSE)) return FALSE; if (!KeyDataType_T_Encode(&pVal->paramType, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag ParamIDandType_T_Decode(ParamIDandType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode paramIdentifier (Integer-T)*/ if (!Integer_T_Decode(&pVal->paramIdentifier, pBitStrm, pErrCode)) return FALSE; /*Decode paramType (KeyDataType-T)*/ if (!KeyDataType_T_Decode(&pVal->paramType, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag ParamIDandType_T_ACN_Encode(const ParamIDandType_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !ParamIDandType_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode paramIdentifier (DataView.ParamIDandType-T.paramIdentifier) INTEGER*/ Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->paramIdentifier - (-100000000), 28); /* Encode paramType (DataView.ParamIDandType-T.paramType) ENUMERATED*/ switch(pVal->paramType) { case dataTypeNotDefined: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 2); break; case dataTypeBoolean: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 2); break; case dataTypeInteger: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 2); break; case dataTypeFloat: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 2); break; default: *pErrCode = ERR_ParamIDandType_T_paramType_unknown_enumeration_value; return FALSE; } return TRUE; } flag ParamIDandType_T_ACN_Decode(ParamIDandType_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode paramIdentifier (DataView.ParamIDandType-T.paramIdentifier) INTEGER*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->paramIdentifier, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->paramIdentifier += -100000000; /* Decode paramType (DataView.ParamIDandType-T.paramType) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->paramType = dataTypeNotDefined; break; case 1: pVal->paramType = dataTypeBoolean; break; case 2: pVal->paramType = dataTypeInteger; break; case 3: pVal->paramType = dataTypeFloat; break; default: *pErrCode = ERR_ParamIDandType_T_paramType_unknown_enumeration_value; return FALSE; } return TRUE; } void MonitoringOperation_T_Initialize(MonitoringOperation_T* pVal) { *pVal = enableMonitoring; } flag MonitoringOperation_T_IsConstraintValid(const MonitoringOperation_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag MonitoringOperation_T_Encode(const MonitoringOperation_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !MonitoringOperation_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case enableMonitoring: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 6); break; case disableMonitoring: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 6); break; case changeRelay: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 6); break; case clearMonList: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 6); break; case addParams: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 6); break; case deleteParams: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 6); break; case reportOutLimit: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 6); break; default: *pErrCode = ERR_MonitoringOperation_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag MonitoringOperation_T_Decode(MonitoringOperation_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = enableMonitoring; break; case 1: *pVal = disableMonitoring; break; case 2: *pVal = changeRelay; break; case 3: *pVal = clearMonList; break; case 4: *pVal = addParams; break; case 5: *pVal = deleteParams; break; case 6: *pVal = reportOutLimit; break; default: *pErrCode = ERR_MonitoringOperation_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag MonitoringOperation_T_ACN_Encode(const MonitoringOperation_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !MonitoringOperation_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case enableMonitoring: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case disableMonitoring: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case changeRelay: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case clearMonList: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case addParams: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case deleteParams: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case reportOutLimit: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_MonitoringOperation_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag MonitoringOperation_T_ACN_Decode(MonitoringOperation_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = enableMonitoring; break; case 1: *pVal = disableMonitoring; break; case 2: *pVal = changeRelay; break; case 3: *pVal = clearMonList; break; case 4: *pVal = addParams; break; case 5: *pVal = deleteParams; break; case 6: *pVal = reportOutLimit; break; default: *pErrCode = ERR_MonitoringOperation_T_unknown_enumeration_value; return FALSE; } return TRUE; } void ReportingInfo_T_Initialize(ReportingInfo_T* pVal) { pVal->commandID = -100000000; Byte2_T_Initialize(&pVal->numberSteps); } flag ReportingInfo_T_IsConstraintValid(const ReportingInfo_T* pVal, int* pErrCode) { if ( !Integer_T_IsConstraintValid(&pVal->commandID, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->numberSteps, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ReportingInfo_T_Encode(const ReportingInfo_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !ReportingInfo_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Integer_T_Encode(&pVal->commandID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->numberSteps, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag ReportingInfo_T_Decode(ReportingInfo_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode commandID (Integer-T)*/ if (!Integer_T_Decode(&pVal->commandID, pBitStrm, pErrCode)) return FALSE; /*Decode numberSteps (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->numberSteps, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag ReportingInfo_T_ACN_Encode(const ReportingInfo_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !ReportingInfo_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode commandID (DataView.ReportingInfo-T.commandID) INTEGER*/ Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->commandID - (-100000000), 28); /* Encode numberSteps (DataView.ReportingInfo-T.numberSteps) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberSteps.arr[i1]); } return TRUE; } flag ReportingInfo_T_ACN_Decode(ReportingInfo_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode commandID (DataView.ReportingInfo-T.commandID) INTEGER*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->commandID, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->commandID += -100000000; /* Decode numberSteps (DataView.ReportingInfo-T.numberSteps) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberSteps.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void PH_T_Initialize(PH_T* pVal) { Byte2_T_Initialize(&pVal->packetID); Byte2_T_Initialize(&pVal->packetSequenceControl); Byte2_T_Initialize(&pVal->packetLength); } flag PH_T_IsConstraintValid(const PH_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetID, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSequenceControl, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetLength, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag PH_T_Encode(const PH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !PH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte2_T_Encode(&pVal->packetID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSequenceControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetLength, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag PH_T_Decode(PH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode packetID (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetID, pBitStrm, pErrCode)) return FALSE; /*Decode packetSequenceControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSequenceControl, pBitStrm, pErrCode)) return FALSE; /*Decode packetLength (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetLength, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag PH_T_ACN_Encode(const PH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !PH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetID (DataView.PH-T.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.PH-T.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.PH-T.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetLength.arr[i1]); } return TRUE; } flag PH_T_ACN_Decode(PH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode packetID (DataView.PH-T.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.PH-T.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.PH-T.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void DFH_T_Initialize(DFH_T* pVal) { Byte1_T_Initialize(&pVal->dfhInfo); Byte1_T_Initialize(&pVal->serviceType); Byte1_T_Initialize(&pVal->serviceSubtype); Byte1_T_Initialize(&pVal->sourceID); } flag DFH_T_IsConstraintValid(const DFH_T* pVal, int* pErrCode) { if ( !Byte1_T_IsConstraintValid(&pVal->dfhInfo, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->serviceType, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->serviceSubtype, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->sourceID, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag DFH_T_Encode(const DFH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !DFH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte1_T_Encode(&pVal->dfhInfo, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->serviceType, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->serviceSubtype, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->sourceID, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag DFH_T_Decode(DFH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode dfhInfo (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->dfhInfo, pBitStrm, pErrCode)) return FALSE; /*Decode serviceType (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->serviceType, pBitStrm, pErrCode)) return FALSE; /*Decode serviceSubtype (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->serviceSubtype, pBitStrm, pErrCode)) return FALSE; /*Decode sourceID (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->sourceID, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag DFH_T_ACN_Encode(const DFH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !DFH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode dfhInfo (DataView.DFH-T.dfhInfo) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dfhInfo.arr[i1]); } /* Encode serviceType (DataView.DFH-T.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.DFH-T.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->serviceSubtype.arr[i1]); } /* Encode sourceID (DataView.DFH-T.sourceID) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->sourceID.arr[i1]); } return TRUE; } flag DFH_T_ACN_Decode(DFH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode dfhInfo (DataView.DFH-T.dfhInfo) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dfhInfo.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.DFH-T.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.DFH-T.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.DFH-T.sourceID) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->sourceID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TC_Headers_T_Initialize(TC_Headers_T* pVal) { pVal->functionID = -100000000; PH_T_Initialize(&pVal->packetHeader); DFH_T_Initialize(&pVal->dataFieldHeader); pVal->executionTime = -100000000; Boolean_T_Initialize(&pVal->isDefined); } flag TC_Headers_T_IsConstraintValid(const TC_Headers_T* pVal, int* pErrCode) { if ( !Integer_T_IsConstraintValid(&pVal->functionID, pErrCode)) return FALSE; if ( !PH_T_IsConstraintValid(&pVal->packetHeader, pErrCode)) return FALSE; if ( !DFH_T_IsConstraintValid(&pVal->dataFieldHeader, pErrCode)) return FALSE; if ( !Integer_T_IsConstraintValid(&pVal->executionTime, pErrCode)) return FALSE; if ( !Boolean_T_IsConstraintValid(&pVal->isDefined, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC_Headers_T_Encode(const TC_Headers_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC_Headers_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Integer_T_Encode(&pVal->functionID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!PH_T_Encode(&pVal->packetHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!DFH_T_Encode(&pVal->dataFieldHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Integer_T_Encode(&pVal->executionTime, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Boolean_T_Encode(&pVal->isDefined, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TC_Headers_T_Decode(TC_Headers_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode functionID (Integer-T)*/ if (!Integer_T_Decode(&pVal->functionID, pBitStrm, pErrCode)) return FALSE; /*Decode packetHeader (PH-T)*/ if (!PH_T_Decode(&pVal->packetHeader, pBitStrm, pErrCode)) return FALSE; /*Decode dataFieldHeader (DFH-T)*/ if (!DFH_T_Decode(&pVal->dataFieldHeader, pBitStrm, pErrCode)) return FALSE; /*Decode executionTime (Integer-T)*/ if (!Integer_T_Decode(&pVal->executionTime, pBitStrm, pErrCode)) return FALSE; /*Decode isDefined (Boolean-T)*/ if (!Boolean_T_Decode(&pVal->isDefined, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TC_Headers_T_ACN_Encode(const TC_Headers_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC_Headers_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode functionID (DataView.TC-Headers-T.functionID) INTEGER*/ Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->functionID - (-100000000), 28); /* Encode packetHeader (DataView.TC-Headers-T.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TC-Headers-T.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TC-Headers-T.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TC-Headers-T.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TC-Headers-T.dataFieldHeader) SEQUENCE*/ /* Encode dfhInfo (DataView.TC-Headers-T.dataFieldHeader.dfhInfo) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.dfhInfo.arr[i1]); } /* Encode serviceType (DataView.TC-Headers-T.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TC-Headers-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode sourceID (DataView.TC-Headers-T.dataFieldHeader.sourceID) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.sourceID.arr[i1]); } /* Encode executionTime (DataView.TC-Headers-T.executionTime) INTEGER*/ Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, pVal->executionTime - (-100000000), 28); /* Encode isDefined (DataView.TC-Headers-T.isDefined) BOOLEAN*/ if(pVal->isDefined) { static byte tmp[] = {0x80}; BitStream_AppendBits(pBitStrm, tmp, 1); } else { static byte tmp[] = {0x7F}; BitStream_AppendBits(pBitStrm, tmp, 1); } return TRUE; } flag TC_Headers_T_ACN_Decode(TC_Headers_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode functionID (DataView.TC-Headers-T.functionID) INTEGER*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->functionID, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->functionID += -100000000; /* Decode packetHeader (DataView.TC-Headers-T.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TC-Headers-T.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TC-Headers-T.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TC-Headers-T.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TC-Headers-T.dataFieldHeader) SEQUENCE*/ /* Decode dfhInfo (DataView.TC-Headers-T.dataFieldHeader.dfhInfo) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.dfhInfo.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TC-Headers-T.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TC-Headers-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.TC-Headers-T.dataFieldHeader.sourceID) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.sourceID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode executionTime (DataView.TC-Headers-T.executionTime) INTEGER*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &pVal->executionTime, 28)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->executionTime += -100000000; /* Decode isDefined (DataView.TC-Headers-T.isDefined) BOOLEAN*/ { static byte tmp[] = {0x80}; BitStream_ReadBitPattern(pBitStrm, tmp, 1, &pVal->isDefined); } return TRUE; } void TCID_T_Initialize(TCID_T* pVal) { *pVal = tc55; } flag TCID_T_IsConstraintValid(const TCID_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TCID_T_Encode(const TCID_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCID_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case tc55: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); break; case tc56: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); break; case tc81: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); break; case tc121: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); break; case tc122: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); break; case tc123: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); break; case tc125: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); break; case tc126: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); break; case tc1210: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); break; default: *pErrCode = ERR_TCID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCID_T_Decode(TCID_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = tc55; break; case 1: *pVal = tc56; break; case 2: *pVal = tc81; break; case 3: *pVal = tc121; break; case 4: *pVal = tc122; break; case 5: *pVal = tc123; break; case 6: *pVal = tc125; break; case 7: *pVal = tc126; break; case 8: *pVal = tc1210; break; default: *pErrCode = ERR_TCID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCID_T_ACN_Encode(const TCID_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TCID_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_TCID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TCID_T_ACN_Decode(TCID_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = tc55; break; case 1: *pVal = tc56; break; case 2: *pVal = tc81; break; case 3: *pVal = tc121; break; case 4: *pVal = tc122; break; case 5: *pVal = tc123; break; case 6: *pVal = tc125; break; case 7: *pVal = tc126; break; case 8: *pVal = tc1210; break; default: *pErrCode = ERR_TCID_T_unknown_enumeration_value; return FALSE; } return TRUE; } void RIDS_T_Initialize(RIDS_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<8; i1++) { ErrorTypes_T_Initialize(&pVal->arr[i1]); } } flag RIDS_T_IsConstraintValid(const RIDS_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=8))) ) { *pErrCode = ERR_RIDS_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag RIDS_T_Encode(const RIDS_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !RIDS_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 8); for(i1=0;i1<pVal->nCount;i1++) { if (!ErrorTypes_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag RIDS_T_Decode(RIDS_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!ErrorTypes_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag RIDS_T_ACN_Encode(const RIDS_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !RIDS_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { switch(pVal->arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_RIDS_T_elem_unknown_enumeration_value; return FALSE; } } return TRUE; } flag RIDS_T_ACN_Decode(RIDS_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->arr[i1] = segmentHeader; break; case 1: pVal->arr[i1] = packetHeader; break; case 2: pVal->arr[i1] = dataField; break; case 3: pVal->arr[i1] = tc55RID; break; case 4: pVal->arr[i1] = tc56RID; break; case 5: pVal->arr[i1] = tc81CommandID; break; case 6: pVal->arr[i1] = tc81Params; break; default: *pErrCode = ERR_RIDS_T_elem_unknown_enumeration_value; return FALSE; } } return TRUE; } void TC5_5_T_Initialize(TC5_5_T* pVal) { Byte4_T_Initialize(&pVal->numberRIDS); RIDS_T_Initialize(&pVal->rid); } flag TC5_5_T_IsConstraintValid(const TC5_5_T* pVal, int* pErrCode) { if (pVal->exist.numberRIDS) { if ( !Byte4_T_IsConstraintValid(&pVal->numberRIDS, pErrCode)) return FALSE; } if (pVal->exist.rid) { if ( !RIDS_T_IsConstraintValid(&pVal->rid, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC5_5_T_Encode(const TC5_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC5_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->exist.rid); if (pVal->exist.numberRIDS) { if (!Byte4_T_Encode(&pVal->numberRIDS, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.rid) { if (!RIDS_T_Encode(&pVal->rid, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC5_5_T_Decode(TC5_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode numberRIDS (Byte4-T)*/ pVal->exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberRIDS = 1; if (!Byte4_T_Decode(&pVal->numberRIDS, pBitStrm, pErrCode)) return FALSE; } /*Decode rid (RIDS-T)*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; if (!RIDS_T_Decode(&pVal->rid, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC5_5_T_ACN_Encode(const TC5_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC5_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->exist.rid);/* Encode numberRIDS (DataView.TC5-5-T.numberRIDS) OCTET STRING*/ if (pVal->exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberRIDS.arr[i1]); } } /* Encode rid (DataView.TC5-5-T.rid) SEQUENCE OF*/ if (pVal->exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->rid.nCount, 3);for(i1=0;i1<pVal->rid.nCount;i1++) { switch(pVal->rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TC5_5_T_rid_elem_unknown_enumeration_value; return FALSE; } } } return TRUE; } flag TC5_5_T_ACN_Decode(TC5_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TC5-5-T.numberRIDS) OCTET STRING*/ pVal->exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TC5-5-T.rid) SEQUENCE OF*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->rid.nCount = (long)nCount; for(i1=0;i1<pVal->rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->rid.arr[i1] = segmentHeader; break; case 1: pVal->rid.arr[i1] = packetHeader; break; case 2: pVal->rid.arr[i1] = dataField; break; case 3: pVal->rid.arr[i1] = tc55RID; break; case 4: pVal->rid.arr[i1] = tc56RID; break; case 5: pVal->rid.arr[i1] = tc81CommandID; break; case 6: pVal->rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TC5_5_T_rid_elem_unknown_enumeration_value; return FALSE; } } } return TRUE; } void TC5_6_T_Initialize(TC5_6_T* pVal) { Byte4_T_Initialize(&pVal->numberRIDS); RIDS_T_Initialize(&pVal->rid); } flag TC5_6_T_IsConstraintValid(const TC5_6_T* pVal, int* pErrCode) { if (pVal->exist.numberRIDS) { if ( !Byte4_T_IsConstraintValid(&pVal->numberRIDS, pErrCode)) return FALSE; } if (pVal->exist.rid) { if ( !RIDS_T_IsConstraintValid(&pVal->rid, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC5_6_T_Encode(const TC5_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC5_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->exist.rid); if (pVal->exist.numberRIDS) { if (!Byte4_T_Encode(&pVal->numberRIDS, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.rid) { if (!RIDS_T_Encode(&pVal->rid, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC5_6_T_Decode(TC5_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode numberRIDS (Byte4-T)*/ pVal->exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberRIDS = 1; if (!Byte4_T_Decode(&pVal->numberRIDS, pBitStrm, pErrCode)) return FALSE; } /*Decode rid (RIDS-T)*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; if (!RIDS_T_Decode(&pVal->rid, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC5_6_T_ACN_Encode(const TC5_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC5_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->exist.rid);/* Encode numberRIDS (DataView.TC5-6-T.numberRIDS) OCTET STRING*/ if (pVal->exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberRIDS.arr[i1]); } } /* Encode rid (DataView.TC5-6-T.rid) SEQUENCE OF*/ if (pVal->exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->rid.nCount, 3);for(i1=0;i1<pVal->rid.nCount;i1++) { switch(pVal->rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TC5_6_T_rid_elem_unknown_enumeration_value; return FALSE; } } } return TRUE; } flag TC5_6_T_ACN_Decode(TC5_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TC5-6-T.numberRIDS) OCTET STRING*/ pVal->exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TC5-6-T.rid) SEQUENCE OF*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->rid.nCount = (long)nCount; for(i1=0;i1<pVal->rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->rid.arr[i1] = segmentHeader; break; case 1: pVal->rid.arr[i1] = packetHeader; break; case 2: pVal->rid.arr[i1] = dataField; break; case 3: pVal->rid.arr[i1] = tc55RID; break; case 4: pVal->rid.arr[i1] = tc56RID; break; case 5: pVal->rid.arr[i1] = tc81CommandID; break; case 6: pVal->rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TC5_6_T_rid_elem_unknown_enumeration_value; return FALSE; } } } return TRUE; } void TC8_1_T_Initialize(TC8_1_T* pVal) { Byte4_T_Initialize(&pVal->functionId); Byte4_T_Initialize(&pVal->numberParams); FunctionParams_T_Initialize(&pVal->params); } flag TC8_1_T_IsConstraintValid(const TC8_1_T* pVal, int* pErrCode) { if ( !Byte4_T_IsConstraintValid(&pVal->functionId, pErrCode)) return FALSE; if (pVal->exist.numberParams) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParams, pErrCode)) return FALSE; } if (pVal->exist.params) { if ( !FunctionParams_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC8_1_T_Encode(const TC8_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC8_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.params); if (!Byte4_T_Encode(&pVal->functionId, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.numberParams) { if (!Byte4_T_Encode(&pVal->numberParams, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.params) { if (!FunctionParams_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC8_1_T_Decode(TC8_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode functionId (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->functionId, pBitStrm, pErrCode)) return FALSE; /*Decode numberParams (Byte4-T)*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; if (!Byte4_T_Decode(&pVal->numberParams, pBitStrm, pErrCode)) return FALSE; } /*Decode params (FunctionParams-T)*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; if (!FunctionParams_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC8_1_T_ACN_Encode(const TC8_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC8_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.params);/* Encode functionId (DataView.TC8-1-T.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->functionId.arr[i1]); } /* Encode numberParams (DataView.TC8-1-T.numberParams) OCTET STRING*/ if (pVal->exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParams.arr[i1]); } } /* Encode params (DataView.TC8-1-T.params) SEQUENCE OF*/ if (pVal->exist.params ) { Acn_Enc_Length(pBitStrm, pVal->params.nCount, 3);for(i1=0;i1<pVal->params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->params.arr[i1].exist.paramValue);/* Encode paramID (DataView.TC8-1-T.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TC8-1-T.params..paramValue) OCTET STRING*/ if (pVal->params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].paramValue.arr[i2]); } } } } return TRUE; } flag TC8_1_T_ACN_Decode(TC8_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.TC8-1-T.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.TC8-1-T.numberParams) OCTET STRING*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TC8-1-T.params) SEQUENCE OF*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->params.nCount = (long)nCount; for(i1=0;i1<pVal->params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.TC8-1-T.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TC8-1-T.params..paramValue) OCTET STRING*/ pVal->params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } return TRUE; } void ParamsEnDis_T_Initialize(ParamsEnDis_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<8; i1++) { Byte4_T_Initialize(&pVal->arr[i1]); } } flag ParamsEnDis_T_IsConstraintValid(const ParamsEnDis_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=8))) ) { *pErrCode = ERR_ParamsEnDis_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !Byte4_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ParamsEnDis_T_Encode(const ParamsEnDis_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !ParamsEnDis_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 8); for(i1=0;i1<pVal->nCount;i1++) { if (!Byte4_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag ParamsEnDis_T_Decode(ParamsEnDis_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!Byte4_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag ParamsEnDis_T_ACN_Encode(const ParamsEnDis_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !ParamsEnDis_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].arr[i2]); } } return TRUE; } flag ParamsEnDis_T_ACN_Decode(ParamsEnDis_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TC12_1_T_Initialize(TC12_1_T* pVal) { Byte4_T_Initialize(&pVal->numberParams); ParamsEnDis_T_Initialize(&pVal->paramID); } flag TC12_1_T_IsConstraintValid(const TC12_1_T* pVal, int* pErrCode) { if (pVal->exist.numberParams) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParams, pErrCode)) return FALSE; } if (pVal->exist.paramID) { if ( !ParamsEnDis_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_1_T_Encode(const TC12_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID); if (pVal->exist.numberParams) { if (!Byte4_T_Encode(&pVal->numberParams, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.paramID) { if (!ParamsEnDis_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC12_1_T_Decode(TC12_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode numberParams (Byte4-T)*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; if (!Byte4_T_Decode(&pVal->numberParams, pBitStrm, pErrCode)) return FALSE; } /*Decode paramID (ParamsEnDis-T)*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; if (!ParamsEnDis_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC12_1_T_ACN_Encode(const TC12_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID);/* Encode numberParams (DataView.TC12-1-T.numberParams) OCTET STRING*/ if (pVal->exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParams.arr[i1]); } } /* Encode paramID (DataView.TC12-1-T.paramID) SEQUENCE OF*/ if (pVal->exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->paramID.nCount, 3);for(i1=0;i1<pVal->paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].arr[i2]); } } } return TRUE; } flag TC12_1_T_ACN_Decode(TC12_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC12-1-T.numberParams) OCTET STRING*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC12-1-T.paramID) SEQUENCE OF*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.nCount = (long)nCount; for(i1=0;i1<pVal->paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void TC12_2_T_Initialize(TC12_2_T* pVal) { Byte4_T_Initialize(&pVal->numberParams); ParamsEnDis_T_Initialize(&pVal->paramID); } flag TC12_2_T_IsConstraintValid(const TC12_2_T* pVal, int* pErrCode) { if (pVal->exist.numberParams) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParams, pErrCode)) return FALSE; } if (pVal->exist.paramID) { if ( !ParamsEnDis_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_2_T_Encode(const TC12_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID); if (pVal->exist.numberParams) { if (!Byte4_T_Encode(&pVal->numberParams, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.paramID) { if (!ParamsEnDis_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC12_2_T_Decode(TC12_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode numberParams (Byte4-T)*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; if (!Byte4_T_Decode(&pVal->numberParams, pBitStrm, pErrCode)) return FALSE; } /*Decode paramID (ParamsEnDis-T)*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; if (!ParamsEnDis_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC12_2_T_ACN_Encode(const TC12_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID);/* Encode numberParams (DataView.TC12-2-T.numberParams) OCTET STRING*/ if (pVal->exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParams.arr[i1]); } } /* Encode paramID (DataView.TC12-2-T.paramID) SEQUENCE OF*/ if (pVal->exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->paramID.nCount, 3);for(i1=0;i1<pVal->paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].arr[i2]); } } } return TRUE; } flag TC12_2_T_ACN_Decode(TC12_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC12-2-T.numberParams) OCTET STRING*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC12-2-T.paramID) SEQUENCE OF*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.nCount = (long)nCount; for(i1=0;i1<pVal->paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void TC12_3_T_Initialize(TC12_3_T* pVal) { Byte4_T_Initialize(&pVal->maxReportingDelay); } flag TC12_3_T_IsConstraintValid(const TC12_3_T* pVal, int* pErrCode) { if ( !Byte4_T_IsConstraintValid(&pVal->maxReportingDelay, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_3_T_Encode(const TC12_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC12_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte4_T_Encode(&pVal->maxReportingDelay, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TC12_3_T_Decode(TC12_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode maxReportingDelay (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->maxReportingDelay, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TC12_3_T_ACN_Encode(const TC12_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TC12_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode maxReportingDelay (DataView.TC12-3-T.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->maxReportingDelay.arr[i1]); } return TRUE; } flag TC12_3_T_ACN_Decode(TC12_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode maxReportingDelay (DataView.TC12-3-T.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void NOLSequence_T_Initialize(NOLSequence_T* pVal) { Byte4_T_Initialize(&pVal->checkSelectionParam); Byte4_T_Initialize(&pVal->lowLimit); Byte4_T_Initialize(&pVal->ridLow); Byte4_T_Initialize(&pVal->highLimit); Byte4_T_Initialize(&pVal->ridHigh); } flag NOLSequence_T_IsConstraintValid(const NOLSequence_T* pVal, int* pErrCode) { if (pVal->exist.checkSelectionParam) { if ( !Byte4_T_IsConstraintValid(&pVal->checkSelectionParam, pErrCode)) return FALSE; } if ( !Byte4_T_IsConstraintValid(&pVal->lowLimit, pErrCode)) return FALSE; if (pVal->exist.ridLow) { if ( !Byte4_T_IsConstraintValid(&pVal->ridLow, pErrCode)) return FALSE; } if ( !Byte4_T_IsConstraintValid(&pVal->highLimit, pErrCode)) return FALSE; if (pVal->exist.ridHigh) { if ( !Byte4_T_IsConstraintValid(&pVal->ridHigh, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NOLSequence_T_Encode(const NOLSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NOLSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->exist.ridHigh); if (pVal->exist.checkSelectionParam) { if (!Byte4_T_Encode(&pVal->checkSelectionParam, pBitStrm, pErrCode, FALSE)) return FALSE; } if (!Byte4_T_Encode(&pVal->lowLimit, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.ridLow) { if (!Byte4_T_Encode(&pVal->ridLow, pBitStrm, pErrCode, FALSE)) return FALSE; } if (!Byte4_T_Encode(&pVal->highLimit, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.ridHigh) { if (!Byte4_T_Encode(&pVal->ridHigh, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NOLSequence_T_Decode(NOLSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode checkSelectionParam (Byte4-T)*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; if (!Byte4_T_Decode(&pVal->checkSelectionParam, pBitStrm, pErrCode)) return FALSE; } /*Decode lowLimit (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->lowLimit, pBitStrm, pErrCode)) return FALSE; /*Decode ridLow (Byte4-T)*/ pVal->exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.ridLow = 1; if (!Byte4_T_Decode(&pVal->ridLow, pBitStrm, pErrCode)) return FALSE; } /*Decode highLimit (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->highLimit, pBitStrm, pErrCode)) return FALSE; /*Decode ridHigh (Byte4-T)*/ pVal->exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.ridHigh = 1; if (!Byte4_T_Decode(&pVal->ridHigh, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NOLSequence_T_ACN_Encode(const NOLSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NOLSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->exist.ridHigh);/* Encode checkSelectionParam (DataView.NOLSequence-T.checkSelectionParam) OCTET STRING*/ if (pVal->exist.checkSelectionParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->checkSelectionParam.arr[i1]); } } /* Encode lowLimit (DataView.NOLSequence-T.lowLimit) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->lowLimit.arr[i1]); } /* Encode ridLow (DataView.NOLSequence-T.ridLow) OCTET STRING*/ if (pVal->exist.ridLow ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->ridLow.arr[i1]); } } /* Encode highLimit (DataView.NOLSequence-T.highLimit) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->highLimit.arr[i1]); } /* Encode ridHigh (DataView.NOLSequence-T.ridHigh) OCTET STRING*/ if (pVal->exist.ridHigh ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->ridHigh.arr[i1]); } } return TRUE; } flag NOLSequence_T_ACN_Decode(NOLSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NOLSequence-T.checkSelectionParam) OCTET STRING*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->checkSelectionParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.NOLSequence-T.lowLimit) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->lowLimit.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.NOLSequence-T.ridLow) OCTET STRING*/ pVal->exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.ridLow = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->ridLow.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.NOLSequence-T.highLimit) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->highLimit.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.NOLSequence-T.ridHigh) OCTET STRING*/ pVal->exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.ridHigh = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->ridHigh.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void NOLSet_T_Initialize(NOLSet_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<5; i1++) { NOLSequence_T_Initialize(&pVal->arr[i1]); } } flag NOLSet_T_IsConstraintValid(const NOLSet_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=5))) ) { *pErrCode = ERR_NOLSet_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !NOLSequence_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NOLSet_T_Encode(const NOLSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NOLSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 5); for(i1=0;i1<pVal->nCount;i1++) { if (!NOLSequence_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NOLSet_T_Decode(NOLSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!NOLSequence_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NOLSet_T_ACN_Encode(const NOLSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NOLSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.ridHigh);/* Encode checkSelectionParam (DataView.NOLSet-T..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].checkSelectionParam.arr[i2]); } } /* Encode lowLimit (DataView.NOLSet-T..lowLimit) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].lowLimit.arr[i2]); } /* Encode ridLow (DataView.NOLSet-T..ridLow) OCTET STRING*/ if (pVal->arr[i1].exist.ridLow ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].ridLow.arr[i2]); } } /* Encode highLimit (DataView.NOLSet-T..highLimit) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].highLimit.arr[i2]); } /* Encode ridHigh (DataView.NOLSet-T..ridHigh) OCTET STRING*/ if (pVal->arr[i1].exist.ridHigh ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].ridHigh.arr[i2]); } } } return TRUE; } flag NOLSet_T_ACN_Decode(NOLSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NOLSet-T..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.NOLSet-T..lowLimit) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].lowLimit.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.NOLSet-T..ridLow) OCTET STRING*/ pVal->arr[i1].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].exist.ridLow = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].ridLow.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.NOLSet-T..highLimit) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].highLimit.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.NOLSet-T..ridHigh) OCTET STRING*/ pVal->arr[i1].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].exist.ridHigh = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].ridHigh.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void NODSequence_T_Initialize(NODSequence_T* pVal) { Byte4_T_Initialize(&pVal->checkSelectionParam); Byte4_T_Initialize(&pVal->lowDelta); Byte4_T_Initialize(&pVal->ridLow); Byte4_T_Initialize(&pVal->highDelta); Byte4_T_Initialize(&pVal->ridHigh); } flag NODSequence_T_IsConstraintValid(const NODSequence_T* pVal, int* pErrCode) { if (pVal->exist.checkSelectionParam) { if ( !Byte4_T_IsConstraintValid(&pVal->checkSelectionParam, pErrCode)) return FALSE; } if ( !Byte4_T_IsConstraintValid(&pVal->lowDelta, pErrCode)) return FALSE; if (pVal->exist.ridLow) { if ( !Byte4_T_IsConstraintValid(&pVal->ridLow, pErrCode)) return FALSE; } if ( !Byte4_T_IsConstraintValid(&pVal->highDelta, pErrCode)) return FALSE; if (pVal->exist.ridHigh) { if ( !Byte4_T_IsConstraintValid(&pVal->ridHigh, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NODSequence_T_Encode(const NODSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NODSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->exist.ridHigh); if (pVal->exist.checkSelectionParam) { if (!Byte4_T_Encode(&pVal->checkSelectionParam, pBitStrm, pErrCode, FALSE)) return FALSE; } if (!Byte4_T_Encode(&pVal->lowDelta, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.ridLow) { if (!Byte4_T_Encode(&pVal->ridLow, pBitStrm, pErrCode, FALSE)) return FALSE; } if (!Byte4_T_Encode(&pVal->highDelta, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.ridHigh) { if (!Byte4_T_Encode(&pVal->ridHigh, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NODSequence_T_Decode(NODSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode checkSelectionParam (Byte4-T)*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; if (!Byte4_T_Decode(&pVal->checkSelectionParam, pBitStrm, pErrCode)) return FALSE; } /*Decode lowDelta (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->lowDelta, pBitStrm, pErrCode)) return FALSE; /*Decode ridLow (Byte4-T)*/ pVal->exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.ridLow = 1; if (!Byte4_T_Decode(&pVal->ridLow, pBitStrm, pErrCode)) return FALSE; } /*Decode highDelta (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->highDelta, pBitStrm, pErrCode)) return FALSE; /*Decode ridHigh (Byte4-T)*/ pVal->exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.ridHigh = 1; if (!Byte4_T_Decode(&pVal->ridHigh, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NODSequence_T_ACN_Encode(const NODSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NODSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->exist.ridHigh);/* Encode checkSelectionParam (DataView.NODSequence-T.checkSelectionParam) OCTET STRING*/ if (pVal->exist.checkSelectionParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->checkSelectionParam.arr[i1]); } } /* Encode lowDelta (DataView.NODSequence-T.lowDelta) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->lowDelta.arr[i1]); } /* Encode ridLow (DataView.NODSequence-T.ridLow) OCTET STRING*/ if (pVal->exist.ridLow ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->ridLow.arr[i1]); } } /* Encode highDelta (DataView.NODSequence-T.highDelta) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->highDelta.arr[i1]); } /* Encode ridHigh (DataView.NODSequence-T.ridHigh) OCTET STRING*/ if (pVal->exist.ridHigh ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->ridHigh.arr[i1]); } } return TRUE; } flag NODSequence_T_ACN_Decode(NODSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NODSequence-T.checkSelectionParam) OCTET STRING*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->checkSelectionParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.NODSequence-T.lowDelta) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->lowDelta.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.NODSequence-T.ridLow) OCTET STRING*/ pVal->exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.ridLow = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->ridLow.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.NODSequence-T.highDelta) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->highDelta.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.NODSequence-T.ridHigh) OCTET STRING*/ pVal->exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.ridHigh = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->ridHigh.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void NODSet_T_Initialize(NODSet_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<5; i1++) { NODSequence_T_Initialize(&pVal->arr[i1]); } } flag NODSet_T_IsConstraintValid(const NODSet_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=5))) ) { *pErrCode = ERR_NODSet_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !NODSequence_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NODSet_T_Encode(const NODSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NODSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 5); for(i1=0;i1<pVal->nCount;i1++) { if (!NODSequence_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NODSet_T_Decode(NODSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!NODSequence_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NODSet_T_ACN_Encode(const NODSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NODSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.ridHigh);/* Encode checkSelectionParam (DataView.NODSet-T..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].checkSelectionParam.arr[i2]); } } /* Encode lowDelta (DataView.NODSet-T..lowDelta) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].lowDelta.arr[i2]); } /* Encode ridLow (DataView.NODSet-T..ridLow) OCTET STRING*/ if (pVal->arr[i1].exist.ridLow ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].ridLow.arr[i2]); } } /* Encode highDelta (DataView.NODSet-T..highDelta) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].highDelta.arr[i2]); } /* Encode ridHigh (DataView.NODSet-T..ridHigh) OCTET STRING*/ if (pVal->arr[i1].exist.ridHigh ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].ridHigh.arr[i2]); } } } return TRUE; } flag NODSet_T_ACN_Decode(NODSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NODSet-T..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.NODSet-T..lowDelta) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].lowDelta.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.NODSet-T..ridLow) OCTET STRING*/ pVal->arr[i1].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].exist.ridLow = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].ridLow.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.NODSet-T..highDelta) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].highDelta.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.NODSet-T..ridHigh) OCTET STRING*/ pVal->arr[i1].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].exist.ridHigh = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].ridHigh.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void NOESequence_T_Initialize(NOESequence_T* pVal) { Byte4_T_Initialize(&pVal->checkSelectionParam); Byte4_T_Initialize(&pVal->expectedValue); Byte4_T_Initialize(&pVal->rid); } flag NOESequence_T_IsConstraintValid(const NOESequence_T* pVal, int* pErrCode) { if (pVal->exist.checkSelectionParam) { if ( !Byte4_T_IsConstraintValid(&pVal->checkSelectionParam, pErrCode)) return FALSE; } if ( !Byte4_T_IsConstraintValid(&pVal->expectedValue, pErrCode)) return FALSE; if (pVal->exist.rid) { if ( !Byte4_T_IsConstraintValid(&pVal->rid, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NOESequence_T_Encode(const NOESequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NOESequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.rid); if (pVal->exist.checkSelectionParam) { if (!Byte4_T_Encode(&pVal->checkSelectionParam, pBitStrm, pErrCode, FALSE)) return FALSE; } if (!Byte4_T_Encode(&pVal->expectedValue, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.rid) { if (!Byte4_T_Encode(&pVal->rid, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NOESequence_T_Decode(NOESequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode checkSelectionParam (Byte4-T)*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; if (!Byte4_T_Decode(&pVal->checkSelectionParam, pBitStrm, pErrCode)) return FALSE; } /*Decode expectedValue (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->expectedValue, pBitStrm, pErrCode)) return FALSE; /*Decode rid (Byte4-T)*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; if (!Byte4_T_Decode(&pVal->rid, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NOESequence_T_ACN_Encode(const NOESequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !NOESequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->exist.rid);/* Encode checkSelectionParam (DataView.NOESequence-T.checkSelectionParam) OCTET STRING*/ if (pVal->exist.checkSelectionParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->checkSelectionParam.arr[i1]); } } /* Encode expectedValue (DataView.NOESequence-T.expectedValue) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->expectedValue.arr[i1]); } /* Encode rid (DataView.NOESequence-T.rid) OCTET STRING*/ if (pVal->exist.rid ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->rid.arr[i1]); } } return TRUE; } flag NOESequence_T_ACN_Decode(NOESequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NOESequence-T.checkSelectionParam) OCTET STRING*/ pVal->exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.checkSelectionParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->checkSelectionParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.NOESequence-T.expectedValue) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->expectedValue.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.NOESequence-T.rid) OCTET STRING*/ pVal->exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.rid = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->rid.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void NOESet_T_Initialize(NOESet_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<5; i1++) { NOESequence_T_Initialize(&pVal->arr[i1]); } } flag NOESet_T_IsConstraintValid(const NOESet_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=5))) ) { *pErrCode = ERR_NOESet_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !NOESequence_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag NOESet_T_Encode(const NOESet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NOESet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 5); for(i1=0;i1<pVal->nCount;i1++) { if (!NOESequence_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag NOESet_T_Decode(NOESet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!NOESequence_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag NOESet_T_ACN_Encode(const NOESet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !NOESet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.rid);/* Encode checkSelectionParam (DataView.NOESet-T..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].checkSelectionParam.arr[i2]); } } /* Encode expectedValue (DataView.NOESet-T..expectedValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].expectedValue.arr[i2]); } /* Encode rid (DataView.NOESet-T..rid) OCTET STRING*/ if (pVal->arr[i1].exist.rid ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].rid.arr[i2]); } } } return TRUE; } flag NOESet_T_ACN_Decode(NOESet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.NOESet-T..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.NOESet-T..expectedValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].expectedValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.NOESet-T..rid) OCTET STRING*/ pVal->arr[i1].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].exist.rid = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].rid.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void ParamsSequence_T_Initialize(ParamsSequence_T* pVal) { Byte4_T_Initialize(&pVal->nol); NOLSet_T_Initialize(&pVal->nolSeq); Byte4_T_Initialize(&pVal->nod); NODSet_T_Initialize(&pVal->nodSeq); Byte4_T_Initialize(&pVal->noe); NOESet_T_Initialize(&pVal->noeSeq); } flag ParamsSequence_T_IsConstraintValid(const ParamsSequence_T* pVal, int* pErrCode) { if (pVal->exist.nol) { if ( !Byte4_T_IsConstraintValid(&pVal->nol, pErrCode)) return FALSE; } if (pVal->exist.nolSeq) { if ( !NOLSet_T_IsConstraintValid(&pVal->nolSeq, pErrCode)) return FALSE; } if (pVal->exist.nod) { if ( !Byte4_T_IsConstraintValid(&pVal->nod, pErrCode)) return FALSE; } if (pVal->exist.nodSeq) { if ( !NODSet_T_IsConstraintValid(&pVal->nodSeq, pErrCode)) return FALSE; } if (pVal->exist.noe) { if ( !Byte4_T_IsConstraintValid(&pVal->noe, pErrCode)) return FALSE; } if (pVal->exist.noeSeq) { if ( !NOESet_T_IsConstraintValid(&pVal->noeSeq, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ParamsSequence_T_Encode(const ParamsSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !ParamsSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.nol); BitStream_AppendBit(pBitStrm,pVal->exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->exist.nod); BitStream_AppendBit(pBitStrm,pVal->exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->exist.noe); BitStream_AppendBit(pBitStrm,pVal->exist.noeSeq); if (pVal->exist.nol) { if (!Byte4_T_Encode(&pVal->nol, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.nolSeq) { if (!NOLSet_T_Encode(&pVal->nolSeq, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.nod) { if (!Byte4_T_Encode(&pVal->nod, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.nodSeq) { if (!NODSet_T_Encode(&pVal->nodSeq, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.noe) { if (!Byte4_T_Encode(&pVal->noe, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.noeSeq) { if (!NOESet_T_Encode(&pVal->noeSeq, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag ParamsSequence_T_Decode(ParamsSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode nol (Byte4-T)*/ pVal->exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.nol = 1; if (!Byte4_T_Decode(&pVal->nol, pBitStrm, pErrCode)) return FALSE; } /*Decode nolSeq (NOLSet-T)*/ pVal->exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.nolSeq = 1; if (!NOLSet_T_Decode(&pVal->nolSeq, pBitStrm, pErrCode)) return FALSE; } /*Decode nod (Byte4-T)*/ pVal->exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.nod = 1; if (!Byte4_T_Decode(&pVal->nod, pBitStrm, pErrCode)) return FALSE; } /*Decode nodSeq (NODSet-T)*/ pVal->exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->exist.nodSeq = 1; if (!NODSet_T_Decode(&pVal->nodSeq, pBitStrm, pErrCode)) return FALSE; } /*Decode noe (Byte4-T)*/ pVal->exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->exist.noe = 1; if (!Byte4_T_Decode(&pVal->noe, pBitStrm, pErrCode)) return FALSE; } /*Decode noeSeq (NOESet-T)*/ pVal->exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->exist.noeSeq = 1; if (!NOESet_T_Decode(&pVal->noeSeq, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag ParamsSequence_T_ACN_Encode(const ParamsSequence_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !ParamsSequence_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.nol); BitStream_AppendBit(pBitStrm,pVal->exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->exist.nod); BitStream_AppendBit(pBitStrm,pVal->exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->exist.noe); BitStream_AppendBit(pBitStrm,pVal->exist.noeSeq);/* Encode nol (DataView.ParamsSequence-T.nol) OCTET STRING*/ if (pVal->exist.nol ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->nol.arr[i1]); } } /* Encode nolSeq (DataView.ParamsSequence-T.nolSeq) SEQUENCE OF*/ if (pVal->exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->nolSeq.nCount, 3);for(i1=0;i1<pVal->nolSeq.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->nolSeq.arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->nolSeq.arr[i1].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->nolSeq.arr[i1].exist.ridHigh);/* Encode checkSelectionParam (DataView.ParamsSequence-T.nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->nolSeq.arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nolSeq.arr[i1].checkSelectionParam.arr[i2]); } } /* Encode lowLimit (DataView.ParamsSequence-T.nolSeq..lowLimit) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nolSeq.arr[i1].lowLimit.arr[i2]); } /* Encode ridLow (DataView.ParamsSequence-T.nolSeq..ridLow) OCTET STRING*/ if (pVal->nolSeq.arr[i1].exist.ridLow ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nolSeq.arr[i1].ridLow.arr[i2]); } } /* Encode highLimit (DataView.ParamsSequence-T.nolSeq..highLimit) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nolSeq.arr[i1].highLimit.arr[i2]); } /* Encode ridHigh (DataView.ParamsSequence-T.nolSeq..ridHigh) OCTET STRING*/ if (pVal->nolSeq.arr[i1].exist.ridHigh ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nolSeq.arr[i1].ridHigh.arr[i2]); } } } } /* Encode nod (DataView.ParamsSequence-T.nod) OCTET STRING*/ if (pVal->exist.nod ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->nod.arr[i1]); } } /* Encode nodSeq (DataView.ParamsSequence-T.nodSeq) SEQUENCE OF*/ if (pVal->exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->nodSeq.nCount, 3);for(i1=0;i1<pVal->nodSeq.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->nodSeq.arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->nodSeq.arr[i1].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->nodSeq.arr[i1].exist.ridHigh);/* Encode checkSelectionParam (DataView.ParamsSequence-T.nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->nodSeq.arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nodSeq.arr[i1].checkSelectionParam.arr[i2]); } } /* Encode lowDelta (DataView.ParamsSequence-T.nodSeq..lowDelta) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nodSeq.arr[i1].lowDelta.arr[i2]); } /* Encode ridLow (DataView.ParamsSequence-T.nodSeq..ridLow) OCTET STRING*/ if (pVal->nodSeq.arr[i1].exist.ridLow ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nodSeq.arr[i1].ridLow.arr[i2]); } } /* Encode highDelta (DataView.ParamsSequence-T.nodSeq..highDelta) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nodSeq.arr[i1].highDelta.arr[i2]); } /* Encode ridHigh (DataView.ParamsSequence-T.nodSeq..ridHigh) OCTET STRING*/ if (pVal->nodSeq.arr[i1].exist.ridHigh ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->nodSeq.arr[i1].ridHigh.arr[i2]); } } } } /* Encode noe (DataView.ParamsSequence-T.noe) OCTET STRING*/ if (pVal->exist.noe ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->noe.arr[i1]); } } /* Encode noeSeq (DataView.ParamsSequence-T.noeSeq) SEQUENCE OF*/ if (pVal->exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->noeSeq.nCount, 3);for(i1=0;i1<pVal->noeSeq.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->noeSeq.arr[i1].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->noeSeq.arr[i1].exist.rid);/* Encode checkSelectionParam (DataView.ParamsSequence-T.noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->noeSeq.arr[i1].exist.checkSelectionParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->noeSeq.arr[i1].checkSelectionParam.arr[i2]); } } /* Encode expectedValue (DataView.ParamsSequence-T.noeSeq..expectedValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->noeSeq.arr[i1].expectedValue.arr[i2]); } /* Encode rid (DataView.ParamsSequence-T.noeSeq..rid) OCTET STRING*/ if (pVal->noeSeq.arr[i1].exist.rid ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->noeSeq.arr[i1].rid.arr[i2]); } } } } return TRUE; } flag ParamsSequence_T_ACN_Decode(ParamsSequence_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.ParamsSequence-T.nol) OCTET STRING*/ pVal->exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.nol = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nol.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.ParamsSequence-T.nolSeq) SEQUENCE OF*/ pVal->exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nolSeq.nCount = (long)nCount; for(i1=0;i1<pVal->nolSeq.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamsSequence-T.nolSeq..checkSelectionParam) OCTET STRING*/ pVal->nolSeq.arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->nolSeq.arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nolSeq.arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.ParamsSequence-T.nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nolSeq.arr[i1].lowLimit.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.ParamsSequence-T.nolSeq..ridLow) OCTET STRING*/ pVal->nolSeq.arr[i1].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->nolSeq.arr[i1].exist.ridLow = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nolSeq.arr[i1].ridLow.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.ParamsSequence-T.nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nolSeq.arr[i1].highLimit.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.ParamsSequence-T.nolSeq..ridHigh) OCTET STRING*/ pVal->nolSeq.arr[i1].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->nolSeq.arr[i1].exist.ridHigh = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nolSeq.arr[i1].ridHigh.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.ParamsSequence-T.nod) OCTET STRING*/ pVal->exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.nod = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nod.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.ParamsSequence-T.nodSeq) SEQUENCE OF*/ pVal->exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nodSeq.nCount = (long)nCount; for(i1=0;i1<pVal->nodSeq.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamsSequence-T.nodSeq..checkSelectionParam) OCTET STRING*/ pVal->nodSeq.arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->nodSeq.arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nodSeq.arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.ParamsSequence-T.nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nodSeq.arr[i1].lowDelta.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.ParamsSequence-T.nodSeq..ridLow) OCTET STRING*/ pVal->nodSeq.arr[i1].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->nodSeq.arr[i1].exist.ridLow = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nodSeq.arr[i1].ridLow.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.ParamsSequence-T.nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nodSeq.arr[i1].highDelta.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.ParamsSequence-T.nodSeq..ridHigh) OCTET STRING*/ pVal->nodSeq.arr[i1].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->nodSeq.arr[i1].exist.ridHigh = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->nodSeq.arr[i1].ridHigh.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.ParamsSequence-T.noe) OCTET STRING*/ pVal->exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->exist.noe = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->noe.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.ParamsSequence-T.noeSeq) SEQUENCE OF*/ pVal->exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->noeSeq.nCount = (long)nCount; for(i1=0;i1<pVal->noeSeq.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamsSequence-T.noeSeq..checkSelectionParam) OCTET STRING*/ pVal->noeSeq.arr[i1].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->noeSeq.arr[i1].exist.checkSelectionParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->noeSeq.arr[i1].checkSelectionParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.ParamsSequence-T.noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->noeSeq.arr[i1].expectedValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.ParamsSequence-T.noeSeq..rid) OCTET STRING*/ pVal->noeSeq.arr[i1].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->noeSeq.arr[i1].exist.rid = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->noeSeq.arr[i1].rid.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } return TRUE; } void ParamSeqSet_T_Initialize(ParamSeqSet_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<2; i1++) { ParamsSequence_T_Initialize(&pVal->arr[i1]); } } flag ParamSeqSet_T_IsConstraintValid(const ParamSeqSet_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=2))) ) { *pErrCode = ERR_ParamSeqSet_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !ParamsSequence_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag ParamSeqSet_T_Encode(const ParamSeqSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !ParamSeqSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 2); for(i1=0;i1<pVal->nCount;i1++) { if (!ParamsSequence_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag ParamSeqSet_T_Decode(ParamSeqSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!ParamsSequence_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag ParamSeqSet_T_ACN_Encode(const ParamSeqSet_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !ParamSeqSet_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 1);for(i1=0;i1<pVal->nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->arr[i1].exist.noeSeq);/* Encode nol (DataView.ParamSeqSet-T..nol) OCTET STRING*/ if (pVal->arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.ParamSeqSet-T..nolSeq) SEQUENCE OF*/ if (pVal->arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.ParamSeqSet-T..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.ParamSeqSet-T..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.ParamSeqSet-T..nolSeq..ridLow) OCTET STRING*/ if (pVal->arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.ParamSeqSet-T..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.ParamSeqSet-T..nolSeq..ridHigh) OCTET STRING*/ if (pVal->arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.ParamSeqSet-T..nod) OCTET STRING*/ if (pVal->arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.ParamSeqSet-T..nodSeq) SEQUENCE OF*/ if (pVal->arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.ParamSeqSet-T..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.ParamSeqSet-T..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.ParamSeqSet-T..nodSeq..ridLow) OCTET STRING*/ if (pVal->arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.ParamSeqSet-T..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.ParamSeqSet-T..nodSeq..ridHigh) OCTET STRING*/ if (pVal->arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.ParamSeqSet-T..noe) OCTET STRING*/ if (pVal->arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.ParamSeqSet-T..noeSeq) SEQUENCE OF*/ if (pVal->arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.ParamSeqSet-T..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.ParamSeqSet-T..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.ParamSeqSet-T..noeSeq..rid) OCTET STRING*/ if (pVal->arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } return TRUE; } flag ParamSeqSet_T_ACN_Decode(ParamSeqSet_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint nCount = 0; byte bitMask[1]; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.ParamSeqSet-T..nol) OCTET STRING*/ pVal->arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.ParamSeqSet-T..nolSeq) SEQUENCE OF*/ pVal->arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamSeqSet-T..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.ParamSeqSet-T..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.ParamSeqSet-T..nolSeq..ridLow) OCTET STRING*/ pVal->arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.ParamSeqSet-T..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.ParamSeqSet-T..nolSeq..ridHigh) OCTET STRING*/ pVal->arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.ParamSeqSet-T..nod) OCTET STRING*/ pVal->arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.ParamSeqSet-T..nodSeq) SEQUENCE OF*/ pVal->arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamSeqSet-T..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.ParamSeqSet-T..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.ParamSeqSet-T..nodSeq..ridLow) OCTET STRING*/ pVal->arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.ParamSeqSet-T..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.ParamSeqSet-T..nodSeq..ridHigh) OCTET STRING*/ pVal->arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.ParamSeqSet-T..noe) OCTET STRING*/ pVal->arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.ParamSeqSet-T..noeSeq) SEQUENCE OF*/ pVal->arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.ParamSeqSet-T..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.ParamSeqSet-T..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.ParamSeqSet-T..noeSeq..rid) OCTET STRING*/ pVal->arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } return TRUE; } void TC12_5_T_Initialize(TC12_5_T* pVal) { Byte4_T_Initialize(&pVal->paramMonitoringInterval); Byte4_T_Initialize(&pVal->valueRep); Byte4_T_Initialize(&pVal->deltaRep); Byte4_T_Initialize(&pVal->numberParam); ParamSeqSet_T_Initialize(&pVal->paramID); } flag TC12_5_T_IsConstraintValid(const TC12_5_T* pVal, int* pErrCode) { if (pVal->exist.paramMonitoringInterval) { if ( !Byte4_T_IsConstraintValid(&pVal->paramMonitoringInterval, pErrCode)) return FALSE; } if (pVal->exist.valueRep) { if ( !Byte4_T_IsConstraintValid(&pVal->valueRep, pErrCode)) return FALSE; } if (pVal->exist.deltaRep) { if ( !Byte4_T_IsConstraintValid(&pVal->deltaRep, pErrCode)) return FALSE; } if (pVal->exist.numberParam) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParam, pErrCode)) return FALSE; } if (pVal->exist.paramID) { if ( !ParamSeqSet_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_5_T_Encode(const TC12_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TC12_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->exist.paramID); if (pVal->exist.paramMonitoringInterval) { if (!Byte4_T_Encode(&pVal->paramMonitoringInterval, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.valueRep) { if (!Byte4_T_Encode(&pVal->valueRep, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.deltaRep) { if (!Byte4_T_Encode(&pVal->deltaRep, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.numberParam) { if (!Byte4_T_Encode(&pVal->numberParam, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.paramID) { if (!ParamSeqSet_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC12_5_T_Decode(TC12_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode paramMonitoringInterval (Byte4-T)*/ pVal->exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.paramMonitoringInterval = 1; if (!Byte4_T_Decode(&pVal->paramMonitoringInterval, pBitStrm, pErrCode)) return FALSE; } /*Decode valueRep (Byte4-T)*/ pVal->exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.valueRep = 1; if (!Byte4_T_Decode(&pVal->valueRep, pBitStrm, pErrCode)) return FALSE; } /*Decode deltaRep (Byte4-T)*/ pVal->exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.deltaRep = 1; if (!Byte4_T_Decode(&pVal->deltaRep, pBitStrm, pErrCode)) return FALSE; } /*Decode numberParam (Byte4-T)*/ pVal->exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->exist.numberParam = 1; if (!Byte4_T_Decode(&pVal->numberParam, pBitStrm, pErrCode)) return FALSE; } /*Decode paramID (ParamSeqSet-T)*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->exist.paramID = 1; if (!ParamSeqSet_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC12_5_T_ACN_Encode(const TC12_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TC12_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->exist.paramID);/* Encode paramMonitoringInterval (DataView.TC12-5-T.paramMonitoringInterval) OCTET STRING*/ if (pVal->exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.TC12-5-T.valueRep) OCTET STRING*/ if (pVal->exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->valueRep.arr[i1]); } } /* Encode deltaRep (DataView.TC12-5-T.deltaRep) OCTET STRING*/ if (pVal->exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->deltaRep.arr[i1]); } } /* Encode numberParam (DataView.TC12-5-T.numberParam) OCTET STRING*/ if (pVal->exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParam.arr[i1]); } } /* Encode paramID (DataView.TC12-5-T.paramID) SEQUENCE OF*/ if (pVal->exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->paramID.nCount, 1);for(i1=0;i1<pVal->paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.TC12-5-T.paramID..nol) OCTET STRING*/ if (pVal->paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.TC12-5-T.paramID..nolSeq) SEQUENCE OF*/ if (pVal->paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TC12-5-T.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.TC12-5-T.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.TC12-5-T.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.TC12-5-T.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.TC12-5-T.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.TC12-5-T.paramID..nod) OCTET STRING*/ if (pVal->paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.TC12-5-T.paramID..nodSeq) SEQUENCE OF*/ if (pVal->paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TC12-5-T.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.TC12-5-T.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.TC12-5-T.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.TC12-5-T.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.TC12-5-T.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.TC12-5-T.paramID..noe) OCTET STRING*/ if (pVal->paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.TC12-5-T.paramID..noeSeq) SEQUENCE OF*/ if (pVal->paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.TC12-5-T.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.TC12-5-T.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.TC12-5-T.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } return TRUE; } flag TC12_5_T_ACN_Decode(TC12_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.TC12-5-T.paramMonitoringInterval) OCTET STRING*/ pVal->exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.TC12-5-T.valueRep) OCTET STRING*/ pVal->exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.TC12-5-T.deltaRep) OCTET STRING*/ pVal->exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.TC12-5-T.numberParam) OCTET STRING*/ pVal->exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC12-5-T.paramID) SEQUENCE OF*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->paramID.nCount = (long)nCount; for(i1=0;i1<pVal->paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.TC12-5-T.paramID..nol) OCTET STRING*/ pVal->paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.TC12-5-T.paramID..nolSeq) SEQUENCE OF*/ pVal->paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC12-5-T.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.TC12-5-T.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TC12-5-T.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.TC12-5-T.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TC12-5-T.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.TC12-5-T.paramID..nod) OCTET STRING*/ pVal->paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.TC12-5-T.paramID..nodSeq) SEQUENCE OF*/ pVal->paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC12-5-T.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.TC12-5-T.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TC12-5-T.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.TC12-5-T.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TC12-5-T.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.TC12-5-T.paramID..noe) OCTET STRING*/ pVal->paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.TC12-5-T.paramID..noeSeq) SEQUENCE OF*/ pVal->paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC12-5-T.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.TC12-5-T.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.TC12-5-T.paramID..noeSeq..rid) OCTET STRING*/ pVal->paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } return TRUE; } void TC12_6_T_Initialize(TC12_6_T* pVal) { Byte4_T_Initialize(&pVal->numberParams); ParamsEnDis_T_Initialize(&pVal->paramID); } flag TC12_6_T_IsConstraintValid(const TC12_6_T* pVal, int* pErrCode) { if (pVal->exist.numberParams) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParams, pErrCode)) return FALSE; } if (pVal->exist.paramID) { if ( !ParamsEnDis_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_6_T_Encode(const TC12_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID); if (pVal->exist.numberParams) { if (!Byte4_T_Encode(&pVal->numberParams, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.paramID) { if (!ParamsEnDis_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TC12_6_T_Decode(TC12_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode numberParams (Byte4-T)*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; if (!Byte4_T_Decode(&pVal->numberParams, pBitStrm, pErrCode)) return FALSE; } /*Decode paramID (ParamsEnDis-T)*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; if (!ParamsEnDis_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TC12_6_T_ACN_Encode(const TC12_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->exist.paramID);/* Encode numberParams (DataView.TC12-6-T.numberParams) OCTET STRING*/ if (pVal->exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParams.arr[i1]); } } /* Encode paramID (DataView.TC12-6-T.paramID) SEQUENCE OF*/ if (pVal->exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->paramID.nCount, 3);for(i1=0;i1<pVal->paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1].arr[i2]); } } } return TRUE; } flag TC12_6_T_ACN_Decode(TC12_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC12-6-T.numberParams) OCTET STRING*/ pVal->exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC12-6-T.paramID) SEQUENCE OF*/ pVal->exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->paramID.nCount = (long)nCount; for(i1=0;i1<pVal->paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } return TRUE; } void Params12_10_T_Initialize(Params12_10_T* pVal) { Byte4_T_Initialize(&pVal->paramID); Byte4_T_Initialize(&pVal->paramValue); Byte4_T_Initialize(&pVal->limitCrossed); Byte4_T_Initialize(&pVal->previousCheckingStatus); Byte4_T_Initialize(&pVal->currentCheckingStatus); Byte4_T_Initialize(&pVal->transitionTime); } flag Params12_10_T_IsConstraintValid(const Params12_10_T* pVal, int* pErrCode) { if ( !Byte4_T_IsConstraintValid(&pVal->paramID, pErrCode)) return FALSE; if ( !Byte4_T_IsConstraintValid(&pVal->paramValue, pErrCode)) return FALSE; if ( !Byte4_T_IsConstraintValid(&pVal->limitCrossed, pErrCode)) return FALSE; if ( !Byte4_T_IsConstraintValid(&pVal->previousCheckingStatus, pErrCode)) return FALSE; if ( !Byte4_T_IsConstraintValid(&pVal->currentCheckingStatus, pErrCode)) return FALSE; if ( !Byte4_T_IsConstraintValid(&pVal->transitionTime, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Params12_10_T_Encode(const Params12_10_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Params12_10_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte4_T_Encode(&pVal->paramID, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte4_T_Encode(&pVal->paramValue, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte4_T_Encode(&pVal->limitCrossed, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte4_T_Encode(&pVal->previousCheckingStatus, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte4_T_Encode(&pVal->currentCheckingStatus, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte4_T_Encode(&pVal->transitionTime, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag Params12_10_T_Decode(Params12_10_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode paramID (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->paramID, pBitStrm, pErrCode)) return FALSE; /*Decode paramValue (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->paramValue, pBitStrm, pErrCode)) return FALSE; /*Decode limitCrossed (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->limitCrossed, pBitStrm, pErrCode)) return FALSE; /*Decode previousCheckingStatus (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->previousCheckingStatus, pBitStrm, pErrCode)) return FALSE; /*Decode currentCheckingStatus (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->currentCheckingStatus, pBitStrm, pErrCode)) return FALSE; /*Decode transitionTime (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->transitionTime, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag Params12_10_T_ACN_Encode(const Params12_10_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Params12_10_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode paramID (DataView.Params12-10-T.paramID) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->paramID.arr[i1]); } /* Encode paramValue (DataView.Params12-10-T.paramValue) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->paramValue.arr[i1]); } /* Encode limitCrossed (DataView.Params12-10-T.limitCrossed) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->limitCrossed.arr[i1]); } /* Encode previousCheckingStatus (DataView.Params12-10-T.previousCheckingStatus) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->previousCheckingStatus.arr[i1]); } /* Encode currentCheckingStatus (DataView.Params12-10-T.currentCheckingStatus) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->currentCheckingStatus.arr[i1]); } /* Encode transitionTime (DataView.Params12-10-T.transitionTime) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->transitionTime.arr[i1]); } return TRUE; } flag Params12_10_T_ACN_Decode(Params12_10_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode paramID (DataView.Params12-10-T.paramID) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.Params12-10-T.paramValue) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->paramValue.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.Params12-10-T.limitCrossed) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->limitCrossed.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.Params12-10-T.previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->previousCheckingStatus.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.Params12-10-T.currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->currentCheckingStatus.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.Params12-10-T.transitionTime) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->transitionTime.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void Params1210Set_T_Initialize(Params1210Set_T* pVal) { int i1 = 0; pVal->nCount = 0; for(i1 = 0; i1<5; i1++) { Params12_10_T_Initialize(&pVal->arr[i1]); } } flag Params1210Set_T_IsConstraintValid(const Params1210Set_T* pVal, int* pErrCode) { int i1 = 0; if ( !(((pVal->nCount>=1) && (pVal->nCount<=5))) ) { *pErrCode = ERR_Params1210Set_T; return FALSE; } for(i1 = 0; i1<pVal->nCount; i1++) { if ( !Params12_10_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Params1210Set_T_Encode(const Params1210Set_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !Params1210Set_T_IsConstraintValid(pVal, pErrCode)) return FALSE; BitStream_EncodeConstraintWholeNumber(pBitStrm, pVal->nCount, 1, 5); for(i1=0;i1<pVal->nCount;i1++) { if (!Params12_10_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag Params1210Set_T_Decode(Params1210Set_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nCount, 1, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { if (!Params12_10_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag Params1210Set_T_ACN_Encode(const Params1210Set_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !Params1210Set_T_IsConstraintValid(pVal, pErrCode)) return FALSE; Acn_Enc_Length(pBitStrm, pVal->nCount, 3);for(i1=0;i1<pVal->nCount;i1++) { /* Encode paramID (DataView.Params1210Set-T..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.Params1210Set-T..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.Params1210Set-T..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.Params1210Set-T..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.Params1210Set-T..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.Params1210Set-T..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].transitionTime.arr[i2]); } } return TRUE; } flag Params1210Set_T_ACN_Decode(Params1210Set_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->nCount = (long)nCount; for(i1=0;i1<pVal->nCount;i1++) { /* Decode paramID (DataView.Params1210Set-T..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.Params1210Set-T..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.Params1210Set-T..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.Params1210Set-T..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.Params1210Set-T..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.Params1210Set-T..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TC12_10_T_Initialize(TC12_10_T* pVal) { Byte4_T_Initialize(&pVal->numberParams); Params1210Set_T_Initialize(&pVal->params); } flag TC12_10_T_IsConstraintValid(const TC12_10_T* pVal, int* pErrCode) { if ( !Byte4_T_IsConstraintValid(&pVal->numberParams, pErrCode)) return FALSE; if ( !Params1210Set_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC12_10_T_Encode(const TC12_10_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_10_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte4_T_Encode(&pVal->numberParams, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Params1210Set_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TC12_10_T_Decode(TC12_10_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; /*Decode numberParams (Byte4-T)*/ if (!Byte4_T_Decode(&pVal->numberParams, pBitStrm, pErrCode)) return FALSE; /*Decode params (Params1210Set-T)*/ if (!Params1210Set_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TC12_10_T_ACN_Encode(const TC12_10_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; if (bCheckConstraints && !TC12_10_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode numberParams (DataView.TC12-10-T.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->numberParams.arr[i1]); } /* Encode params (DataView.TC12-10-T.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->params.nCount, 3);for(i1=0;i1<pVal->params.nCount;i1++) { /* Encode paramID (DataView.TC12-10-T.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TC12-10-T.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.TC12-10-T.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.TC12-10-T.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.TC12-10-T.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.TC12-10-T.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1].transitionTime.arr[i2]); } } return TRUE; } flag TC12_10_T_ACN_Decode(TC12_10_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; asn1SccSint nCount = 0; /* Decode numberParams (DataView.TC12-10-T.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TC12-10-T.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->params.nCount = (long)nCount; for(i1=0;i1<pVal->params.nCount;i1++) { /* Decode paramID (DataView.TC12-10-T.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TC12-10-T.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.TC12-10-T.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.TC12-10-T.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.TC12-10-T.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.TC12-10-T.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void CODE_ACC_T_Initialize(CODE_ACC_T* pVal) { *pVal = invalidPacketID; } flag CODE_ACC_T_IsConstraintValid(const CODE_ACC_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag CODE_ACC_T_Encode(const CODE_ACC_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CODE_ACC_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case invalidPacketID: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 6); break; case invalidPacketSequenceControl: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 6); break; case invalidPacketLength: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 6); break; case invalidDfhInfo: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 6); break; case invalidServiceType: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 6); break; case invalidServiceSubtype: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 6); break; case invalidSourceID: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 6); break; default: *pErrCode = ERR_CODE_ACC_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CODE_ACC_T_Decode(CODE_ACC_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = invalidPacketID; break; case 1: *pVal = invalidPacketSequenceControl; break; case 2: *pVal = invalidPacketLength; break; case 3: *pVal = invalidDfhInfo; break; case 4: *pVal = invalidServiceType; break; case 5: *pVal = invalidServiceSubtype; break; case 6: *pVal = invalidSourceID; break; default: *pErrCode = ERR_CODE_ACC_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CODE_ACC_T_ACN_Encode(const CODE_ACC_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !CODE_ACC_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_CODE_ACC_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag CODE_ACC_T_ACN_Decode(CODE_ACC_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = invalidPacketID; break; case 1: *pVal = invalidPacketSequenceControl; break; case 2: *pVal = invalidPacketLength; break; case 3: *pVal = invalidDfhInfo; break; case 4: *pVal = invalidServiceType; break; case 5: *pVal = invalidServiceSubtype; break; case 6: *pVal = invalidSourceID; break; default: *pErrCode = ERR_CODE_ACC_T_unknown_enumeration_value; return FALSE; } return TRUE; } void TM_DFH_T_Initialize(TM_DFH_T* pVal) { Byte1_T_Initialize(&pVal->tmHeader); Byte1_T_Initialize(&pVal->serviceType); Byte1_T_Initialize(&pVal->serviceSubtype); Byte1_T_Initialize(&pVal->packetSubcounter); Byte1_T_Initialize(&pVal->absTime); Byte1_T_Initialize(&pVal->spare3); } flag TM_DFH_T_IsConstraintValid(const TM_DFH_T* pVal, int* pErrCode) { if ( !Byte1_T_IsConstraintValid(&pVal->tmHeader, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->serviceType, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->serviceSubtype, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->packetSubcounter, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->absTime, pErrCode)) return FALSE; if ( !Byte1_T_IsConstraintValid(&pVal->spare3, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM_DFH_T_Encode(const TM_DFH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_DFH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte1_T_Encode(&pVal->tmHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->serviceType, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->serviceSubtype, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->packetSubcounter, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->absTime, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte1_T_Encode(&pVal->spare3, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM_DFH_T_Decode(TM_DFH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode tmHeader (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->tmHeader, pBitStrm, pErrCode)) return FALSE; /*Decode serviceType (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->serviceType, pBitStrm, pErrCode)) return FALSE; /*Decode serviceSubtype (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->serviceSubtype, pBitStrm, pErrCode)) return FALSE; /*Decode packetSubcounter (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->packetSubcounter, pBitStrm, pErrCode)) return FALSE; /*Decode absTime (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->absTime, pBitStrm, pErrCode)) return FALSE; /*Decode spare3 (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->spare3, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM_DFH_T_ACN_Encode(const TM_DFH_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_DFH_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode tmHeader (DataView.TM-DFH-T.tmHeader) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tmHeader.arr[i1]); } /* Encode serviceType (DataView.TM-DFH-T.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TM-DFH-T.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->serviceSubtype.arr[i1]); } /* Encode packetSubcounter (DataView.TM-DFH-T.packetSubcounter) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSubcounter.arr[i1]); } /* Encode absTime (DataView.TM-DFH-T.absTime) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->absTime.arr[i1]); } /* Encode spare3 (DataView.TM-DFH-T.spare3) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->spare3.arr[i1]); } return TRUE; } flag TM_DFH_T_ACN_Decode(TM_DFH_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode tmHeader (DataView.TM-DFH-T.tmHeader) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tmHeader.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TM-DFH-T.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TM-DFH-T.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSubcounter (DataView.TM-DFH-T.packetSubcounter) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSubcounter.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode absTime (DataView.TM-DFH-T.absTime) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->absTime.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode spare3 (DataView.TM-DFH-T.spare3) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->spare3.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TMID_T_Initialize(TMID_T* pVal) { *pVal = tm11; } flag TMID_T_IsConstraintValid(const TMID_T* pVal, int* pErrCode) { (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TMID_T_Encode(const TMID_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TMID_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case tm11: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); break; case tm12: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); break; case tm13: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); break; case tm14: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); break; case tm15: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); break; case tm16: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); break; case tm17: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); break; case tm18: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); break; case tm51: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); break; case tm52: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); break; case tm53: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); break; case tm54: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); break; default: *pErrCode = ERR_TMID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TMID_T_Decode(TMID_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &enumIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = tm11; break; case 1: *pVal = tm12; break; case 2: *pVal = tm13; break; case 3: *pVal = tm14; break; case 4: *pVal = tm15; break; case 5: *pVal = tm16; break; case 6: *pVal = tm17; break; case 7: *pVal = tm18; break; case 8: *pVal = tm51; break; case 9: *pVal = tm52; break; case 10: *pVal = tm53; break; case 11: *pVal = tm54; break; default: *pErrCode = ERR_TMID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TMID_T_ACN_Encode(const TMID_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TMID_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(*pVal) { case tm11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tm12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tm13: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tm14: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tm15: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tm16: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tm17: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tm18: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tm51: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; case tm52: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 4); break; case tm53: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 4); break; case tm54: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 4); break; default: *pErrCode = ERR_TMID_T_unknown_enumeration_value; return FALSE; } return TRUE; } flag TMID_T_ACN_Decode(TMID_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: *pVal = tm11; break; case 1: *pVal = tm12; break; case 2: *pVal = tm13; break; case 3: *pVal = tm14; break; case 4: *pVal = tm15; break; case 5: *pVal = tm16; break; case 6: *pVal = tm17; break; case 7: *pVal = tm18; break; case 8: *pVal = tm51; break; case 9: *pVal = tm52; break; case 10: *pVal = tm53; break; case 11: *pVal = tm54; break; default: *pErrCode = ERR_TMID_T_unknown_enumeration_value; return FALSE; } return TRUE; } void TM1_1_T_Initialize(TM1_1_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); } flag TM1_1_T_IsConstraintValid(const TM1_1_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_1_T_Encode(const TM1_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM1_1_T_Decode(TM1_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM1_1_T_ACN_Encode(const TM1_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetId (DataView.TM1-1-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-1-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } return TRUE; } flag TM1_1_T_ACN_Decode(TM1_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode packetId (DataView.TM1-1-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-1-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TM1_2_T_Initialize(TM1_2_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); CODE_ACC_T_Initialize(&pVal->code); Byte4_T_Initialize(&pVal->params); } flag TM1_2_T_IsConstraintValid(const TM1_2_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; if ( !CODE_ACC_T_IsConstraintValid(&pVal->code, pErrCode)) return FALSE; if (pVal->exist.params) { if ( !Byte4_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_2_T_Encode(const TM1_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.params); if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (!CODE_ACC_T_Encode(&pVal->code, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.params) { if (!Byte4_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TM1_2_T_Decode(TM1_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; /*Decode code (CODE-ACC-T)*/ if (!CODE_ACC_T_Decode(&pVal->code, pBitStrm, pErrCode)) return FALSE; /*Decode params (Byte4-T)*/ pVal->exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.params = 1; if (!Byte4_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TM1_2_T_ACN_Encode(const TM1_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.params);/* Encode packetId (DataView.TM1-2-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-2-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } /* Encode code (DataView.TM1-2-T.code) ENUMERATED*/ switch(pVal->code) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM1_2_T_code_unknown_enumeration_value; return FALSE; } /* Encode params (DataView.TM1-2-T.params) OCTET STRING*/ if (pVal->exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1]); } } return TRUE; } flag TM1_2_T_ACN_Decode(TM1_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM1-2-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-2-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM1-2-T.code) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->code = invalidPacketID; break; case 1: pVal->code = invalidPacketSequenceControl; break; case 2: pVal->code = invalidPacketLength; break; case 3: pVal->code = invalidDfhInfo; break; case 4: pVal->code = invalidServiceType; break; case 5: pVal->code = invalidServiceSubtype; break; case 6: pVal->code = invalidSourceID; break; default: *pErrCode = ERR_TM1_2_T_code_unknown_enumeration_value; return FALSE; } /* Decode params (DataView.TM1-2-T.params) OCTET STRING*/ pVal->exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TM1_3_T_Initialize(TM1_3_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); } flag TM1_3_T_IsConstraintValid(const TM1_3_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_3_T_Encode(const TM1_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM1_3_T_Decode(TM1_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM1_3_T_ACN_Encode(const TM1_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetId (DataView.TM1-3-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-3-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } return TRUE; } flag TM1_3_T_ACN_Decode(TM1_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode packetId (DataView.TM1-3-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-3-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TM1_4_T_Initialize(TM1_4_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); Byte2_T_Initialize(&pVal->code); Byte4_T_Initialize(&pVal->params); } flag TM1_4_T_IsConstraintValid(const TM1_4_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->code, pErrCode)) return FALSE; if (pVal->exist.params) { if ( !Byte4_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_4_T_Encode(const TM1_4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.params); if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->code, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.params) { if (!Byte4_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TM1_4_T_Decode(TM1_4_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; /*Decode code (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->code, pBitStrm, pErrCode)) return FALSE; /*Decode params (Byte4-T)*/ pVal->exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.params = 1; if (!Byte4_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TM1_4_T_ACN_Encode(const TM1_4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.params);/* Encode packetId (DataView.TM1-4-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-4-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } /* Encode code (DataView.TM1-4-T.code) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->code.arr[i1]); } /* Encode params (DataView.TM1-4-T.params) OCTET STRING*/ if (pVal->exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1]); } } return TRUE; } flag TM1_4_T_ACN_Decode(TM1_4_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM1-4-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-4-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM1-4-T.code) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TM1-4-T.params) OCTET STRING*/ pVal->exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TM1_5_T_Initialize(TM1_5_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); Byte2_T_Initialize(&pVal->stepNumber); } flag TM1_5_T_IsConstraintValid(const TM1_5_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->stepNumber, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_5_T_Encode(const TM1_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->stepNumber, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM1_5_T_Decode(TM1_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; /*Decode stepNumber (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->stepNumber, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM1_5_T_ACN_Encode(const TM1_5_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_5_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetId (DataView.TM1-5-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-5-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM1-5-T.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->stepNumber.arr[i1]); } return TRUE; } flag TM1_5_T_ACN_Decode(TM1_5_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode packetId (DataView.TM1-5-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-5-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM1-5-T.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TM1_6_T_Initialize(TM1_6_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); Byte2_T_Initialize(&pVal->stepNumber); Byte2_T_Initialize(&pVal->code); Byte4_T_Initialize(&pVal->params); } flag TM1_6_T_IsConstraintValid(const TM1_6_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->stepNumber, pErrCode)) return FALSE; if (pVal->exist.code) { if ( !Byte2_T_IsConstraintValid(&pVal->code, pErrCode)) return FALSE; } if (pVal->exist.params) { if ( !Byte4_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_6_T_Encode(const TM1_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.code); BitStream_AppendBit(pBitStrm,pVal->exist.params); if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->stepNumber, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.code) { if (!Byte2_T_Encode(&pVal->code, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.params) { if (!Byte4_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TM1_6_T_Decode(TM1_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; /*Decode stepNumber (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->stepNumber, pBitStrm, pErrCode)) return FALSE; /*Decode code (Byte2-T)*/ pVal->exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.code = 1; if (!Byte2_T_Decode(&pVal->code, pBitStrm, pErrCode)) return FALSE; } /*Decode params (Byte4-T)*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; if (!Byte4_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TM1_6_T_ACN_Encode(const TM1_6_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_6_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.code); BitStream_AppendBit(pBitStrm,pVal->exist.params);/* Encode packetId (DataView.TM1-6-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-6-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM1-6-T.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->stepNumber.arr[i1]); } /* Encode code (DataView.TM1-6-T.code) OCTET STRING*/ if (pVal->exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->code.arr[i1]); } } /* Encode params (DataView.TM1-6-T.params) OCTET STRING*/ if (pVal->exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1]); } } return TRUE; } flag TM1_6_T_ACN_Decode(TM1_6_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM1-6-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-6-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM1-6-T.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM1-6-T.code) OCTET STRING*/ pVal->exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM1-6-T.params) OCTET STRING*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TM1_7_T_Initialize(TM1_7_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); } flag TM1_7_T_IsConstraintValid(const TM1_7_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_7_T_Encode(const TM1_7_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_7_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM1_7_T_Decode(TM1_7_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM1_7_T_ACN_Encode(const TM1_7_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_7_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetId (DataView.TM1-7-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-7-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } return TRUE; } flag TM1_7_T_ACN_Decode(TM1_7_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; /* Decode packetId (DataView.TM1-7-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-7-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TM1_8_T_Initialize(TM1_8_T* pVal) { Byte2_T_Initialize(&pVal->packetId); Byte2_T_Initialize(&pVal->packetSeqControl); Byte2_T_Initialize(&pVal->code); Byte4_T_Initialize(&pVal->params); } flag TM1_8_T_IsConstraintValid(const TM1_8_T* pVal, int* pErrCode) { if ( !Byte2_T_IsConstraintValid(&pVal->packetId, pErrCode)) return FALSE; if ( !Byte2_T_IsConstraintValid(&pVal->packetSeqControl, pErrCode)) return FALSE; if (pVal->exist.code) { if ( !Byte2_T_IsConstraintValid(&pVal->code, pErrCode)) return FALSE; } if (pVal->exist.params) { if ( !Byte4_T_IsConstraintValid(&pVal->params, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM1_8_T_Encode(const TM1_8_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_8_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.code); BitStream_AppendBit(pBitStrm,pVal->exist.params); if (!Byte2_T_Encode(&pVal->packetId, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte2_T_Encode(&pVal->packetSeqControl, pBitStrm, pErrCode, FALSE)) return FALSE; if (pVal->exist.code) { if (!Byte2_T_Encode(&pVal->code, pBitStrm, pErrCode, FALSE)) return FALSE; } if (pVal->exist.params) { if (!Byte4_T_Encode(&pVal->params, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TM1_8_T_Decode(TM1_8_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode packetId (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetId, pBitStrm, pErrCode)) return FALSE; /*Decode packetSeqControl (Byte2-T)*/ if (!Byte2_T_Decode(&pVal->packetSeqControl, pBitStrm, pErrCode)) return FALSE; /*Decode code (Byte2-T)*/ pVal->exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.code = 1; if (!Byte2_T_Decode(&pVal->code, pBitStrm, pErrCode)) return FALSE; } /*Decode params (Byte4-T)*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; if (!Byte4_T_Decode(&pVal->params, pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TM1_8_T_ACN_Encode(const TM1_8_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM1_8_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.code); BitStream_AppendBit(pBitStrm,pVal->exist.params);/* Encode packetId (DataView.TM1-8-T.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM1-8-T.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetSeqControl.arr[i1]); } /* Encode code (DataView.TM1-8-T.code) OCTET STRING*/ if (pVal->exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->code.arr[i1]); } } /* Encode params (DataView.TM1-8-T.params) OCTET STRING*/ if (pVal->exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->params.arr[i1]); } } return TRUE; } flag TM1_8_T_ACN_Decode(TM1_8_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM1-8-T.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM1-8-T.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM1-8-T.code) OCTET STRING*/ pVal->exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM1-8-T.params) OCTET STRING*/ pVal->exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } return TRUE; } void TM5_1_T_Initialize(TM5_1_T* pVal) { ErrorTypes_T_Initialize(&pVal->reportID); } flag TM5_1_T_IsConstraintValid(const TM5_1_T* pVal, int* pErrCode) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->reportID, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM5_1_T_Encode(const TM5_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!ErrorTypes_T_Encode(&pVal->reportID, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM5_1_T_Decode(TM5_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode reportID (ErrorTypes-T)*/ if (!ErrorTypes_T_Decode(&pVal->reportID, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM5_1_T_ACN_Encode(const TM5_1_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_1_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode reportID (DataView.TM5-1-T.reportID) ENUMERATED*/ switch(pVal->reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM5_1_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } flag TM5_1_T_ACN_Decode(TM5_1_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode reportID (DataView.TM5-1-T.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->reportID = segmentHeader; break; case 1: pVal->reportID = packetHeader; break; case 2: pVal->reportID = dataField; break; case 3: pVal->reportID = tc55RID; break; case 4: pVal->reportID = tc56RID; break; case 5: pVal->reportID = tc81CommandID; break; case 6: pVal->reportID = tc81Params; break; default: *pErrCode = ERR_TM5_1_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } void TM5_2_T_Initialize(TM5_2_T* pVal) { ErrorTypes_T_Initialize(&pVal->reportID); } flag TM5_2_T_IsConstraintValid(const TM5_2_T* pVal, int* pErrCode) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->reportID, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM5_2_T_Encode(const TM5_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!ErrorTypes_T_Encode(&pVal->reportID, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM5_2_T_Decode(TM5_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode reportID (ErrorTypes-T)*/ if (!ErrorTypes_T_Decode(&pVal->reportID, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM5_2_T_ACN_Encode(const TM5_2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode reportID (DataView.TM5-2-T.reportID) ENUMERATED*/ switch(pVal->reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM5_2_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } flag TM5_2_T_ACN_Decode(TM5_2_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode reportID (DataView.TM5-2-T.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->reportID = segmentHeader; break; case 1: pVal->reportID = packetHeader; break; case 2: pVal->reportID = dataField; break; case 3: pVal->reportID = tc55RID; break; case 4: pVal->reportID = tc56RID; break; case 5: pVal->reportID = tc81CommandID; break; case 6: pVal->reportID = tc81Params; break; default: *pErrCode = ERR_TM5_2_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } void TM5_3_T_Initialize(TM5_3_T* pVal) { ErrorTypes_T_Initialize(&pVal->reportID); } flag TM5_3_T_IsConstraintValid(const TM5_3_T* pVal, int* pErrCode) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->reportID, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM5_3_T_Encode(const TM5_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!ErrorTypes_T_Encode(&pVal->reportID, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM5_3_T_Decode(TM5_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode reportID (ErrorTypes-T)*/ if (!ErrorTypes_T_Decode(&pVal->reportID, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM5_3_T_ACN_Encode(const TM5_3_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_3_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode reportID (DataView.TM5-3-T.reportID) ENUMERATED*/ switch(pVal->reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM5_3_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } flag TM5_3_T_ACN_Decode(TM5_3_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode reportID (DataView.TM5-3-T.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->reportID = segmentHeader; break; case 1: pVal->reportID = packetHeader; break; case 2: pVal->reportID = dataField; break; case 3: pVal->reportID = tc55RID; break; case 4: pVal->reportID = tc56RID; break; case 5: pVal->reportID = tc81CommandID; break; case 6: pVal->reportID = tc81Params; break; default: *pErrCode = ERR_TM5_3_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } void TM5_4_T_Initialize(TM5_4_T* pVal) { ErrorTypes_T_Initialize(&pVal->reportID); } flag TM5_4_T_IsConstraintValid(const TM5_4_T* pVal, int* pErrCode) { if ( !ErrorTypes_T_IsConstraintValid(&pVal->reportID, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM5_4_T_Encode(const TM5_4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!ErrorTypes_T_Encode(&pVal->reportID, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM5_4_T_Decode(TM5_4_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /*Decode reportID (ErrorTypes-T)*/ if (!ErrorTypes_T_Decode(&pVal->reportID, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM5_4_T_ACN_Encode(const TM5_4_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { if (bCheckConstraints && !TM5_4_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode reportID (DataView.TM5-4-T.reportID) ENUMERATED*/ switch(pVal->reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM5_4_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } flag TM5_4_T_ACN_Decode(TM5_4_T* pVal, BitStream* pBitStrm, int* pErrCode) { asn1SccSint enumIndex = 0; /* Decode reportID (DataView.TM5-4-T.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->reportID = segmentHeader; break; case 1: pVal->reportID = packetHeader; break; case 2: pVal->reportID = dataField; break; case 3: pVal->reportID = tc55RID; break; case 4: pVal->reportID = tc56RID; break; case 5: pVal->reportID = tc81CommandID; break; case 6: pVal->reportID = tc81Params; break; default: *pErrCode = ERR_TM5_4_T_reportID_unknown_enumeration_value; return FALSE; } return TRUE; } void DFH2_T_Initialize(DFH2_T* pVal) { memcpy(pVal->serviceType.arr, .arr, ); } flag DFH2_T_IsConstraintValid(const DFH2_T* pVal, int* pErrCode) { if (pVal->exist.serviceType) { if ( !Byte1_T_IsConstraintValid(&pVal->serviceType, pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag DFH2_T_Encode(const DFH2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !DFH2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.serviceType); if (pVal->exist.serviceType) { if (!Byte1_T_Encode(&pVal->serviceType, pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag DFH2_T_Decode(DFH2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /*Decode serviceType (Byte1-T)*/ pVal->exist.serviceType = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.serviceType = 1; if (!Byte1_T_Decode(&pVal->serviceType, pBitStrm, pErrCode)) return FALSE; } else { pVal->exist.serviceType = 1; memcpy(pVal->serviceType.arr, .arr, ); } return TRUE; } flag DFH2_T_ACN_Encode(const DFH2_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !DFH2_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->exist.serviceType);/* Encode serviceType (DataView.DFH2-T.serviceType) OCTET STRING*/ if (pVal->exist.serviceType ) { for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->serviceType.arr[i1]); } } return TRUE; } flag DFH2_T_ACN_Decode(DFH2_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode serviceType (DataView.DFH2-T.serviceType) OCTET STRING*/ pVal->exist.serviceType = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->exist.serviceType = 1; nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } else { pVal->exist.serviceType = 1; memcpy(pVal->serviceType.arr, .arr, ); } return TRUE; } void Telecommand_T_Initialize(Telecommand_T* pVal) { pVal->kind = Telecommand_T_NONE; } flag Telecommand_T_IsConstraintValid(const Telecommand_T* pVal, int* pErrCode) { switch(pVal->kind) { case tc55_PRESENT: if ( !TC5_5_T_IsConstraintValid(&pVal->u.tc55, pErrCode)) return FALSE; break; case tc56_PRESENT: if ( !TC5_6_T_IsConstraintValid(&pVal->u.tc56, pErrCode)) return FALSE; break; case tc81_PRESENT: if ( !TC8_1_T_IsConstraintValid(&pVal->u.tc81, pErrCode)) return FALSE; break; case tc121_PRESENT: if ( !TC12_1_T_IsConstraintValid(&pVal->u.tc121, pErrCode)) return FALSE; break; case tc122_PRESENT: if ( !TC12_2_T_IsConstraintValid(&pVal->u.tc122, pErrCode)) return FALSE; break; case tc123_PRESENT: if ( !TC12_3_T_IsConstraintValid(&pVal->u.tc123, pErrCode)) return FALSE; break; case tc125_PRESENT: if ( !TC12_5_T_IsConstraintValid(&pVal->u.tc125, pErrCode)) return FALSE; break; case tc126_PRESENT: if ( !TC12_6_T_IsConstraintValid(&pVal->u.tc126, pErrCode)) return FALSE; break; case tc1210_PRESENT: if ( !TC12_10_T_IsConstraintValid(&pVal->u.tc1210, pErrCode)) return FALSE; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Telecommand_T_Encode(const Telecommand_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !Telecommand_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); if (!TC5_5_T_Encode(&pVal->u.tc55, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); if (!TC5_6_T_Encode(&pVal->u.tc56, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); if (!TC8_1_T_Encode(&pVal->u.tc81, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); if (!TC12_1_T_Encode(&pVal->u.tc121, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); if (!TC12_2_T_Encode(&pVal->u.tc122, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); if (!TC12_3_T_Encode(&pVal->u.tc123, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); if (!TC12_5_T_Encode(&pVal->u.tc125, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); if (!TC12_6_T_Encode(&pVal->u.tc126, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); if (!TC12_10_T_Encode(&pVal->u.tc1210, pBitStrm, pErrCode, FALSE)) return FALSE; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telecommand_T_Decode(Telecommand_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: if (!TC5_5_T_Decode(&pVal->u.tc55, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc55_PRESENT; break; case 1: if (!TC5_6_T_Decode(&pVal->u.tc56, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc56_PRESENT; break; case 2: if (!TC8_1_T_Decode(&pVal->u.tc81, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc81_PRESENT; break; case 3: if (!TC12_1_T_Decode(&pVal->u.tc121, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc121_PRESENT; break; case 4: if (!TC12_2_T_Decode(&pVal->u.tc122, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc122_PRESENT; break; case 5: if (!TC12_3_T_Decode(&pVal->u.tc123, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc123_PRESENT; break; case 6: if (!TC12_5_T_Decode(&pVal->u.tc125, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc125_PRESENT; break; case 7: if (!TC12_6_T_Decode(&pVal->u.tc126, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc126_PRESENT; break; case 8: if (!TC12_10_T_Decode(&pVal->u.tc1210, pBitStrm, pErrCode)) return FALSE; pVal->kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telecommand_T_ACN_Encode(const Telecommand_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !Telecommand_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->u.tc55.exist.rid);/* Encode numberRIDS (DataView.Telecommand-T.tc55.numberRIDS) OCTET STRING*/ if (pVal->u.tc55.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc55.numberRIDS.arr[i1]); } } /* Encode rid (DataView.Telecommand-T.tc55.rid) SEQUENCE OF*/ if (pVal->u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->u.tc55.rid.nCount, 3);for(i1=0;i1<pVal->u.tc55.rid.nCount;i1++) { switch(pVal->u.tc55.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telecommand_T_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->u.tc56.exist.rid);/* Encode numberRIDS (DataView.Telecommand-T.tc56.numberRIDS) OCTET STRING*/ if (pVal->u.tc56.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc56.numberRIDS.arr[i1]); } } /* Encode rid (DataView.Telecommand-T.tc56.rid) SEQUENCE OF*/ if (pVal->u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->u.tc56.rid.nCount, 3);for(i1=0;i1<pVal->u.tc56.rid.nCount;i1++) { switch(pVal->u.tc56.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telecommand_T_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->u.tc81.exist.params);/* Encode functionId (DataView.Telecommand-T.tc81.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc81.functionId.arr[i1]); } /* Encode numberParams (DataView.Telecommand-T.tc81.numberParams) OCTET STRING*/ if (pVal->u.tc81.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc81.numberParams.arr[i1]); } } /* Encode params (DataView.Telecommand-T.tc81.params) SEQUENCE OF*/ if (pVal->u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->u.tc81.params.nCount, 3);for(i1=0;i1<pVal->u.tc81.params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc81.params.arr[i1].exist.paramValue);/* Encode paramID (DataView.Telecommand-T.tc81.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc81.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.Telecommand-T.tc81.params..paramValue) OCTET STRING*/ if (pVal->u.tc81.params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc81.params.arr[i1].paramValue.arr[i2]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->u.tc121.exist.paramID);/* Encode numberParams (DataView.Telecommand-T.tc121.numberParams) OCTET STRING*/ if (pVal->u.tc121.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc121.numberParams.arr[i1]); } } /* Encode paramID (DataView.Telecommand-T.tc121.paramID) SEQUENCE OF*/ if (pVal->u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->u.tc121.paramID.nCount, 3);for(i1=0;i1<pVal->u.tc121.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc121.paramID.arr[i1].arr[i2]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->u.tc122.exist.paramID);/* Encode numberParams (DataView.Telecommand-T.tc122.numberParams) OCTET STRING*/ if (pVal->u.tc122.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc122.numberParams.arr[i1]); } } /* Encode paramID (DataView.Telecommand-T.tc122.paramID) SEQUENCE OF*/ if (pVal->u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->u.tc122.paramID.nCount, 3);for(i1=0;i1<pVal->u.tc122.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc122.paramID.arr[i1].arr[i2]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.Telecommand-T.tc123.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc123.maxReportingDelay.arr[i1]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.Telecommand-T.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->u.tc125.exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.Telecommand-T.tc125.valueRep) OCTET STRING*/ if (pVal->u.tc125.exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.valueRep.arr[i1]); } } /* Encode deltaRep (DataView.Telecommand-T.tc125.deltaRep) OCTET STRING*/ if (pVal->u.tc125.exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.deltaRep.arr[i1]); } } /* Encode numberParam (DataView.Telecommand-T.tc125.numberParam) OCTET STRING*/ if (pVal->u.tc125.exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.numberParam.arr[i1]); } } /* Encode paramID (DataView.Telecommand-T.tc125.paramID) SEQUENCE OF*/ if (pVal->u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->u.tc125.paramID.nCount, 1);for(i1=0;i1<pVal->u.tc125.paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.Telecommand-T.tc125.paramID..nol) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.Telecommand-T.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->u.tc125.paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.Telecommand-T.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.Telecommand-T.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.Telecommand-T.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.Telecommand-T.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.Telecommand-T.tc125.paramID..nod) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.Telecommand-T.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->u.tc125.paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.Telecommand-T.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.Telecommand-T.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.Telecommand-T.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.Telecommand-T.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.Telecommand-T.tc125.paramID..noe) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.Telecommand-T.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->u.tc125.paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->u.tc125.paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.Telecommand-T.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.Telecommand-T.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->u.tc126.exist.paramID);/* Encode numberParams (DataView.Telecommand-T.tc126.numberParams) OCTET STRING*/ if (pVal->u.tc126.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc126.numberParams.arr[i1]); } } /* Encode paramID (DataView.Telecommand-T.tc126.paramID) SEQUENCE OF*/ if (pVal->u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->u.tc126.paramID.nCount, 3);for(i1=0;i1<pVal->u.tc126.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc126.paramID.arr[i1].arr[i2]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.Telecommand-T.tc1210.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.numberParams.arr[i1]); } /* Encode params (DataView.Telecommand-T.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->u.tc1210.params.nCount, 3);for(i1=0;i1<pVal->u.tc1210.params.nCount;i1++) { /* Encode paramID (DataView.Telecommand-T.tc1210.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.Telecommand-T.tc1210.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.Telecommand-T.tc1210.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.Telecommand-T.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.Telecommand-T.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.Telecommand-T.tc1210.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->u.tc1210.params.arr[i1].transitionTime.arr[i2]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telecommand_T_ACN_Decode(Telecommand_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.Telecommand-T.tc55.numberRIDS) OCTET STRING*/ pVal->u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc55.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc55.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.Telecommand-T.tc55.rid) SEQUENCE OF*/ pVal->u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc55.rid.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc55.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tc55.rid.arr[i1] = segmentHeader; break; case 1: pVal->u.tc55.rid.arr[i1] = packetHeader; break; case 2: pVal->u.tc55.rid.arr[i1] = dataField; break; case 3: pVal->u.tc55.rid.arr[i1] = tc55RID; break; case 4: pVal->u.tc55.rid.arr[i1] = tc56RID; break; case 5: pVal->u.tc55.rid.arr[i1] = tc81CommandID; break; case 6: pVal->u.tc55.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_Telecommand_T_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.Telecommand-T.tc56.numberRIDS) OCTET STRING*/ pVal->u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc56.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc56.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.Telecommand-T.tc56.rid) SEQUENCE OF*/ pVal->u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc56.rid.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc56.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tc56.rid.arr[i1] = segmentHeader; break; case 1: pVal->u.tc56.rid.arr[i1] = packetHeader; break; case 2: pVal->u.tc56.rid.arr[i1] = dataField; break; case 3: pVal->u.tc56.rid.arr[i1] = tc55RID; break; case 4: pVal->u.tc56.rid.arr[i1] = tc56RID; break; case 5: pVal->u.tc56.rid.arr[i1] = tc81CommandID; break; case 6: pVal->u.tc56.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_Telecommand_T_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.Telecommand-T.tc81.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc81.functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.Telecommand-T.tc81.numberParams) OCTET STRING*/ pVal->u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc81.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc81.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.Telecommand-T.tc81.params) SEQUENCE OF*/ pVal->u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc81.params.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc81.params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.Telecommand-T.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc81.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.Telecommand-T.tc81.params..paramValue) OCTET STRING*/ pVal->u.tc81.params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc81.params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc81.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.Telecommand-T.tc121.numberParams) OCTET STRING*/ pVal->u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc121.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc121.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.Telecommand-T.tc121.paramID) SEQUENCE OF*/ pVal->u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc121.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc121.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc121.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.Telecommand-T.tc122.numberParams) OCTET STRING*/ pVal->u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc122.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc122.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.Telecommand-T.tc122.paramID) SEQUENCE OF*/ pVal->u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc122.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc122.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc122.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.Telecommand-T.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc123.maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.Telecommand-T.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.Telecommand-T.tc125.valueRep) OCTET STRING*/ pVal->u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc125.exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.Telecommand-T.tc125.deltaRep) OCTET STRING*/ pVal->u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->u.tc125.exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.Telecommand-T.tc125.numberParam) OCTET STRING*/ pVal->u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->u.tc125.exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.Telecommand-T.tc125.paramID) SEQUENCE OF*/ pVal->u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->u.tc125.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc125.paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.Telecommand-T.tc125.paramID..nol) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.Telecommand-T.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->u.tc125.paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc125.paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.Telecommand-T.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.Telecommand-T.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.Telecommand-T.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.Telecommand-T.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.Telecommand-T.tc125.paramID..nod) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.Telecommand-T.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->u.tc125.paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc125.paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.Telecommand-T.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.Telecommand-T.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.Telecommand-T.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.Telecommand-T.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.Telecommand-T.tc125.paramID..noe) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.Telecommand-T.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->u.tc125.paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->u.tc125.paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc125.paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.Telecommand-T.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.Telecommand-T.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.Telecommand-T.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.Telecommand-T.tc126.numberParams) OCTET STRING*/ pVal->u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tc126.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc126.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.Telecommand-T.tc126.paramID) SEQUENCE OF*/ pVal->u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc126.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc126.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc126.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.Telecommand-T.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.Telecommand-T.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->u.tc1210.params.nCount = (long)nCount; for(i1=0;i1<pVal->u.tc1210.params.nCount;i1++) { /* Decode paramID (DataView.Telecommand-T.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.Telecommand-T.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.Telecommand-T.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.Telecommand-T.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.Telecommand-T.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.Telecommand-T.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tc1210.params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } void DF_T_Initialize(DF_T* pVal) { TCID_T_Initialize(&pVal->key); Telecommand_T_Initialize(&pVal->telecommand); } flag DF_T_IsConstraintValid(const DF_T* pVal, int* pErrCode) { if ( !TCID_T_IsConstraintValid(&pVal->key, pErrCode)) return FALSE; if ( !Telecommand_T_IsConstraintValid(&pVal->telecommand, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag DF_T_Encode(const DF_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !DF_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!TCID_T_Encode(&pVal->key, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Telecommand_T_Encode(&pVal->telecommand, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag DF_T_Decode(DF_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode key (TCID-T)*/ if (!TCID_T_Decode(&pVal->key, pBitStrm, pErrCode)) return FALSE; /*Decode telecommand (Telecommand-T)*/ if (!Telecommand_T_Decode(&pVal->telecommand, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag DF_T_ACN_Encode(const DF_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !DF_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode key (DataView.DF-T.key) ENUMERATED*/ switch(pVal->key) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_DF_T_key_unknown_enumeration_value; return FALSE; } /* Encode telecommand (DataView.DF-T.telecommand) CHOICE*/ switch(pVal->telecommand.kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc55.exist.rid);/* Encode numberRIDS (DataView.DF-T.telecommand.tc55.numberRIDS) OCTET STRING*/ if (pVal->telecommand.u.tc55.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc55.numberRIDS.arr[i1]); } } /* Encode rid (DataView.DF-T.telecommand.tc55.rid) SEQUENCE OF*/ if (pVal->telecommand.u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc55.rid.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc55.rid.nCount;i1++) { switch(pVal->telecommand.u.tc55.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_DF_T_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc56.exist.rid);/* Encode numberRIDS (DataView.DF-T.telecommand.tc56.numberRIDS) OCTET STRING*/ if (pVal->telecommand.u.tc56.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc56.numberRIDS.arr[i1]); } } /* Encode rid (DataView.DF-T.telecommand.tc56.rid) SEQUENCE OF*/ if (pVal->telecommand.u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc56.rid.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc56.rid.nCount;i1++) { switch(pVal->telecommand.u.tc56.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_DF_T_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc81.exist.params);/* Encode functionId (DataView.DF-T.telecommand.tc81.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc81.functionId.arr[i1]); } /* Encode numberParams (DataView.DF-T.telecommand.tc81.numberParams) OCTET STRING*/ if (pVal->telecommand.u.tc81.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc81.numberParams.arr[i1]); } } /* Encode params (DataView.DF-T.telecommand.tc81.params) SEQUENCE OF*/ if (pVal->telecommand.u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc81.params.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc81.params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc81.params.arr[i1].exist.paramValue);/* Encode paramID (DataView.DF-T.telecommand.tc81.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc81.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.DF-T.telecommand.tc81.params..paramValue) OCTET STRING*/ if (pVal->telecommand.u.tc81.params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc81.params.arr[i1].paramValue.arr[i2]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc121.exist.paramID);/* Encode numberParams (DataView.DF-T.telecommand.tc121.numberParams) OCTET STRING*/ if (pVal->telecommand.u.tc121.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc121.numberParams.arr[i1]); } } /* Encode paramID (DataView.DF-T.telecommand.tc121.paramID) SEQUENCE OF*/ if (pVal->telecommand.u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc121.paramID.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc121.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc121.paramID.arr[i1].arr[i2]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc122.exist.paramID);/* Encode numberParams (DataView.DF-T.telecommand.tc122.numberParams) OCTET STRING*/ if (pVal->telecommand.u.tc122.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc122.numberParams.arr[i1]); } } /* Encode paramID (DataView.DF-T.telecommand.tc122.paramID) SEQUENCE OF*/ if (pVal->telecommand.u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc122.paramID.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc122.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc122.paramID.arr[i1].arr[i2]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.DF-T.telecommand.tc123.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc123.maxReportingDelay.arr[i1]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.DF-T.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->telecommand.u.tc125.exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.DF-T.telecommand.tc125.valueRep) OCTET STRING*/ if (pVal->telecommand.u.tc125.exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.valueRep.arr[i1]); } } /* Encode deltaRep (DataView.DF-T.telecommand.tc125.deltaRep) OCTET STRING*/ if (pVal->telecommand.u.tc125.exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.deltaRep.arr[i1]); } } /* Encode numberParam (DataView.DF-T.telecommand.tc125.numberParam) OCTET STRING*/ if (pVal->telecommand.u.tc125.exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.numberParam.arr[i1]); } } /* Encode paramID (DataView.DF-T.telecommand.tc125.paramID) SEQUENCE OF*/ if (pVal->telecommand.u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc125.paramID.nCount, 1);for(i1=0;i1<pVal->telecommand.u.tc125.paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.DF-T.telecommand.tc125.paramID..nol) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.DF-T.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.DF-T.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.DF-T.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.DF-T.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.DF-T.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.DF-T.telecommand.tc125.paramID..nod) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.DF-T.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.DF-T.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.DF-T.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.DF-T.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.DF-T.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.DF-T.telecommand.tc125.paramID..noe) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.DF-T.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.DF-T.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.DF-T.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->telecommand.u.tc126.exist.paramID);/* Encode numberParams (DataView.DF-T.telecommand.tc126.numberParams) OCTET STRING*/ if (pVal->telecommand.u.tc126.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc126.numberParams.arr[i1]); } } /* Encode paramID (DataView.DF-T.telecommand.tc126.paramID) SEQUENCE OF*/ if (pVal->telecommand.u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc126.paramID.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc126.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc126.paramID.arr[i1].arr[i2]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.DF-T.telecommand.tc1210.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.numberParams.arr[i1]); } /* Encode params (DataView.DF-T.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->telecommand.u.tc1210.params.nCount, 3);for(i1=0;i1<pVal->telecommand.u.tc1210.params.nCount;i1++) { /* Encode paramID (DataView.DF-T.telecommand.tc1210.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.DF-T.telecommand.tc1210.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.DF-T.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.DF-T.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.DF-T.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.DF-T.telecommand.tc1210.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag DF_T_ACN_Decode(DF_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode key (DataView.DF-T.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->key = tc55; break; case 1: pVal->key = tc56; break; case 2: pVal->key = tc81; break; case 3: pVal->key = tc121; break; case 4: pVal->key = tc122; break; case 5: pVal->key = tc123; break; case 6: pVal->key = tc125; break; case 7: pVal->key = tc126; break; case 8: pVal->key = tc1210; break; default: *pErrCode = ERR_DF_T_key_unknown_enumeration_value; return FALSE; } /* Decode telecommand (DataView.DF-T.telecommand) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.DF-T.telecommand.tc55.numberRIDS) OCTET STRING*/ pVal->telecommand.u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc55.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc55.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.DF-T.telecommand.tc55.rid) SEQUENCE OF*/ pVal->telecommand.u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc55.rid.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc55.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telecommand.u.tc55.rid.arr[i1] = segmentHeader; break; case 1: pVal->telecommand.u.tc55.rid.arr[i1] = packetHeader; break; case 2: pVal->telecommand.u.tc55.rid.arr[i1] = dataField; break; case 3: pVal->telecommand.u.tc55.rid.arr[i1] = tc55RID; break; case 4: pVal->telecommand.u.tc55.rid.arr[i1] = tc56RID; break; case 5: pVal->telecommand.u.tc55.rid.arr[i1] = tc81CommandID; break; case 6: pVal->telecommand.u.tc55.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_DF_T_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->telecommand.kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.DF-T.telecommand.tc56.numberRIDS) OCTET STRING*/ pVal->telecommand.u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc56.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc56.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.DF-T.telecommand.tc56.rid) SEQUENCE OF*/ pVal->telecommand.u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc56.rid.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc56.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telecommand.u.tc56.rid.arr[i1] = segmentHeader; break; case 1: pVal->telecommand.u.tc56.rid.arr[i1] = packetHeader; break; case 2: pVal->telecommand.u.tc56.rid.arr[i1] = dataField; break; case 3: pVal->telecommand.u.tc56.rid.arr[i1] = tc55RID; break; case 4: pVal->telecommand.u.tc56.rid.arr[i1] = tc56RID; break; case 5: pVal->telecommand.u.tc56.rid.arr[i1] = tc81CommandID; break; case 6: pVal->telecommand.u.tc56.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_DF_T_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->telecommand.kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.DF-T.telecommand.tc81.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc81.functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.DF-T.telecommand.tc81.numberParams) OCTET STRING*/ pVal->telecommand.u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc81.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc81.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.DF-T.telecommand.tc81.params) SEQUENCE OF*/ pVal->telecommand.u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc81.params.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc81.params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.DF-T.telecommand.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc81.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.DF-T.telecommand.tc81.params..paramValue) OCTET STRING*/ pVal->telecommand.u.tc81.params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc81.params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc81.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->telecommand.kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.DF-T.telecommand.tc121.numberParams) OCTET STRING*/ pVal->telecommand.u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc121.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc121.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.DF-T.telecommand.tc121.paramID) SEQUENCE OF*/ pVal->telecommand.u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc121.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc121.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc121.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->telecommand.kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.DF-T.telecommand.tc122.numberParams) OCTET STRING*/ pVal->telecommand.u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc122.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc122.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.DF-T.telecommand.tc122.paramID) SEQUENCE OF*/ pVal->telecommand.u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc122.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc122.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc122.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->telecommand.kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.DF-T.telecommand.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc123.maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->telecommand.kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.DF-T.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->telecommand.u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.DF-T.telecommand.tc125.valueRep) OCTET STRING*/ pVal->telecommand.u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc125.exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.DF-T.telecommand.tc125.deltaRep) OCTET STRING*/ pVal->telecommand.u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->telecommand.u.tc125.exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.DF-T.telecommand.tc125.numberParam) OCTET STRING*/ pVal->telecommand.u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->telecommand.u.tc125.exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.DF-T.telecommand.tc125.paramID) SEQUENCE OF*/ pVal->telecommand.u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->telecommand.u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->telecommand.u.tc125.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc125.paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.DF-T.telecommand.tc125.paramID..nol) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.DF-T.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.DF-T.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.DF-T.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.DF-T.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.DF-T.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.DF-T.telecommand.tc125.paramID..nod) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.DF-T.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.DF-T.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.DF-T.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.DF-T.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.DF-T.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.DF-T.telecommand.tc125.paramID..noe) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.DF-T.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.DF-T.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.DF-T.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.DF-T.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->telecommand.kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.DF-T.telecommand.tc126.numberParams) OCTET STRING*/ pVal->telecommand.u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telecommand.u.tc126.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc126.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.DF-T.telecommand.tc126.paramID) SEQUENCE OF*/ pVal->telecommand.u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telecommand.u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc126.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc126.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc126.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->telecommand.kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.DF-T.telecommand.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.DF-T.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->telecommand.u.tc1210.params.nCount = (long)nCount; for(i1=0;i1<pVal->telecommand.u.tc1210.params.nCount;i1++) { /* Decode paramID (DataView.DF-T.telecommand.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.DF-T.telecommand.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.DF-T.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.DF-T.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.DF-T.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.DF-T.telecommand.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->telecommand.kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } void TC_T_Initialize(TC_T* pVal) { PH_T_Initialize(&pVal->packetHeader); DFH_T_Initialize(&pVal->dataFieldHeader); DF_T_Initialize(&pVal->dataField); } flag TC_T_IsConstraintValid(const TC_T* pVal, int* pErrCode) { if ( !PH_T_IsConstraintValid(&pVal->packetHeader, pErrCode)) return FALSE; if ( !DFH_T_IsConstraintValid(&pVal->dataFieldHeader, pErrCode)) return FALSE; if ( !DF_T_IsConstraintValid(&pVal->dataField, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TC_T_Encode(const TC_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TC_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!PH_T_Encode(&pVal->packetHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!DFH_T_Encode(&pVal->dataFieldHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!DF_T_Encode(&pVal->dataField, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TC_T_Decode(TC_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode packetHeader (PH-T)*/ if (!PH_T_Decode(&pVal->packetHeader, pBitStrm, pErrCode)) return FALSE; /*Decode dataFieldHeader (DFH-T)*/ if (!DFH_T_Decode(&pVal->dataFieldHeader, pBitStrm, pErrCode)) return FALSE; /*Decode dataField (DF-T)*/ if (!DF_T_Decode(&pVal->dataField, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TC_T_ACN_Encode(const TC_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TC_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetHeader (DataView.TC-T.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TC-T.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TC-T.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TC-T.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TC-T.dataFieldHeader) SEQUENCE*/ /* Encode dfhInfo (DataView.TC-T.dataFieldHeader.dfhInfo) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.dfhInfo.arr[i1]); } /* Encode serviceType (DataView.TC-T.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TC-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode sourceID (DataView.TC-T.dataFieldHeader.sourceID) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.sourceID.arr[i1]); } /* Encode dataField (DataView.TC-T.dataField) SEQUENCE*/ /* Encode key (DataView.TC-T.dataField.key) ENUMERATED*/ switch(pVal->dataField.key) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_TC_T_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telecommand (DataView.TC-T.dataField.telecommand) CHOICE*/ switch(pVal->dataField.telecommand.kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc55.exist.rid);/* Encode numberRIDS (DataView.TC-T.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc55.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc55.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TC-T.dataField.telecommand.tc55.rid) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc55.rid.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc55.rid.nCount;i1++) { switch(pVal->dataField.telecommand.u.tc55.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TC_T_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc56.exist.rid);/* Encode numberRIDS (DataView.TC-T.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc56.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc56.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TC-T.dataField.telecommand.tc56.rid) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc56.rid.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc56.rid.nCount;i1++) { switch(pVal->dataField.telecommand.u.tc56.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TC_T_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc81.exist.params);/* Encode functionId (DataView.TC-T.dataField.telecommand.tc81.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc81.functionId.arr[i1]); } /* Encode numberParams (DataView.TC-T.dataField.telecommand.tc81.numberParams) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc81.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc81.numberParams.arr[i1]); } } /* Encode params (DataView.TC-T.dataField.telecommand.tc81.params) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc81.params.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc81.params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue);/* Encode paramID (DataView.TC-T.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TC-T.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc121.exist.paramID);/* Encode numberParams (DataView.TC-T.dataField.telecommand.tc121.numberParams) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc121.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc121.numberParams.arr[i1]); } } /* Encode paramID (DataView.TC-T.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc121.paramID.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc121.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc122.exist.paramID);/* Encode numberParams (DataView.TC-T.dataField.telecommand.tc122.numberParams) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc122.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc122.numberParams.arr[i1]); } } /* Encode paramID (DataView.TC-T.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc122.paramID.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc122.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.TC-T.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc123.maxReportingDelay.arr[i1]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.TC-T.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.TC-T.dataField.telecommand.tc125.valueRep) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.valueRep.arr[i1]); } } /* Encode deltaRep (DataView.TC-T.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.deltaRep.arr[i1]); } } /* Encode numberParam (DataView.TC-T.dataField.telecommand.tc125.numberParam) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.numberParam.arr[i1]); } } /* Encode paramID (DataView.TC-T.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.nCount, 1);for(i1=0;i1<pVal->dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.TC-T.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.TC-T.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.TC-T.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->dataField.telecommand.u.tc126.exist.paramID);/* Encode numberParams (DataView.TC-T.dataField.telecommand.tc126.numberParams) OCTET STRING*/ if (pVal->dataField.telecommand.u.tc126.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc126.numberParams.arr[i1]); } } /* Encode paramID (DataView.TC-T.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ if (pVal->dataField.telecommand.u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc126.paramID.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc126.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.TC-T.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.numberParams.arr[i1]); } /* Encode params (DataView.TC-T.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.nCount, 3);for(i1=0;i1<pVal->dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Encode paramID (DataView.TC-T.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TC-T.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.TC-T.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.TC-T.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.TC-T.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.TC-T.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag TC_T_ACN_Decode(TC_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode packetHeader (DataView.TC-T.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TC-T.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TC-T.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TC-T.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TC-T.dataFieldHeader) SEQUENCE*/ /* Decode dfhInfo (DataView.TC-T.dataFieldHeader.dfhInfo) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.dfhInfo.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TC-T.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TC-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.TC-T.dataFieldHeader.sourceID) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.sourceID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TC-T.dataField) SEQUENCE*/ /* Decode key (DataView.TC-T.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.key = tc55; break; case 1: pVal->dataField.key = tc56; break; case 2: pVal->dataField.key = tc81; break; case 3: pVal->dataField.key = tc121; break; case 4: pVal->dataField.key = tc122; break; case 5: pVal->dataField.key = tc123; break; case 6: pVal->dataField.key = tc125; break; case 7: pVal->dataField.key = tc126; break; case 8: pVal->dataField.key = tc1210; break; default: *pErrCode = ERR_TC_T_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telecommand (DataView.TC-T.dataField.telecommand) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TC-T.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ pVal->dataField.telecommand.u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc55.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc55.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TC-T.dataField.telecommand.tc55.rid) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc55.rid.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc55.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = segmentHeader; break; case 1: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = packetHeader; break; case 2: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = dataField; break; case 3: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = tc55RID; break; case 4: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = tc56RID; break; case 5: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = tc81CommandID; break; case 6: pVal->dataField.telecommand.u.tc55.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TC_T_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->dataField.telecommand.kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TC-T.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ pVal->dataField.telecommand.u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc56.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc56.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TC-T.dataField.telecommand.tc56.rid) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc56.rid.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc56.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = segmentHeader; break; case 1: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = packetHeader; break; case 2: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = dataField; break; case 3: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = tc55RID; break; case 4: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = tc56RID; break; case 5: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = tc81CommandID; break; case 6: pVal->dataField.telecommand.u.tc56.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TC_T_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->dataField.telecommand.kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.TC-T.dataField.telecommand.tc81.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc81.functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.TC-T.dataField.telecommand.tc81.numberParams) OCTET STRING*/ pVal->dataField.telecommand.u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc81.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc81.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TC-T.dataField.telecommand.tc81.params) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc81.params.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc81.params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.TC-T.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TC-T.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ pVal->dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->dataField.telecommand.kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC-T.dataField.telecommand.tc121.numberParams) OCTET STRING*/ pVal->dataField.telecommand.u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc121.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc121.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC-T.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc121.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc121.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->dataField.telecommand.kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC-T.dataField.telecommand.tc122.numberParams) OCTET STRING*/ pVal->dataField.telecommand.u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc122.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc122.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC-T.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc122.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc122.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->dataField.telecommand.kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.TC-T.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc123.maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->dataField.telecommand.kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.TC-T.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.TC-T.dataField.telecommand.tc125.valueRep) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc125.exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.TC-T.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->dataField.telecommand.u.tc125.exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.TC-T.dataField.telecommand.tc125.numberParam) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->dataField.telecommand.u.tc125.exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC-T.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->dataField.telecommand.u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->dataField.telecommand.u.tc125.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.TC-T.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TC-T.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.TC-T.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TC-T.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.TC-T.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.TC-T.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->dataField.telecommand.kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TC-T.dataField.telecommand.tc126.numberParams) OCTET STRING*/ pVal->dataField.telecommand.u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telecommand.u.tc126.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc126.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TC-T.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ pVal->dataField.telecommand.u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telecommand.u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc126.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc126.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->dataField.telecommand.kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.TC-T.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TC-T.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->dataField.telecommand.u.tc1210.params.nCount = (long)nCount; for(i1=0;i1<pVal->dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Decode paramID (DataView.TC-T.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TC-T.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.TC-T.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.TC-T.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.TC-T.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.TC-T.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->dataField.telecommand.kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } void TCSegment_T_Initialize(TCSegment_T* pVal) { Byte1_T_Initialize(&pVal->header); TC_T_Initialize(&pVal->tc); Byte24_T_Initialize(&pVal->tail); } flag TCSegment_T_IsConstraintValid(const TCSegment_T* pVal, int* pErrCode) { if ( !Byte1_T_IsConstraintValid(&pVal->header, pErrCode)) return FALSE; if ( !TC_T_IsConstraintValid(&pVal->tc, pErrCode)) return FALSE; if ( !Byte24_T_IsConstraintValid(&pVal->tail, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TCSegment_T_Encode(const TCSegment_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TCSegment_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!Byte1_T_Encode(&pVal->header, pBitStrm, pErrCode, FALSE)) return FALSE; if (!TC_T_Encode(&pVal->tc, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Byte24_T_Encode(&pVal->tail, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TCSegment_T_Decode(TCSegment_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode header (Byte1-T)*/ if (!Byte1_T_Decode(&pVal->header, pBitStrm, pErrCode)) return FALSE; /*Decode tc (TC-T)*/ if (!TC_T_Decode(&pVal->tc, pBitStrm, pErrCode)) return FALSE; /*Decode tail (Byte24-T)*/ if (!Byte24_T_Decode(&pVal->tail, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TCSegment_T_ACN_Encode(const TCSegment_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TCSegment_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode header (DataView.TCSegment-T.header) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->header.arr[i1]); } /* Encode tc (DataView.TCSegment-T.tc) SEQUENCE*/ /* Encode packetHeader (DataView.TCSegment-T.tc.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TCSegment-T.tc.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TCSegment-T.tc.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TCSegment-T.tc.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TCSegment-T.tc.dataFieldHeader) SEQUENCE*/ /* Encode dfhInfo (DataView.TCSegment-T.tc.dataFieldHeader.dfhInfo) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.dfhInfo.arr[i1]); } /* Encode serviceType (DataView.TCSegment-T.tc.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TCSegment-T.tc.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode sourceID (DataView.TCSegment-T.tc.dataFieldHeader.sourceID) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.sourceID.arr[i1]); } /* Encode dataField (DataView.TCSegment-T.tc.dataField) SEQUENCE*/ /* Encode key (DataView.TCSegment-T.tc.dataField.key) ENUMERATED*/ switch(pVal->tc.dataField.key) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telecommand (DataView.TCSegment-T.tc.dataField.telecommand) CHOICE*/ switch(pVal->tc.dataField.telecommand.kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc55.exist.rid);/* Encode numberRIDS (DataView.TCSegment-T.tc.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc55.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc55.rid) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc55.rid.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc55.rid.nCount;i1++) { switch(pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc56.exist.rid);/* Encode numberRIDS (DataView.TCSegment-T.tc.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc56.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc56.rid) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc56.rid.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc56.rid.nCount;i1++) { switch(pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.exist.params);/* Encode functionId (DataView.TCSegment-T.tc.dataField.telecommand.tc81.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.functionId.arr[i1]); } /* Encode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc81.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc81.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.numberParams.arr[i1]); } } /* Encode params (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc81.params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue);/* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc121.exist.paramID);/* Encode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc121.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc121.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc121.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc122.exist.paramID);/* Encode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc122.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc122.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc122.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.TCSegment-T.tc.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc123.maxReportingDelay.arr[i1]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.TCSegment-T.tc.dataField.telecommand.tc125.valueRep) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.valueRep.arr[i1]); } } /* Encode deltaRep (DataView.TCSegment-T.tc.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.deltaRep.arr[i1]); } } /* Encode numberParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.numberParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.numberParam.arr[i1]); } } /* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.nCount, 1);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc126.exist.paramID);/* Encode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc126.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc126.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc126.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.numberParams.arr[i1]); } /* Encode params (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Encode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } /* Encode tail (DataView.TCSegment-T.tail) OCTET STRING*/ for(i1=0;i1<24;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tail.arr[i1]); } return TRUE; } flag TCSegment_T_ACN_Decode(TCSegment_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode header (DataView.TCSegment-T.header) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->header.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode tc (DataView.TCSegment-T.tc) SEQUENCE*/ /* Decode packetHeader (DataView.TCSegment-T.tc.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TCSegment-T.tc.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TCSegment-T.tc.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TCSegment-T.tc.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TCSegment-T.tc.dataFieldHeader) SEQUENCE*/ /* Decode dfhInfo (DataView.TCSegment-T.tc.dataFieldHeader.dfhInfo) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.dfhInfo.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TCSegment-T.tc.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TCSegment-T.tc.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.TCSegment-T.tc.dataFieldHeader.sourceID) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.sourceID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TCSegment-T.tc.dataField) SEQUENCE*/ /* Decode key (DataView.TCSegment-T.tc.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.key = tc55; break; case 1: pVal->tc.dataField.key = tc56; break; case 2: pVal->tc.dataField.key = tc81; break; case 3: pVal->tc.dataField.key = tc121; break; case 4: pVal->tc.dataField.key = tc122; break; case 5: pVal->tc.dataField.key = tc123; break; case 6: pVal->tc.dataField.key = tc125; break; case 7: pVal->tc.dataField.key = tc126; break; case 8: pVal->tc.dataField.key = tc1210; break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telecommand (DataView.TCSegment-T.tc.dataField.telecommand) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TCSegment-T.tc.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc55.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc55.rid) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc55.rid.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc55.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = segmentHeader; break; case 1: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = packetHeader; break; case 2: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = dataField; break; case 3: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc55RID; break; case 4: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc56RID; break; case 5: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc81CommandID; break; case 6: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TCSegment-T.tc.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc56.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc56.rid) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc56.rid.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc56.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = segmentHeader; break; case 1: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = packetHeader; break; case 2: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = dataField; break; case 3: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc55RID; break; case 4: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc56RID; break; case 5: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc81CommandID; break; case 6: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TCSegment_T_tc_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.TCSegment-T.tc.dataField.telecommand.tc81.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc81.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc81.params.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc81.params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TCSegment-T.tc.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->tc.dataField.telecommand.kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc121.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc121.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc121.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc121.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc121.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc122.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc122.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc122.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc122.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc122.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.TCSegment-T.tc.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc123.maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tc.dataField.telecommand.kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.TCSegment-T.tc.dataField.telecommand.tc125.valueRep) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.TCSegment-T.tc.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.numberParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->tc.dataField.telecommand.u.tc125.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.TCSegment-T.tc.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->tc.dataField.telecommand.kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc126.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc126.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc126.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc126.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc126.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc1210.params.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Decode paramID (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.TCSegment-T.tc.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } /* Decode tail (DataView.TCSegment-T.tail) OCTET STRING*/ nCount = 24; for(i1=0;i1<24;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tail.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } return TRUE; } void TCBlock_T_Initialize(TCBlock_T* pVal) { IfStandard_T_Initialize(&pVal->typeIF); TC_T_Initialize(&pVal->tc); } flag TCBlock_T_IsConstraintValid(const TCBlock_T* pVal, int* pErrCode) { if ( !IfStandard_T_IsConstraintValid(&pVal->typeIF, pErrCode)) return FALSE; if ( !TC_T_IsConstraintValid(&pVal->tc, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TCBlock_T_Encode(const TCBlock_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TCBlock_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!IfStandard_T_Encode(&pVal->typeIF, pBitStrm, pErrCode, FALSE)) return FALSE; if (!TC_T_Encode(&pVal->tc, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TCBlock_T_Decode(TCBlock_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode typeIF (IfStandard-T)*/ if (!IfStandard_T_Decode(&pVal->typeIF, pBitStrm, pErrCode)) return FALSE; /*Decode tc (TC-T)*/ if (!TC_T_Decode(&pVal->tc, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TCBlock_T_ACN_Encode(const TCBlock_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; if (bCheckConstraints && !TCBlock_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode typeIF (DataView.TCBlock-T.typeIF) ENUMERATED*/ switch(pVal->typeIF) { case native: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case pus: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_TCBlock_T_typeIF_unknown_enumeration_value; return FALSE; } /* Encode tc (DataView.TCBlock-T.tc) SEQUENCE*/ /* Encode packetHeader (DataView.TCBlock-T.tc.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TCBlock-T.tc.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TCBlock-T.tc.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TCBlock-T.tc.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TCBlock-T.tc.dataFieldHeader) SEQUENCE*/ /* Encode dfhInfo (DataView.TCBlock-T.tc.dataFieldHeader.dfhInfo) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.dfhInfo.arr[i1]); } /* Encode serviceType (DataView.TCBlock-T.tc.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TCBlock-T.tc.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode sourceID (DataView.TCBlock-T.tc.dataFieldHeader.sourceID) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataFieldHeader.sourceID.arr[i1]); } /* Encode dataField (DataView.TCBlock-T.tc.dataField) SEQUENCE*/ /* Encode key (DataView.TCBlock-T.tc.dataField.key) ENUMERATED*/ switch(pVal->tc.dataField.key) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telecommand (DataView.TCBlock-T.tc.dataField.telecommand) CHOICE*/ switch(pVal->tc.dataField.telecommand.kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc55.exist.rid);/* Encode numberRIDS (DataView.TCBlock-T.tc.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc55.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc55.rid) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc55.rid.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc55.rid.nCount;i1++) { switch(pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc56.exist.rid);/* Encode numberRIDS (DataView.TCBlock-T.tc.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc56.numberRIDS.arr[i1]); } } /* Encode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc56.rid) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc56.rid.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc56.rid.nCount;i1++) { switch(pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.exist.params);/* Encode functionId (DataView.TCBlock-T.tc.dataField.telecommand.tc81.functionId) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.functionId.arr[i1]); } /* Encode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc81.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc81.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.numberParams.arr[i1]); } } /* Encode params (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc81.params.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue);/* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc121.exist.paramID);/* Encode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc121.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc121.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc121.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc122.exist.paramID);/* Encode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc122.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc122.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc122.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.TCBlock-T.tc.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc123.maxReportingDelay.arr[i1]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1]); } } /* Encode valueRep (DataView.TCBlock-T.tc.dataField.telecommand.tc125.valueRep) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.valueRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.valueRep.arr[i1]); } } /* Encode deltaRep (DataView.TCBlock-T.tc.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.deltaRep.arr[i1]); } } /* Encode numberParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.numberParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.numberParam ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.numberParam.arr[i1]); } } /* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.nCount, 1);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq);/* Encode nol (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2]); } } /* Encode nolSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowLimit (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3]); } /* Encode ridLow (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highLimit (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3]); } /* Encode ridHigh (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode nod (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2]); } } /* Encode nodSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh);/* Encode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode lowDelta (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3]); } /* Encode ridLow (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3]); } } /* Encode highDelta (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3]); } /* Encode ridHigh (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3]); } } } } /* Encode noe (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2]); } } /* Encode noeSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount, 3);for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid);/* Encode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3]); } } /* Encode expectedValue (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3]); } /* Encode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->tc.dataField.telecommand.u.tc126.exist.paramID);/* Encode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc126.numberParams) OCTET STRING*/ if (pVal->tc.dataField.telecommand.u.tc126.exist.numberParams ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.numberParams.arr[i1]); } } /* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ if (pVal->tc.dataField.telecommand.u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.paramID.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc126.paramID.nCount;i1++) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.numberParams.arr[i1]); } /* Encode params (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.nCount, 3);for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Encode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2]); } /* Encode paramValue (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2]); } /* Encode limitCrossed (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2]); } /* Encode previousCheckingStatus (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2]); } /* Encode currentCheckingStatus (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2]); } /* Encode transitionTime (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } flag TCBlock_T_ACN_Decode(TCBlock_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode typeIF (DataView.TCBlock-T.typeIF) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->typeIF = native; break; case 1: pVal->typeIF = pus; break; default: *pErrCode = ERR_TCBlock_T_typeIF_unknown_enumeration_value; return FALSE; } /* Decode tc (DataView.TCBlock-T.tc) SEQUENCE*/ /* Decode packetHeader (DataView.TCBlock-T.tc.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TCBlock-T.tc.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TCBlock-T.tc.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TCBlock-T.tc.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TCBlock-T.tc.dataFieldHeader) SEQUENCE*/ /* Decode dfhInfo (DataView.TCBlock-T.tc.dataFieldHeader.dfhInfo) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.dfhInfo.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TCBlock-T.tc.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TCBlock-T.tc.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.TCBlock-T.tc.dataFieldHeader.sourceID) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataFieldHeader.sourceID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TCBlock-T.tc.dataField) SEQUENCE*/ /* Decode key (DataView.TCBlock-T.tc.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.key = tc55; break; case 1: pVal->tc.dataField.key = tc56; break; case 2: pVal->tc.dataField.key = tc81; break; case 3: pVal->tc.dataField.key = tc121; break; case 4: pVal->tc.dataField.key = tc122; break; case 5: pVal->tc.dataField.key = tc123; break; case 6: pVal->tc.dataField.key = tc125; break; case 7: pVal->tc.dataField.key = tc126; break; case 8: pVal->tc.dataField.key = tc1210; break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telecommand (DataView.TCBlock-T.tc.dataField.telecommand) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TCBlock-T.tc.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc55.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc55.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc55.rid) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc55.rid.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc55.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = segmentHeader; break; case 1: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = packetHeader; break; case 2: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = dataField; break; case 3: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc55RID; break; case 4: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc56RID; break; case 5: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc81CommandID; break; case 6: pVal->tc.dataField.telecommand.u.tc55.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TCBlock-T.tc.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc56.exist.numberRIDS = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc56.numberRIDS.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc56.rid) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc56.rid.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc56.rid.nCount;i1++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = segmentHeader; break; case 1: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = packetHeader; break; case 2: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = dataField; break; case 3: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc55RID; break; case 4: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc56RID; break; case 5: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc81CommandID; break; case 6: pVal->tc.dataField.telecommand.u.tc56.rid.arr[i1] = tc81Params; break; default: *pErrCode = ERR_TCBlock_T_tc_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.TCBlock-T.tc.dataField.telecommand.tc81.functionId) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.functionId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc81.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc81.params.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc81.params.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TCBlock-T.tc.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].exist.paramValue = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc81.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->tc.dataField.telecommand.kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc121.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc121.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc121.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc121.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc121.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc121.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc122.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc122.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc122.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc122.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc122.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc122.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.TCBlock-T.tc.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc123.maxReportingDelay.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tc.dataField.telecommand.kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.TCBlock-T.tc.dataField.telecommand.tc125.valueRep) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.valueRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.valueRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.TCBlock-T.tc.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.deltaRep = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.deltaRep.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.numberParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.numberParam = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.numberParam.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->tc.dataField.telecommand.u.tc125.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc125.paramID.nCount;i1++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nol = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nol.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].lowLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].highLimit.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nolSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nod = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nod.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].lowDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridLow = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridLow.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].highDelta.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].exist.ridHigh = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].nodSeq.arr[i2].ridHigh.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noe = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noe.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount = (long)nCount; for(i2=0;i2<pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.checkSelectionParam = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].checkSelectionParam.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].expectedValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.TCBlock-T.tc.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].exist.rid = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc125.paramID.arr[i1].noeSeq.arr[i2].rid.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->tc.dataField.telecommand.kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc126.numberParams) OCTET STRING*/ pVal->tc.dataField.telecommand.u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tc.dataField.telecommand.u.tc126.exist.numberParams = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc126.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ pVal->tc.dataField.telecommand.u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tc.dataField.telecommand.u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc126.paramID.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc126.paramID.nCount;i1++) { nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc126.paramID.arr[i1].arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->tc.dataField.telecommand.kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.numberParams.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->tc.dataField.telecommand.u.tc1210.params.nCount = (long)nCount; for(i1=0;i1<pVal->tc.dataField.telecommand.u.tc1210.params.nCount;i1++) { /* Decode paramID (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].paramValue.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].limitCrossed.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].previousCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].currentCheckingStatus.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.TCBlock-T.tc.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tc.dataField.telecommand.u.tc1210.params.arr[i1].transitionTime.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tc.dataField.telecommand.kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } return TRUE; } void Telemetry_T_Initialize(Telemetry_T* pVal) { pVal->kind = Telemetry_T_NONE; } flag Telemetry_T_IsConstraintValid(const Telemetry_T* pVal, int* pErrCode) { switch(pVal->kind) { case tm11_PRESENT: if ( !TM1_1_T_IsConstraintValid(&pVal->u.tm11, pErrCode)) return FALSE; break; case tm12_PRESENT: if ( !TM1_2_T_IsConstraintValid(&pVal->u.tm12, pErrCode)) return FALSE; break; case tm13_PRESENT: if ( !TM1_3_T_IsConstraintValid(&pVal->u.tm13, pErrCode)) return FALSE; break; case tm14_PRESENT: if ( !TM1_4_T_IsConstraintValid(&pVal->u.tm14, pErrCode)) return FALSE; break; case tm15_PRESENT: if ( !TM1_5_T_IsConstraintValid(&pVal->u.tm15, pErrCode)) return FALSE; break; case tm16_PRESENT: if ( !TM1_6_T_IsConstraintValid(&pVal->u.tm16, pErrCode)) return FALSE; break; case tm17_PRESENT: if ( !TM1_7_T_IsConstraintValid(&pVal->u.tm17, pErrCode)) return FALSE; break; case tm18_PRESENT: if ( !TM1_8_T_IsConstraintValid(&pVal->u.tm18, pErrCode)) return FALSE; break; case tm51_PRESENT: if ( !TM5_1_T_IsConstraintValid(&pVal->u.tm51, pErrCode)) return FALSE; break; case tm52_PRESENT: if ( !TM5_2_T_IsConstraintValid(&pVal->u.tm52, pErrCode)) return FALSE; break; case tm53_PRESENT: if ( !TM5_3_T_IsConstraintValid(&pVal->u.tm53, pErrCode)) return FALSE; break; case tm54_PRESENT: if ( !TM5_4_T_IsConstraintValid(&pVal->u.tm54, pErrCode)) return FALSE; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag Telemetry_T_Encode(const Telemetry_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Telemetry_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case tm11_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); if (!TM1_1_T_Encode(&pVal->u.tm11, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm12_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); if (!TM1_2_T_Encode(&pVal->u.tm12, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm13_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); if (!TM1_3_T_Encode(&pVal->u.tm13, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm14_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); if (!TM1_4_T_Encode(&pVal->u.tm14, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm15_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); if (!TM1_5_T_Encode(&pVal->u.tm15, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm16_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); if (!TM1_6_T_Encode(&pVal->u.tm16, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm17_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); if (!TM1_7_T_Encode(&pVal->u.tm17, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm18_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); if (!TM1_8_T_Encode(&pVal->u.tm18, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm51_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); if (!TM5_1_T_Encode(&pVal->u.tm51, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm52_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); if (!TM5_2_T_Encode(&pVal->u.tm52, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm53_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); if (!TM5_3_T_Encode(&pVal->u.tm53, pBitStrm, pErrCode, FALSE)) return FALSE; break; case tm54_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); if (!TM5_4_T_Encode(&pVal->u.tm54, pBitStrm, pErrCode, FALSE)) return FALSE; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telemetry_T_Decode(Telemetry_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: if (!TM1_1_T_Decode(&pVal->u.tm11, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm11_PRESENT; break; case 1: if (!TM1_2_T_Decode(&pVal->u.tm12, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm12_PRESENT; break; case 2: if (!TM1_3_T_Decode(&pVal->u.tm13, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm13_PRESENT; break; case 3: if (!TM1_4_T_Decode(&pVal->u.tm14, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm14_PRESENT; break; case 4: if (!TM1_5_T_Decode(&pVal->u.tm15, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm15_PRESENT; break; case 5: if (!TM1_6_T_Decode(&pVal->u.tm16, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm16_PRESENT; break; case 6: if (!TM1_7_T_Decode(&pVal->u.tm17, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm17_PRESENT; break; case 7: if (!TM1_8_T_Decode(&pVal->u.tm18, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm18_PRESENT; break; case 8: if (!TM5_1_T_Decode(&pVal->u.tm51, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm51_PRESENT; break; case 9: if (!TM5_2_T_Decode(&pVal->u.tm52, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm52_PRESENT; break; case 10: if (!TM5_3_T_Decode(&pVal->u.tm53, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm53_PRESENT; break; case 11: if (!TM5_4_T_Decode(&pVal->u.tm54, pBitStrm, pErrCode)) return FALSE; pVal->kind = tm54_PRESENT; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telemetry_T_ACN_Encode(const Telemetry_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !Telemetry_T_IsConstraintValid(pVal, pErrCode)) return FALSE; switch(pVal->kind) { case tm11_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); /* Encode packetId (DataView.Telemetry-T.tm11.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm11.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm11.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm11.packetSeqControl.arr[i1]); } break; case tm12_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tm12.exist.params);/* Encode packetId (DataView.Telemetry-T.tm12.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm12.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm12.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm12.packetSeqControl.arr[i1]); } /* Encode code (DataView.Telemetry-T.tm12.code) ENUMERATED*/ switch(pVal->u.tm12.code) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telemetry_T_tm12_code_unknown_enumeration_value; return FALSE; } /* Encode params (DataView.Telemetry-T.tm12.params) OCTET STRING*/ if (pVal->u.tm12.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm12.params.arr[i1]); } } break; case tm13_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); /* Encode packetId (DataView.Telemetry-T.tm13.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm13.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm13.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm13.packetSeqControl.arr[i1]); } break; case tm14_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tm14.exist.params);/* Encode packetId (DataView.Telemetry-T.tm14.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm14.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm14.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm14.packetSeqControl.arr[i1]); } /* Encode code (DataView.Telemetry-T.tm14.code) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm14.code.arr[i1]); } /* Encode params (DataView.Telemetry-T.tm14.params) OCTET STRING*/ if (pVal->u.tm14.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm14.params.arr[i1]); } } break; case tm15_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); /* Encode packetId (DataView.Telemetry-T.tm15.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm15.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm15.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm15.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.Telemetry-T.tm15.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm15.stepNumber.arr[i1]); } break; case tm16_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tm16.exist.code); BitStream_AppendBit(pBitStrm,pVal->u.tm16.exist.params);/* Encode packetId (DataView.Telemetry-T.tm16.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm16.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm16.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm16.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.Telemetry-T.tm16.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm16.stepNumber.arr[i1]); } /* Encode code (DataView.Telemetry-T.tm16.code) OCTET STRING*/ if (pVal->u.tm16.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm16.code.arr[i1]); } } /* Encode params (DataView.Telemetry-T.tm16.params) OCTET STRING*/ if (pVal->u.tm16.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm16.params.arr[i1]); } } break; case tm17_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); /* Encode packetId (DataView.Telemetry-T.tm17.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm17.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm17.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm17.packetSeqControl.arr[i1]); } break; case tm18_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->u.tm18.exist.code); BitStream_AppendBit(pBitStrm,pVal->u.tm18.exist.params);/* Encode packetId (DataView.Telemetry-T.tm18.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm18.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.Telemetry-T.tm18.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm18.packetSeqControl.arr[i1]); } /* Encode code (DataView.Telemetry-T.tm18.code) OCTET STRING*/ if (pVal->u.tm18.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm18.code.arr[i1]); } } /* Encode params (DataView.Telemetry-T.tm18.params) OCTET STRING*/ if (pVal->u.tm18.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->u.tm18.params.arr[i1]); } } break; case tm51_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); /* Encode reportID (DataView.Telemetry-T.tm51.reportID) ENUMERATED*/ switch(pVal->u.tm51.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telemetry_T_tm51_reportID_unknown_enumeration_value; return FALSE; } break; case tm52_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); /* Encode reportID (DataView.Telemetry-T.tm52.reportID) ENUMERATED*/ switch(pVal->u.tm52.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telemetry_T_tm52_reportID_unknown_enumeration_value; return FALSE; } break; case tm53_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); /* Encode reportID (DataView.Telemetry-T.tm53.reportID) ENUMERATED*/ switch(pVal->u.tm53.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telemetry_T_tm53_reportID_unknown_enumeration_value; return FALSE; } break; case tm54_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); /* Encode reportID (DataView.Telemetry-T.tm54.reportID) ENUMERATED*/ switch(pVal->u.tm54.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_Telemetry_T_tm54_reportID_unknown_enumeration_value; return FALSE; } break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag Telemetry_T_ACN_Decode(Telemetry_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode packetId (DataView.Telemetry-T.tm11.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm11.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm11.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm11.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->kind = tm11_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.Telemetry-T.tm12.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm12.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm12.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm12.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.Telemetry-T.tm12.code) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tm12.code = invalidPacketID; break; case 1: pVal->u.tm12.code = invalidPacketSequenceControl; break; case 2: pVal->u.tm12.code = invalidPacketLength; break; case 3: pVal->u.tm12.code = invalidDfhInfo; break; case 4: pVal->u.tm12.code = invalidServiceType; break; case 5: pVal->u.tm12.code = invalidServiceSubtype; break; case 6: pVal->u.tm12.code = invalidSourceID; break; default: *pErrCode = ERR_Telemetry_T_tm12_code_unknown_enumeration_value; return FALSE; } /* Decode params (DataView.Telemetry-T.tm12.params) OCTET STRING*/ pVal->u.tm12.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tm12.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm12.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->kind = tm12_PRESENT; break; case 2: /* Decode packetId (DataView.Telemetry-T.tm13.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm13.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm13.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm13.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->kind = tm13_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.Telemetry-T.tm14.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm14.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm14.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm14.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.Telemetry-T.tm14.code) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm14.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.Telemetry-T.tm14.params) OCTET STRING*/ pVal->u.tm14.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tm14.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm14.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->kind = tm14_PRESENT; break; case 4: /* Decode packetId (DataView.Telemetry-T.tm15.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm15.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm15.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm15.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.Telemetry-T.tm15.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm15.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->kind = tm15_PRESENT; break; case 5: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.Telemetry-T.tm16.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm16.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm16.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm16.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.Telemetry-T.tm16.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm16.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.Telemetry-T.tm16.code) OCTET STRING*/ pVal->u.tm16.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tm16.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm16.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.Telemetry-T.tm16.params) OCTET STRING*/ pVal->u.tm16.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tm16.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm16.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->kind = tm16_PRESENT; break; case 6: /* Decode packetId (DataView.Telemetry-T.tm17.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm17.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm17.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm17.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->kind = tm17_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.Telemetry-T.tm18.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm18.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.Telemetry-T.tm18.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm18.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.Telemetry-T.tm18.code) OCTET STRING*/ pVal->u.tm18.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->u.tm18.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm18.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.Telemetry-T.tm18.params) OCTET STRING*/ pVal->u.tm18.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->u.tm18.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->u.tm18.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->kind = tm18_PRESENT; break; case 8: /* Decode reportID (DataView.Telemetry-T.tm51.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tm51.reportID = segmentHeader; break; case 1: pVal->u.tm51.reportID = packetHeader; break; case 2: pVal->u.tm51.reportID = dataField; break; case 3: pVal->u.tm51.reportID = tc55RID; break; case 4: pVal->u.tm51.reportID = tc56RID; break; case 5: pVal->u.tm51.reportID = tc81CommandID; break; case 6: pVal->u.tm51.reportID = tc81Params; break; default: *pErrCode = ERR_Telemetry_T_tm51_reportID_unknown_enumeration_value; return FALSE; } pVal->kind = tm51_PRESENT; break; case 9: /* Decode reportID (DataView.Telemetry-T.tm52.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tm52.reportID = segmentHeader; break; case 1: pVal->u.tm52.reportID = packetHeader; break; case 2: pVal->u.tm52.reportID = dataField; break; case 3: pVal->u.tm52.reportID = tc55RID; break; case 4: pVal->u.tm52.reportID = tc56RID; break; case 5: pVal->u.tm52.reportID = tc81CommandID; break; case 6: pVal->u.tm52.reportID = tc81Params; break; default: *pErrCode = ERR_Telemetry_T_tm52_reportID_unknown_enumeration_value; return FALSE; } pVal->kind = tm52_PRESENT; break; case 10: /* Decode reportID (DataView.Telemetry-T.tm53.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tm53.reportID = segmentHeader; break; case 1: pVal->u.tm53.reportID = packetHeader; break; case 2: pVal->u.tm53.reportID = dataField; break; case 3: pVal->u.tm53.reportID = tc55RID; break; case 4: pVal->u.tm53.reportID = tc56RID; break; case 5: pVal->u.tm53.reportID = tc81CommandID; break; case 6: pVal->u.tm53.reportID = tc81Params; break; default: *pErrCode = ERR_Telemetry_T_tm53_reportID_unknown_enumeration_value; return FALSE; } pVal->kind = tm53_PRESENT; break; case 11: /* Decode reportID (DataView.Telemetry-T.tm54.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->u.tm54.reportID = segmentHeader; break; case 1: pVal->u.tm54.reportID = packetHeader; break; case 2: pVal->u.tm54.reportID = dataField; break; case 3: pVal->u.tm54.reportID = tc55RID; break; case 4: pVal->u.tm54.reportID = tc56RID; break; case 5: pVal->u.tm54.reportID = tc81CommandID; break; case 6: pVal->u.tm54.reportID = tc81Params; break; default: *pErrCode = ERR_Telemetry_T_tm54_reportID_unknown_enumeration_value; return FALSE; } pVal->kind = tm54_PRESENT; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } void TM_DF_T_Initialize(TM_DF_T* pVal) { TMID_T_Initialize(&pVal->key); Telemetry_T_Initialize(&pVal->telemetry); } flag TM_DF_T_IsConstraintValid(const TM_DF_T* pVal, int* pErrCode) { if ( !TMID_T_IsConstraintValid(&pVal->key, pErrCode)) return FALSE; if ( !Telemetry_T_IsConstraintValid(&pVal->telemetry, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM_DF_T_Encode(const TM_DF_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_DF_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!TMID_T_Encode(&pVal->key, pBitStrm, pErrCode, FALSE)) return FALSE; if (!Telemetry_T_Encode(&pVal->telemetry, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM_DF_T_Decode(TM_DF_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode key (TMID-T)*/ if (!TMID_T_Decode(&pVal->key, pBitStrm, pErrCode)) return FALSE; /*Decode telemetry (Telemetry-T)*/ if (!Telemetry_T_Decode(&pVal->telemetry, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM_DF_T_ACN_Encode(const TM_DF_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_DF_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode key (DataView.TM-DF-T.key) ENUMERATED*/ switch(pVal->key) { case tm11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tm12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tm13: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tm14: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tm15: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tm16: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tm17: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tm18: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tm51: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; case tm52: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 4); break; case tm53: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 4); break; case tm54: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 4); break; default: *pErrCode = ERR_TM_DF_T_key_unknown_enumeration_value; return FALSE; } /* Encode telemetry (DataView.TM-DF-T.telemetry) CHOICE*/ switch(pVal->telemetry.kind) { case tm11_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); /* Encode packetId (DataView.TM-DF-T.telemetry.tm11.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm11.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm11.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm11.packetSeqControl.arr[i1]); } break; case tm12_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm12.exist.params);/* Encode packetId (DataView.TM-DF-T.telemetry.tm12.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm12.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm12.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm12.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-DF-T.telemetry.tm12.code) ENUMERATED*/ switch(pVal->telemetry.u.tm12.code) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Encode params (DataView.TM-DF-T.telemetry.tm12.params) OCTET STRING*/ if (pVal->telemetry.u.tm12.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm12.params.arr[i1]); } } break; case tm13_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); /* Encode packetId (DataView.TM-DF-T.telemetry.tm13.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm13.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm13.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm13.packetSeqControl.arr[i1]); } break; case tm14_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm14.exist.params);/* Encode packetId (DataView.TM-DF-T.telemetry.tm14.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm14.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm14.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm14.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-DF-T.telemetry.tm14.code) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm14.code.arr[i1]); } /* Encode params (DataView.TM-DF-T.telemetry.tm14.params) OCTET STRING*/ if (pVal->telemetry.u.tm14.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm14.params.arr[i1]); } } break; case tm15_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); /* Encode packetId (DataView.TM-DF-T.telemetry.tm15.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm15.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm15.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm15.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM-DF-T.telemetry.tm15.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm15.stepNumber.arr[i1]); } break; case tm16_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm16.exist.code); BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm16.exist.params);/* Encode packetId (DataView.TM-DF-T.telemetry.tm16.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm16.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm16.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm16.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM-DF-T.telemetry.tm16.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm16.stepNumber.arr[i1]); } /* Encode code (DataView.TM-DF-T.telemetry.tm16.code) OCTET STRING*/ if (pVal->telemetry.u.tm16.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm16.code.arr[i1]); } } /* Encode params (DataView.TM-DF-T.telemetry.tm16.params) OCTET STRING*/ if (pVal->telemetry.u.tm16.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm16.params.arr[i1]); } } break; case tm17_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); /* Encode packetId (DataView.TM-DF-T.telemetry.tm17.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm17.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm17.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm17.packetSeqControl.arr[i1]); } break; case tm18_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm18.exist.code); BitStream_AppendBit(pBitStrm,pVal->telemetry.u.tm18.exist.params);/* Encode packetId (DataView.TM-DF-T.telemetry.tm18.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm18.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-DF-T.telemetry.tm18.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm18.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-DF-T.telemetry.tm18.code) OCTET STRING*/ if (pVal->telemetry.u.tm18.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm18.code.arr[i1]); } } /* Encode params (DataView.TM-DF-T.telemetry.tm18.params) OCTET STRING*/ if (pVal->telemetry.u.tm18.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->telemetry.u.tm18.params.arr[i1]); } } break; case tm51_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); /* Encode reportID (DataView.TM-DF-T.telemetry.tm51.reportID) ENUMERATED*/ switch(pVal->telemetry.u.tm51.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } break; case tm52_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); /* Encode reportID (DataView.TM-DF-T.telemetry.tm52.reportID) ENUMERATED*/ switch(pVal->telemetry.u.tm52.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } break; case tm53_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); /* Encode reportID (DataView.TM-DF-T.telemetry.tm53.reportID) ENUMERATED*/ switch(pVal->telemetry.u.tm53.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } break; case tm54_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); /* Encode reportID (DataView.TM-DF-T.telemetry.tm54.reportID) ENUMERATED*/ switch(pVal->telemetry.u.tm54.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag TM_DF_T_ACN_Decode(TM_DF_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode key (DataView.TM-DF-T.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->key = tm11; break; case 1: pVal->key = tm12; break; case 2: pVal->key = tm13; break; case 3: pVal->key = tm14; break; case 4: pVal->key = tm15; break; case 5: pVal->key = tm16; break; case 6: pVal->key = tm17; break; case 7: pVal->key = tm18; break; case 8: pVal->key = tm51; break; case 9: pVal->key = tm52; break; case 10: pVal->key = tm53; break; case 11: pVal->key = tm54; break; default: *pErrCode = ERR_TM_DF_T_key_unknown_enumeration_value; return FALSE; } /* Decode telemetry (DataView.TM-DF-T.telemetry) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode packetId (DataView.TM-DF-T.telemetry.tm11.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm11.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm11.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm11.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->telemetry.kind = tm11_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-DF-T.telemetry.tm12.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm12.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm12.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm12.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-DF-T.telemetry.tm12.code) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telemetry.u.tm12.code = invalidPacketID; break; case 1: pVal->telemetry.u.tm12.code = invalidPacketSequenceControl; break; case 2: pVal->telemetry.u.tm12.code = invalidPacketLength; break; case 3: pVal->telemetry.u.tm12.code = invalidDfhInfo; break; case 4: pVal->telemetry.u.tm12.code = invalidServiceType; break; case 5: pVal->telemetry.u.tm12.code = invalidServiceSubtype; break; case 6: pVal->telemetry.u.tm12.code = invalidSourceID; break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Decode params (DataView.TM-DF-T.telemetry.tm12.params) OCTET STRING*/ pVal->telemetry.u.tm12.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telemetry.u.tm12.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm12.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->telemetry.kind = tm12_PRESENT; break; case 2: /* Decode packetId (DataView.TM-DF-T.telemetry.tm13.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm13.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm13.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm13.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->telemetry.kind = tm13_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-DF-T.telemetry.tm14.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm14.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm14.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm14.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-DF-T.telemetry.tm14.code) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm14.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TM-DF-T.telemetry.tm14.params) OCTET STRING*/ pVal->telemetry.u.tm14.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telemetry.u.tm14.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm14.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->telemetry.kind = tm14_PRESENT; break; case 4: /* Decode packetId (DataView.TM-DF-T.telemetry.tm15.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm15.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm15.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm15.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM-DF-T.telemetry.tm15.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm15.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->telemetry.kind = tm15_PRESENT; break; case 5: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-DF-T.telemetry.tm16.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm16.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm16.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm16.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM-DF-T.telemetry.tm16.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm16.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-DF-T.telemetry.tm16.code) OCTET STRING*/ pVal->telemetry.u.tm16.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telemetry.u.tm16.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm16.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM-DF-T.telemetry.tm16.params) OCTET STRING*/ pVal->telemetry.u.tm16.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telemetry.u.tm16.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm16.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->telemetry.kind = tm16_PRESENT; break; case 6: /* Decode packetId (DataView.TM-DF-T.telemetry.tm17.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm17.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm17.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm17.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->telemetry.kind = tm17_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-DF-T.telemetry.tm18.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm18.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-DF-T.telemetry.tm18.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm18.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-DF-T.telemetry.tm18.code) OCTET STRING*/ pVal->telemetry.u.tm18.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->telemetry.u.tm18.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm18.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM-DF-T.telemetry.tm18.params) OCTET STRING*/ pVal->telemetry.u.tm18.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->telemetry.u.tm18.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->telemetry.u.tm18.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->telemetry.kind = tm18_PRESENT; break; case 8: /* Decode reportID (DataView.TM-DF-T.telemetry.tm51.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telemetry.u.tm51.reportID = segmentHeader; break; case 1: pVal->telemetry.u.tm51.reportID = packetHeader; break; case 2: pVal->telemetry.u.tm51.reportID = dataField; break; case 3: pVal->telemetry.u.tm51.reportID = tc55RID; break; case 4: pVal->telemetry.u.tm51.reportID = tc56RID; break; case 5: pVal->telemetry.u.tm51.reportID = tc81CommandID; break; case 6: pVal->telemetry.u.tm51.reportID = tc81Params; break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } pVal->telemetry.kind = tm51_PRESENT; break; case 9: /* Decode reportID (DataView.TM-DF-T.telemetry.tm52.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telemetry.u.tm52.reportID = segmentHeader; break; case 1: pVal->telemetry.u.tm52.reportID = packetHeader; break; case 2: pVal->telemetry.u.tm52.reportID = dataField; break; case 3: pVal->telemetry.u.tm52.reportID = tc55RID; break; case 4: pVal->telemetry.u.tm52.reportID = tc56RID; break; case 5: pVal->telemetry.u.tm52.reportID = tc81CommandID; break; case 6: pVal->telemetry.u.tm52.reportID = tc81Params; break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } pVal->telemetry.kind = tm52_PRESENT; break; case 10: /* Decode reportID (DataView.TM-DF-T.telemetry.tm53.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telemetry.u.tm53.reportID = segmentHeader; break; case 1: pVal->telemetry.u.tm53.reportID = packetHeader; break; case 2: pVal->telemetry.u.tm53.reportID = dataField; break; case 3: pVal->telemetry.u.tm53.reportID = tc55RID; break; case 4: pVal->telemetry.u.tm53.reportID = tc56RID; break; case 5: pVal->telemetry.u.tm53.reportID = tc81CommandID; break; case 6: pVal->telemetry.u.tm53.reportID = tc81Params; break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } pVal->telemetry.kind = tm53_PRESENT; break; case 11: /* Decode reportID (DataView.TM-DF-T.telemetry.tm54.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->telemetry.u.tm54.reportID = segmentHeader; break; case 1: pVal->telemetry.u.tm54.reportID = packetHeader; break; case 2: pVal->telemetry.u.tm54.reportID = dataField; break; case 3: pVal->telemetry.u.tm54.reportID = tc55RID; break; case 4: pVal->telemetry.u.tm54.reportID = tc56RID; break; case 5: pVal->telemetry.u.tm54.reportID = tc81CommandID; break; case 6: pVal->telemetry.u.tm54.reportID = tc81Params; break; default: *pErrCode = ERR_TM_DF_T_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } pVal->telemetry.kind = tm54_PRESENT; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } void TM_T_Initialize(TM_T* pVal) { PH_T_Initialize(&pVal->packetHeader); TM_DFH_T_Initialize(&pVal->dataFieldHeader); TM_DF_T_Initialize(&pVal->dataField); } flag TM_T_IsConstraintValid(const TM_T* pVal, int* pErrCode) { if ( !PH_T_IsConstraintValid(&pVal->packetHeader, pErrCode)) return FALSE; if ( !TM_DFH_T_IsConstraintValid(&pVal->dataFieldHeader, pErrCode)) return FALSE; if ( !TM_DF_T_IsConstraintValid(&pVal->dataField, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TM_T_Encode(const TM_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!PH_T_Encode(&pVal->packetHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!TM_DFH_T_Encode(&pVal->dataFieldHeader, pBitStrm, pErrCode, FALSE)) return FALSE; if (!TM_DF_T_Encode(&pVal->dataField, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TM_T_Decode(TM_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode packetHeader (PH-T)*/ if (!PH_T_Decode(&pVal->packetHeader, pBitStrm, pErrCode)) return FALSE; /*Decode dataFieldHeader (TM-DFH-T)*/ if (!TM_DFH_T_Decode(&pVal->dataFieldHeader, pBitStrm, pErrCode)) return FALSE; /*Decode dataField (TM-DF-T)*/ if (!TM_DF_T_Decode(&pVal->dataField, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TM_T_ACN_Encode(const TM_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TM_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode packetHeader (DataView.TM-T.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TM-T.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TM-T.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TM-T.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TM-T.dataFieldHeader) SEQUENCE*/ /* Encode tmHeader (DataView.TM-T.dataFieldHeader.tmHeader) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.tmHeader.arr[i1]); } /* Encode serviceType (DataView.TM-T.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TM-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode packetSubcounter (DataView.TM-T.dataFieldHeader.packetSubcounter) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.packetSubcounter.arr[i1]); } /* Encode absTime (DataView.TM-T.dataFieldHeader.absTime) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.absTime.arr[i1]); } /* Encode spare3 (DataView.TM-T.dataFieldHeader.spare3) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataFieldHeader.spare3.arr[i1]); } /* Encode dataField (DataView.TM-T.dataField) SEQUENCE*/ /* Encode key (DataView.TM-T.dataField.key) ENUMERATED*/ switch(pVal->dataField.key) { case tm11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tm12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tm13: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tm14: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tm15: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tm16: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tm17: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tm18: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tm51: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; case tm52: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 4); break; case tm53: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 4); break; case tm54: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 4); break; default: *pErrCode = ERR_TM_T_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telemetry (DataView.TM-T.dataField.telemetry) CHOICE*/ switch(pVal->dataField.telemetry.kind) { case tm11_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); /* Encode packetId (DataView.TM-T.dataField.telemetry.tm11.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm11.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm11.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm11.packetSeqControl.arr[i1]); } break; case tm12_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm12.exist.params);/* Encode packetId (DataView.TM-T.dataField.telemetry.tm12.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm12.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm12.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm12.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-T.dataField.telemetry.tm12.code) ENUMERATED*/ switch(pVal->dataField.telemetry.u.tm12.code) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Encode params (DataView.TM-T.dataField.telemetry.tm12.params) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm12.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm12.params.arr[i1]); } } break; case tm13_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); /* Encode packetId (DataView.TM-T.dataField.telemetry.tm13.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm13.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm13.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm13.packetSeqControl.arr[i1]); } break; case tm14_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm14.exist.params);/* Encode packetId (DataView.TM-T.dataField.telemetry.tm14.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm14.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm14.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm14.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-T.dataField.telemetry.tm14.code) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm14.code.arr[i1]); } /* Encode params (DataView.TM-T.dataField.telemetry.tm14.params) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm14.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm14.params.arr[i1]); } } break; case tm15_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); /* Encode packetId (DataView.TM-T.dataField.telemetry.tm15.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm15.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm15.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm15.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM-T.dataField.telemetry.tm15.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm15.stepNumber.arr[i1]); } break; case tm16_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm16.exist.code); BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm16.exist.params);/* Encode packetId (DataView.TM-T.dataField.telemetry.tm16.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm16.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm16.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm16.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TM-T.dataField.telemetry.tm16.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm16.stepNumber.arr[i1]); } /* Encode code (DataView.TM-T.dataField.telemetry.tm16.code) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm16.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm16.code.arr[i1]); } } /* Encode params (DataView.TM-T.dataField.telemetry.tm16.params) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm16.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm16.params.arr[i1]); } } break; case tm17_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); /* Encode packetId (DataView.TM-T.dataField.telemetry.tm17.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm17.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm17.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm17.packetSeqControl.arr[i1]); } break; case tm18_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm18.exist.code); BitStream_AppendBit(pBitStrm,pVal->dataField.telemetry.u.tm18.exist.params);/* Encode packetId (DataView.TM-T.dataField.telemetry.tm18.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm18.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TM-T.dataField.telemetry.tm18.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm18.packetSeqControl.arr[i1]); } /* Encode code (DataView.TM-T.dataField.telemetry.tm18.code) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm18.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm18.code.arr[i1]); } } /* Encode params (DataView.TM-T.dataField.telemetry.tm18.params) OCTET STRING*/ if (pVal->dataField.telemetry.u.tm18.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->dataField.telemetry.u.tm18.params.arr[i1]); } } break; case tm51_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); /* Encode reportID (DataView.TM-T.dataField.telemetry.tm51.reportID) ENUMERATED*/ switch(pVal->dataField.telemetry.u.tm51.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } break; case tm52_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); /* Encode reportID (DataView.TM-T.dataField.telemetry.tm52.reportID) ENUMERATED*/ switch(pVal->dataField.telemetry.u.tm52.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } break; case tm53_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); /* Encode reportID (DataView.TM-T.dataField.telemetry.tm53.reportID) ENUMERATED*/ switch(pVal->dataField.telemetry.u.tm53.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } break; case tm54_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); /* Encode reportID (DataView.TM-T.dataField.telemetry.tm54.reportID) ENUMERATED*/ switch(pVal->dataField.telemetry.u.tm54.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag TM_T_ACN_Decode(TM_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode packetHeader (DataView.TM-T.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TM-T.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TM-T.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TM-T.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TM-T.dataFieldHeader) SEQUENCE*/ /* Decode tmHeader (DataView.TM-T.dataFieldHeader.tmHeader) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.tmHeader.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TM-T.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TM-T.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSubcounter (DataView.TM-T.dataFieldHeader.packetSubcounter) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.packetSubcounter.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode absTime (DataView.TM-T.dataFieldHeader.absTime) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.absTime.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode spare3 (DataView.TM-T.dataFieldHeader.spare3) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataFieldHeader.spare3.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TM-T.dataField) SEQUENCE*/ /* Decode key (DataView.TM-T.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.key = tm11; break; case 1: pVal->dataField.key = tm12; break; case 2: pVal->dataField.key = tm13; break; case 3: pVal->dataField.key = tm14; break; case 4: pVal->dataField.key = tm15; break; case 5: pVal->dataField.key = tm16; break; case 6: pVal->dataField.key = tm17; break; case 7: pVal->dataField.key = tm18; break; case 8: pVal->dataField.key = tm51; break; case 9: pVal->dataField.key = tm52; break; case 10: pVal->dataField.key = tm53; break; case 11: pVal->dataField.key = tm54; break; default: *pErrCode = ERR_TM_T_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telemetry (DataView.TM-T.dataField.telemetry) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode packetId (DataView.TM-T.dataField.telemetry.tm11.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm11.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm11.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm11.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->dataField.telemetry.kind = tm11_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-T.dataField.telemetry.tm12.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm12.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm12.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm12.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-T.dataField.telemetry.tm12.code) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telemetry.u.tm12.code = invalidPacketID; break; case 1: pVal->dataField.telemetry.u.tm12.code = invalidPacketSequenceControl; break; case 2: pVal->dataField.telemetry.u.tm12.code = invalidPacketLength; break; case 3: pVal->dataField.telemetry.u.tm12.code = invalidDfhInfo; break; case 4: pVal->dataField.telemetry.u.tm12.code = invalidServiceType; break; case 5: pVal->dataField.telemetry.u.tm12.code = invalidServiceSubtype; break; case 6: pVal->dataField.telemetry.u.tm12.code = invalidSourceID; break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Decode params (DataView.TM-T.dataField.telemetry.tm12.params) OCTET STRING*/ pVal->dataField.telemetry.u.tm12.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telemetry.u.tm12.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm12.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->dataField.telemetry.kind = tm12_PRESENT; break; case 2: /* Decode packetId (DataView.TM-T.dataField.telemetry.tm13.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm13.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm13.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm13.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->dataField.telemetry.kind = tm13_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-T.dataField.telemetry.tm14.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm14.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm14.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm14.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-T.dataField.telemetry.tm14.code) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm14.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TM-T.dataField.telemetry.tm14.params) OCTET STRING*/ pVal->dataField.telemetry.u.tm14.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telemetry.u.tm14.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm14.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->dataField.telemetry.kind = tm14_PRESENT; break; case 4: /* Decode packetId (DataView.TM-T.dataField.telemetry.tm15.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm15.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm15.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm15.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM-T.dataField.telemetry.tm15.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm15.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->dataField.telemetry.kind = tm15_PRESENT; break; case 5: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-T.dataField.telemetry.tm16.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm16.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm16.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm16.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TM-T.dataField.telemetry.tm16.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm16.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-T.dataField.telemetry.tm16.code) OCTET STRING*/ pVal->dataField.telemetry.u.tm16.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telemetry.u.tm16.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm16.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM-T.dataField.telemetry.tm16.params) OCTET STRING*/ pVal->dataField.telemetry.u.tm16.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telemetry.u.tm16.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm16.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->dataField.telemetry.kind = tm16_PRESENT; break; case 6: /* Decode packetId (DataView.TM-T.dataField.telemetry.tm17.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm17.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm17.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm17.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->dataField.telemetry.kind = tm17_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TM-T.dataField.telemetry.tm18.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm18.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TM-T.dataField.telemetry.tm18.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm18.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TM-T.dataField.telemetry.tm18.code) OCTET STRING*/ pVal->dataField.telemetry.u.tm18.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->dataField.telemetry.u.tm18.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm18.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TM-T.dataField.telemetry.tm18.params) OCTET STRING*/ pVal->dataField.telemetry.u.tm18.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->dataField.telemetry.u.tm18.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->dataField.telemetry.u.tm18.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->dataField.telemetry.kind = tm18_PRESENT; break; case 8: /* Decode reportID (DataView.TM-T.dataField.telemetry.tm51.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telemetry.u.tm51.reportID = segmentHeader; break; case 1: pVal->dataField.telemetry.u.tm51.reportID = packetHeader; break; case 2: pVal->dataField.telemetry.u.tm51.reportID = dataField; break; case 3: pVal->dataField.telemetry.u.tm51.reportID = tc55RID; break; case 4: pVal->dataField.telemetry.u.tm51.reportID = tc56RID; break; case 5: pVal->dataField.telemetry.u.tm51.reportID = tc81CommandID; break; case 6: pVal->dataField.telemetry.u.tm51.reportID = tc81Params; break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } pVal->dataField.telemetry.kind = tm51_PRESENT; break; case 9: /* Decode reportID (DataView.TM-T.dataField.telemetry.tm52.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telemetry.u.tm52.reportID = segmentHeader; break; case 1: pVal->dataField.telemetry.u.tm52.reportID = packetHeader; break; case 2: pVal->dataField.telemetry.u.tm52.reportID = dataField; break; case 3: pVal->dataField.telemetry.u.tm52.reportID = tc55RID; break; case 4: pVal->dataField.telemetry.u.tm52.reportID = tc56RID; break; case 5: pVal->dataField.telemetry.u.tm52.reportID = tc81CommandID; break; case 6: pVal->dataField.telemetry.u.tm52.reportID = tc81Params; break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } pVal->dataField.telemetry.kind = tm52_PRESENT; break; case 10: /* Decode reportID (DataView.TM-T.dataField.telemetry.tm53.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telemetry.u.tm53.reportID = segmentHeader; break; case 1: pVal->dataField.telemetry.u.tm53.reportID = packetHeader; break; case 2: pVal->dataField.telemetry.u.tm53.reportID = dataField; break; case 3: pVal->dataField.telemetry.u.tm53.reportID = tc55RID; break; case 4: pVal->dataField.telemetry.u.tm53.reportID = tc56RID; break; case 5: pVal->dataField.telemetry.u.tm53.reportID = tc81CommandID; break; case 6: pVal->dataField.telemetry.u.tm53.reportID = tc81Params; break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } pVal->dataField.telemetry.kind = tm53_PRESENT; break; case 11: /* Decode reportID (DataView.TM-T.dataField.telemetry.tm54.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->dataField.telemetry.u.tm54.reportID = segmentHeader; break; case 1: pVal->dataField.telemetry.u.tm54.reportID = packetHeader; break; case 2: pVal->dataField.telemetry.u.tm54.reportID = dataField; break; case 3: pVal->dataField.telemetry.u.tm54.reportID = tc55RID; break; case 4: pVal->dataField.telemetry.u.tm54.reportID = tc56RID; break; case 5: pVal->dataField.telemetry.u.tm54.reportID = tc81CommandID; break; case 6: pVal->dataField.telemetry.u.tm54.reportID = tc81Params; break; default: *pErrCode = ERR_TM_T_dataField_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } pVal->dataField.telemetry.kind = tm54_PRESENT; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } void TMBlock_T_Initialize(TMBlock_T* pVal) { IfStandard_T_Initialize(&pVal->typeIF); TM_T_Initialize(&pVal->tm); } flag TMBlock_T_IsConstraintValid(const TMBlock_T* pVal, int* pErrCode) { if ( !IfStandard_T_IsConstraintValid(&pVal->typeIF, pErrCode)) return FALSE; if ( !TM_T_IsConstraintValid(&pVal->tm, pErrCode)) return FALSE; (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TMBlock_T_Encode(const TMBlock_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TMBlock_T_IsConstraintValid(pVal, pErrCode)) return FALSE; if (!IfStandard_T_Encode(&pVal->typeIF, pBitStrm, pErrCode, FALSE)) return FALSE; if (!TM_T_Encode(&pVal->tm, pBitStrm, pErrCode, FALSE)) return FALSE; return TRUE; } flag TMBlock_T_Decode(TMBlock_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /*Decode typeIF (IfStandard-T)*/ if (!IfStandard_T_Decode(&pVal->typeIF, pBitStrm, pErrCode)) return FALSE; /*Decode tm (TM-T)*/ if (!TM_T_Decode(&pVal->tm, pBitStrm, pErrCode)) return FALSE; return TRUE; } flag TMBlock_T_ACN_Encode(const TMBlock_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; if (bCheckConstraints && !TMBlock_T_IsConstraintValid(pVal, pErrCode)) return FALSE; /* Encode typeIF (DataView.TMBlock-T.typeIF) ENUMERATED*/ switch(pVal->typeIF) { case native: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 1); break; case pus: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 1); break; default: *pErrCode = ERR_TMBlock_T_typeIF_unknown_enumeration_value; return FALSE; } /* Encode tm (DataView.TMBlock-T.tm) SEQUENCE*/ /* Encode packetHeader (DataView.TMBlock-T.tm.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TMBlock-T.tm.packetHeader.packetID) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.packetHeader.packetID.arr[i1]); } /* Encode packetSequenceControl (DataView.TMBlock-T.tm.packetHeader.packetSequenceControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.packetHeader.packetSequenceControl.arr[i1]); } /* Encode packetLength (DataView.TMBlock-T.tm.packetHeader.packetLength) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.packetHeader.packetLength.arr[i1]); } /* Encode dataFieldHeader (DataView.TMBlock-T.tm.dataFieldHeader) SEQUENCE*/ /* Encode tmHeader (DataView.TMBlock-T.tm.dataFieldHeader.tmHeader) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.tmHeader.arr[i1]); } /* Encode serviceType (DataView.TMBlock-T.tm.dataFieldHeader.serviceType) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.serviceType.arr[i1]); } /* Encode serviceSubtype (DataView.TMBlock-T.tm.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.serviceSubtype.arr[i1]); } /* Encode packetSubcounter (DataView.TMBlock-T.tm.dataFieldHeader.packetSubcounter) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.packetSubcounter.arr[i1]); } /* Encode absTime (DataView.TMBlock-T.tm.dataFieldHeader.absTime) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.absTime.arr[i1]); } /* Encode spare3 (DataView.TMBlock-T.tm.dataFieldHeader.spare3) OCTET STRING*/ for(i1=0;i1<1;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataFieldHeader.spare3.arr[i1]); } /* Encode dataField (DataView.TMBlock-T.tm.dataField) SEQUENCE*/ /* Encode key (DataView.TMBlock-T.tm.dataField.key) ENUMERATED*/ switch(pVal->tm.dataField.key) { case tm11: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tm12: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tm13: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tm14: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tm15: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tm16: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tm17: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tm18: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tm51: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; case tm52: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 9, 4); break; case tm53: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 10, 4); break; case tm54: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 11, 4); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telemetry (DataView.TMBlock-T.tm.dataField.telemetry) CHOICE*/ switch(pVal->tm.dataField.telemetry.kind) { case tm11_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 11); /* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm11.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm11.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm11.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm11.packetSeqControl.arr[i1]); } break; case tm12_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm12.exist.params);/* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm12.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm12.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm12.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm12.packetSeqControl.arr[i1]); } /* Encode code (DataView.TMBlock-T.tm.dataField.telemetry.tm12.code) ENUMERATED*/ switch(pVal->tm.dataField.telemetry.u.tm12.code) { case invalidPacketID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case invalidPacketSequenceControl: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case invalidPacketLength: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case invalidDfhInfo: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case invalidServiceType: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case invalidServiceSubtype: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case invalidSourceID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Encode params (DataView.TMBlock-T.tm.dataField.telemetry.tm12.params) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm12.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm12.params.arr[i1]); } } break; case tm13_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 11); /* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm13.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm13.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm13.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm13.packetSeqControl.arr[i1]); } break; case tm14_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm14.exist.params);/* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm14.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm14.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm14.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm14.packetSeqControl.arr[i1]); } /* Encode code (DataView.TMBlock-T.tm.dataField.telemetry.tm14.code) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm14.code.arr[i1]); } /* Encode params (DataView.TMBlock-T.tm.dataField.telemetry.tm14.params) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm14.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm14.params.arr[i1]); } } break; case tm15_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 11); /* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm15.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm15.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm15.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm15.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TMBlock-T.tm.dataField.telemetry.tm15.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm15.stepNumber.arr[i1]); } break; case tm16_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm16.exist.code); BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm16.exist.params);/* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm16.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm16.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm16.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm16.packetSeqControl.arr[i1]); } /* Encode stepNumber (DataView.TMBlock-T.tm.dataField.telemetry.tm16.stepNumber) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm16.stepNumber.arr[i1]); } /* Encode code (DataView.TMBlock-T.tm.dataField.telemetry.tm16.code) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm16.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm16.code.arr[i1]); } } /* Encode params (DataView.TMBlock-T.tm.dataField.telemetry.tm16.params) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm16.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm16.params.arr[i1]); } } break; case tm17_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 11); /* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm17.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm17.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm17.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm17.packetSeqControl.arr[i1]); } break; case tm18_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 11); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm18.exist.code); BitStream_AppendBit(pBitStrm,pVal->tm.dataField.telemetry.u.tm18.exist.params);/* Encode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm18.packetId) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm18.packetId.arr[i1]); } /* Encode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm18.packetSeqControl) OCTET STRING*/ for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm18.packetSeqControl.arr[i1]); } /* Encode code (DataView.TMBlock-T.tm.dataField.telemetry.tm18.code) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm18.exist.code ) { for(i1=0;i1<2;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm18.code.arr[i1]); } } /* Encode params (DataView.TMBlock-T.tm.dataField.telemetry.tm18.params) OCTET STRING*/ if (pVal->tm.dataField.telemetry.u.tm18.exist.params ) { for(i1=0;i1<4;i1++) { BitStream_AppendByte0(pBitStrm, pVal->tm.dataField.telemetry.u.tm18.params.arr[i1]); } } break; case tm51_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 11); /* Encode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm51.reportID) ENUMERATED*/ switch(pVal->tm.dataField.telemetry.u.tm51.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } break; case tm52_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 9, 0, 11); /* Encode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm52.reportID) ENUMERATED*/ switch(pVal->tm.dataField.telemetry.u.tm52.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } break; case tm53_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 10, 0, 11); /* Encode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm53.reportID) ENUMERATED*/ switch(pVal->tm.dataField.telemetry.u.tm53.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } break; case tm54_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 11, 0, 11); /* Encode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm54.reportID) ENUMERATED*/ switch(pVal->tm.dataField.telemetry.u.tm54.reportID) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } flag TMBlock_T_ACN_Decode(TMBlock_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; /* Decode typeIF (DataView.TMBlock-T.typeIF) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->typeIF = native; break; case 1: pVal->typeIF = pus; break; default: *pErrCode = ERR_TMBlock_T_typeIF_unknown_enumeration_value; return FALSE; } /* Decode tm (DataView.TMBlock-T.tm) SEQUENCE*/ /* Decode packetHeader (DataView.TMBlock-T.tm.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TMBlock-T.tm.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.packetHeader.packetID.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TMBlock-T.tm.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.packetHeader.packetSequenceControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TMBlock-T.tm.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.packetHeader.packetLength.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TMBlock-T.tm.dataFieldHeader) SEQUENCE*/ /* Decode tmHeader (DataView.TMBlock-T.tm.dataFieldHeader.tmHeader) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.tmHeader.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TMBlock-T.tm.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.serviceType.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TMBlock-T.tm.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.serviceSubtype.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSubcounter (DataView.TMBlock-T.tm.dataFieldHeader.packetSubcounter) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.packetSubcounter.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode absTime (DataView.TMBlock-T.tm.dataFieldHeader.absTime) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.absTime.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode spare3 (DataView.TMBlock-T.tm.dataFieldHeader.spare3) OCTET STRING*/ nCount = 1; for(i1=0;i1<1;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataFieldHeader.spare3.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TMBlock-T.tm.dataField) SEQUENCE*/ /* Decode key (DataView.TMBlock-T.tm.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.key = tm11; break; case 1: pVal->tm.dataField.key = tm12; break; case 2: pVal->tm.dataField.key = tm13; break; case 3: pVal->tm.dataField.key = tm14; break; case 4: pVal->tm.dataField.key = tm15; break; case 5: pVal->tm.dataField.key = tm16; break; case 6: pVal->tm.dataField.key = tm17; break; case 7: pVal->tm.dataField.key = tm18; break; case 8: pVal->tm.dataField.key = tm51; break; case 9: pVal->tm.dataField.key = tm52; break; case 10: pVal->tm.dataField.key = tm53; break; case 11: pVal->tm.dataField.key = tm54; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telemetry (DataView.TMBlock-T.tm.dataField.telemetry) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 11)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm11.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm11.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm11.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm11.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tm.dataField.telemetry.kind = tm11_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm12.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm12.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm12.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm12.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TMBlock-T.tm.dataField.telemetry.tm12.code) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.telemetry.u.tm12.code = invalidPacketID; break; case 1: pVal->tm.dataField.telemetry.u.tm12.code = invalidPacketSequenceControl; break; case 2: pVal->tm.dataField.telemetry.u.tm12.code = invalidPacketLength; break; case 3: pVal->tm.dataField.telemetry.u.tm12.code = invalidDfhInfo; break; case 4: pVal->tm.dataField.telemetry.u.tm12.code = invalidServiceType; break; case 5: pVal->tm.dataField.telemetry.u.tm12.code = invalidServiceSubtype; break; case 6: pVal->tm.dataField.telemetry.u.tm12.code = invalidSourceID; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm12_code_unknown_enumeration_value; return FALSE; } /* Decode params (DataView.TMBlock-T.tm.dataField.telemetry.tm12.params) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm12.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tm.dataField.telemetry.u.tm12.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm12.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tm.dataField.telemetry.kind = tm12_PRESENT; break; case 2: /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm13.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm13.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm13.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm13.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tm.dataField.telemetry.kind = tm13_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm14.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm14.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm14.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm14.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TMBlock-T.tm.dataField.telemetry.tm14.code) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm14.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TMBlock-T.tm.dataField.telemetry.tm14.params) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm14.exist.params = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tm.dataField.telemetry.u.tm14.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm14.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tm.dataField.telemetry.kind = tm14_PRESENT; break; case 4: /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm15.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm15.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm15.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm15.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TMBlock-T.tm.dataField.telemetry.tm15.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm15.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tm.dataField.telemetry.kind = tm15_PRESENT; break; case 5: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm16.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm16.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm16.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm16.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode stepNumber (DataView.TMBlock-T.tm.dataField.telemetry.tm16.stepNumber) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm16.stepNumber.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TMBlock-T.tm.dataField.telemetry.tm16.code) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm16.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tm.dataField.telemetry.u.tm16.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm16.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TMBlock-T.tm.dataField.telemetry.tm16.params) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm16.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tm.dataField.telemetry.u.tm16.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm16.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tm.dataField.telemetry.kind = tm16_PRESENT; break; case 6: /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm17.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm17.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm17.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm17.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->tm.dataField.telemetry.kind = tm17_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode packetId (DataView.TMBlock-T.tm.dataField.telemetry.tm18.packetId) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm18.packetId.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSeqControl (DataView.TMBlock-T.tm.dataField.telemetry.tm18.packetSeqControl) OCTET STRING*/ nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm18.packetSeqControl.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode code (DataView.TMBlock-T.tm.dataField.telemetry.tm18.code) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm18.exist.code = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->tm.dataField.telemetry.u.tm18.exist.code = 1; nCount = 2; for(i1=0;i1<2;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm18.code.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TMBlock-T.tm.dataField.telemetry.tm18.params) OCTET STRING*/ pVal->tm.dataField.telemetry.u.tm18.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->tm.dataField.telemetry.u.tm18.exist.params = 1; nCount = 4; for(i1=0;i1<4;i1++) { if (!BitStream_ReadByte(pBitStrm, &pVal->tm.dataField.telemetry.u.tm18.params.arr[i1])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->tm.dataField.telemetry.kind = tm18_PRESENT; break; case 8: /* Decode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm51.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.telemetry.u.tm51.reportID = segmentHeader; break; case 1: pVal->tm.dataField.telemetry.u.tm51.reportID = packetHeader; break; case 2: pVal->tm.dataField.telemetry.u.tm51.reportID = dataField; break; case 3: pVal->tm.dataField.telemetry.u.tm51.reportID = tc55RID; break; case 4: pVal->tm.dataField.telemetry.u.tm51.reportID = tc56RID; break; case 5: pVal->tm.dataField.telemetry.u.tm51.reportID = tc81CommandID; break; case 6: pVal->tm.dataField.telemetry.u.tm51.reportID = tc81Params; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm51_reportID_unknown_enumeration_value; return FALSE; } pVal->tm.dataField.telemetry.kind = tm51_PRESENT; break; case 9: /* Decode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm52.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.telemetry.u.tm52.reportID = segmentHeader; break; case 1: pVal->tm.dataField.telemetry.u.tm52.reportID = packetHeader; break; case 2: pVal->tm.dataField.telemetry.u.tm52.reportID = dataField; break; case 3: pVal->tm.dataField.telemetry.u.tm52.reportID = tc55RID; break; case 4: pVal->tm.dataField.telemetry.u.tm52.reportID = tc56RID; break; case 5: pVal->tm.dataField.telemetry.u.tm52.reportID = tc81CommandID; break; case 6: pVal->tm.dataField.telemetry.u.tm52.reportID = tc81Params; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm52_reportID_unknown_enumeration_value; return FALSE; } pVal->tm.dataField.telemetry.kind = tm52_PRESENT; break; case 10: /* Decode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm53.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.telemetry.u.tm53.reportID = segmentHeader; break; case 1: pVal->tm.dataField.telemetry.u.tm53.reportID = packetHeader; break; case 2: pVal->tm.dataField.telemetry.u.tm53.reportID = dataField; break; case 3: pVal->tm.dataField.telemetry.u.tm53.reportID = tc55RID; break; case 4: pVal->tm.dataField.telemetry.u.tm53.reportID = tc56RID; break; case 5: pVal->tm.dataField.telemetry.u.tm53.reportID = tc81CommandID; break; case 6: pVal->tm.dataField.telemetry.u.tm53.reportID = tc81Params; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm53_reportID_unknown_enumeration_value; return FALSE; } pVal->tm.dataField.telemetry.kind = tm53_PRESENT; break; case 11: /* Decode reportID (DataView.TMBlock-T.tm.dataField.telemetry.tm54.reportID) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->tm.dataField.telemetry.u.tm54.reportID = segmentHeader; break; case 1: pVal->tm.dataField.telemetry.u.tm54.reportID = packetHeader; break; case 2: pVal->tm.dataField.telemetry.u.tm54.reportID = dataField; break; case 3: pVal->tm.dataField.telemetry.u.tm54.reportID = tc55RID; break; case 4: pVal->tm.dataField.telemetry.u.tm54.reportID = tc56RID; break; case 5: pVal->tm.dataField.telemetry.u.tm54.reportID = tc81CommandID; break; case 6: pVal->tm.dataField.telemetry.u.tm54.reportID = tc81Params; break; default: *pErrCode = ERR_TMBlock_T_tm_dataField_telemetry_tm54_reportID_unknown_enumeration_value; return FALSE; } pVal->tm.dataField.telemetry.kind = tm54_PRESENT; break; default: *pErrCode = ERR_Telemetry_T_unknown_choice_index; return FALSE; } return TRUE; } void TcBuffer_T_Initialize(TcBuffer_T* pVal) { int i1 = 0; for(i1 = 0; i1<20; i1++) { TC_T_Initialize(&pVal->arr[i1]); } } flag TcBuffer_T_IsConstraintValid(const TcBuffer_T* pVal, int* pErrCode) { int i1 = 0; if ( !(20==20) ) { *pErrCode = ERR_TcBuffer_T; return FALSE; } for(i1 = 0; i1<20; i1++) { if ( !TC_T_IsConstraintValid(&pVal->arr[i1], pErrCode)) return FALSE; } (void)pVal; /*Dummy statement, just to hide potential warning*/ (void)pErrCode; /*Dummy statement, just to hide potential warning*/ return TRUE; } flag TcBuffer_T_Encode(const TcBuffer_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; int i4 = 0; if (bCheckConstraints && !TcBuffer_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<20;i1++) { if (!TC_T_Encode(&pVal->arr[i1], pBitStrm, pErrCode, FALSE)) return FALSE; } return TRUE; } flag TcBuffer_T_Decode(TcBuffer_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; int i4 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; nCount = 20; for(i1=0;i1<20;i1++) { if (!TC_T_Decode(&pVal->arr[i1], pBitStrm, pErrCode)) return FALSE; } return TRUE; } flag TcBuffer_T_ACN_Encode(const TcBuffer_T* pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints) { int i1 = 0; int i2 = 0; int i3 = 0; int i4 = 0; if (bCheckConstraints && !TcBuffer_T_IsConstraintValid(pVal, pErrCode)) return FALSE; for(i1=0;i1<20;i1++) { /* Encode packetHeader (DataView.TcBuffer-T.myTC.packetHeader) SEQUENCE*/ /* Encode packetID (DataView.TcBuffer-T.myTC.packetHeader.packetID) OCTET STRING*/ for(i2=0;i2<2;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].packetHeader.packetID.arr[i2]); } /* Encode packetSequenceControl (DataView.TcBuffer-T.myTC.packetHeader.packetSequenceControl) OCTET STRING*/ for(i2=0;i2<2;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].packetHeader.packetSequenceControl.arr[i2]); } /* Encode packetLength (DataView.TcBuffer-T.myTC.packetHeader.packetLength) OCTET STRING*/ for(i2=0;i2<2;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].packetHeader.packetLength.arr[i2]); } /* Encode dataFieldHeader (DataView.TcBuffer-T.myTC.dataFieldHeader) SEQUENCE*/ /* Encode dfhInfo (DataView.TcBuffer-T.myTC.dataFieldHeader.dfhInfo) OCTET STRING*/ for(i2=0;i2<1;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataFieldHeader.dfhInfo.arr[i2]); } /* Encode serviceType (DataView.TcBuffer-T.myTC.dataFieldHeader.serviceType) OCTET STRING*/ for(i2=0;i2<1;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataFieldHeader.serviceType.arr[i2]); } /* Encode serviceSubtype (DataView.TcBuffer-T.myTC.dataFieldHeader.serviceSubtype) OCTET STRING*/ for(i2=0;i2<1;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataFieldHeader.serviceSubtype.arr[i2]); } /* Encode sourceID (DataView.TcBuffer-T.myTC.dataFieldHeader.sourceID) OCTET STRING*/ for(i2=0;i2<1;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataFieldHeader.sourceID.arr[i2]); } /* Encode dataField (DataView.TcBuffer-T.myTC.dataField) SEQUENCE*/ /* Encode key (DataView.TcBuffer-T.myTC.dataField.key) ENUMERATED*/ switch(pVal->arr[i1].dataField.key) { case tc55: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 4); break; case tc56: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 4); break; case tc81: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 4); break; case tc121: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 4); break; case tc122: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 4); break; case tc123: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 4); break; case tc125: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 4); break; case tc126: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 7, 4); break; case tc1210: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 8, 4); break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_key_unknown_enumeration_value; return FALSE; } /* Encode telecommand (DataView.TcBuffer-T.myTC.dataField.telecommand) CHOICE*/ switch(pVal->arr[i1].dataField.telecommand.kind) { case tc55_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 0, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc55.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc55.exist.rid);/* Encode numberRIDS (DataView.TcBuffer-T.myTC.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc55.exist.numberRIDS ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc55.numberRIDS.arr[i2]); } } /* Encode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc55.rid) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc55.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc55.rid.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc55.rid.nCount;i2++) { switch(pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc56_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 1, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc56.exist.numberRIDS); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc56.exist.rid);/* Encode numberRIDS (DataView.TcBuffer-T.myTC.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc56.exist.numberRIDS ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc56.numberRIDS.arr[i2]); } } /* Encode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc56.rid) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc56.exist.rid ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc56.rid.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc56.rid.nCount;i2++) { switch(pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2]) { case segmentHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 0, 3); break; case packetHeader: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 1, 3); break; case dataField: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 2, 3); break; case tc55RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 3, 3); break; case tc56RID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 4, 3); break; case tc81CommandID: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 5, 3); break; case tc81Params: Acn_Enc_Int_PositiveInteger_ConstSize(pBitStrm, 6, 3); break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } break; case tc81_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 2, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc81.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc81.exist.params);/* Encode functionId (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.functionId) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc81.functionId.arr[i2]); } /* Encode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.numberParams) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc81.exist.numberParams ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc81.numberParams.arr[i2]); } } /* Encode params (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc81.exist.params ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc81.params.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc81.params.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].exist.paramValue);/* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].paramID.arr[i3]); } /* Encode paramValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].exist.paramValue ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].paramValue.arr[i3]); } } } } break; case tc121_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 3, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc121.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc121.exist.paramID);/* Encode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc121.numberParams) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc121.exist.numberParams ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc121.numberParams.arr[i2]); } } /* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc121.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc121.paramID.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc121.paramID.nCount;i2++) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc121.paramID.arr[i2].arr[i3]); } } } break; case tc122_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 4, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc122.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc122.exist.paramID);/* Encode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc122.numberParams) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc122.exist.numberParams ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc122.numberParams.arr[i2]); } } /* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc122.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc122.paramID.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc122.paramID.nCount;i2++) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc122.paramID.arr[i2].arr[i3]); } } } break; case tc123_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 5, 0, 8); /* Encode maxReportingDelay (DataView.TcBuffer-T.myTC.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc123.maxReportingDelay.arr[i2]); } break; case tc125_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 6, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramMonitoringInterval); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.exist.valueRep); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.exist.deltaRep); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.exist.numberParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramID);/* Encode paramMonitoringInterval (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramMonitoringInterval ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i2]); } } /* Encode valueRep (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.valueRep) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.exist.valueRep ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.valueRep.arr[i2]); } } /* Encode deltaRep (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.exist.deltaRep ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.deltaRep.arr[i2]); } } /* Encode numberParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.numberParam) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.exist.numberParam ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.numberParam.arr[i2]); } } /* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.nCount, 1);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.nCount;i2++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nol); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nolSeq); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nod); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nodSeq); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noe); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noeSeq);/* Encode nol (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nol ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nol.arr[i3]); } } /* Encode nolSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nolSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.nCount, 3);for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.nCount;i3++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridHigh);/* Encode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.checkSelectionParam ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].checkSelectionParam.arr[i4]); } } /* Encode lowLimit (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].lowLimit.arr[i4]); } /* Encode ridLow (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridLow ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].ridLow.arr[i4]); } } /* Encode highLimit (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].highLimit.arr[i4]); } /* Encode ridHigh (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridHigh ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].ridHigh.arr[i4]); } } } } /* Encode nod (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nod ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nod.arr[i3]); } } /* Encode nodSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nodSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.nCount, 3);for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.nCount;i3++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridLow); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridHigh);/* Encode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.checkSelectionParam ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].checkSelectionParam.arr[i4]); } } /* Encode lowDelta (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].lowDelta.arr[i4]); } /* Encode ridLow (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridLow ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].ridLow.arr[i4]); } } /* Encode highDelta (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].highDelta.arr[i4]); } /* Encode ridHigh (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridHigh ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].ridHigh.arr[i4]); } } } } /* Encode noe (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noe ) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noe.arr[i3]); } } /* Encode noeSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noeSeq ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.nCount, 3);for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.nCount;i3++) { /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.checkSelectionParam); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.rid);/* Encode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.checkSelectionParam ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].checkSelectionParam.arr[i4]); } } /* Encode expectedValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].expectedValue.arr[i4]); } /* Encode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.rid ) { for(i4=0;i4<4;i4++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].rid.arr[i4]); } } } } } } break; case tc126_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 7, 0, 8); /* Encode Bit Mask for optional and default fields*/ BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc126.exist.numberParams); BitStream_AppendBit(pBitStrm,pVal->arr[i1].dataField.telecommand.u.tc126.exist.paramID);/* Encode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc126.numberParams) OCTET STRING*/ if (pVal->arr[i1].dataField.telecommand.u.tc126.exist.numberParams ) { for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc126.numberParams.arr[i2]); } } /* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ if (pVal->arr[i1].dataField.telecommand.u.tc126.exist.paramID ) { Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc126.paramID.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc126.paramID.nCount;i2++) { for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc126.paramID.arr[i2].arr[i3]); } } } break; case tc1210_PRESENT: BitStream_EncodeConstraintWholeNumber(pBitStrm, 8, 0, 8); /* Encode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ for(i2=0;i2<4;i2++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.numberParams.arr[i2]); } /* Encode params (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Enc_Length(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.nCount, 3);for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc1210.params.nCount;i2++) { /* Encode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].paramID.arr[i3]); } /* Encode paramValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].paramValue.arr[i3]); } /* Encode limitCrossed (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].limitCrossed.arr[i3]); } /* Encode previousCheckingStatus (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].previousCheckingStatus.arr[i3]); } /* Encode currentCheckingStatus (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].currentCheckingStatus.arr[i3]); } /* Encode transitionTime (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ for(i3=0;i3<4;i3++) { BitStream_AppendByte0(pBitStrm, pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].transitionTime.arr[i3]); } } break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } } return TRUE; } flag TcBuffer_T_ACN_Decode(TcBuffer_T* pVal, BitStream* pBitStrm, int* pErrCode) { int i1 = 0; int i2 = 0; int i3 = 0; int i4 = 0; asn1SccSint enumIndex = 0; asn1SccSint nChoiceIndex = 0; asn1SccSint nCount = 0; byte bitMask[1]; nCount = 20; for(i1=0;i1<20;i1++) { /* Decode packetHeader (DataView.TcBuffer-T.myTC.packetHeader) SEQUENCE*/ /* Decode packetID (DataView.TcBuffer-T.myTC.packetHeader.packetID) OCTET STRING*/ nCount = 2; for(i2=0;i2<2;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].packetHeader.packetID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetSequenceControl (DataView.TcBuffer-T.myTC.packetHeader.packetSequenceControl) OCTET STRING*/ nCount = 2; for(i2=0;i2<2;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].packetHeader.packetSequenceControl.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode packetLength (DataView.TcBuffer-T.myTC.packetHeader.packetLength) OCTET STRING*/ nCount = 2; for(i2=0;i2<2;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].packetHeader.packetLength.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataFieldHeader (DataView.TcBuffer-T.myTC.dataFieldHeader) SEQUENCE*/ /* Decode dfhInfo (DataView.TcBuffer-T.myTC.dataFieldHeader.dfhInfo) OCTET STRING*/ nCount = 1; for(i2=0;i2<1;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataFieldHeader.dfhInfo.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceType (DataView.TcBuffer-T.myTC.dataFieldHeader.serviceType) OCTET STRING*/ nCount = 1; for(i2=0;i2<1;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataFieldHeader.serviceType.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode serviceSubtype (DataView.TcBuffer-T.myTC.dataFieldHeader.serviceSubtype) OCTET STRING*/ nCount = 1; for(i2=0;i2<1;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataFieldHeader.serviceSubtype.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode sourceID (DataView.TcBuffer-T.myTC.dataFieldHeader.sourceID) OCTET STRING*/ nCount = 1; for(i2=0;i2<1;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataFieldHeader.sourceID.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode dataField (DataView.TcBuffer-T.myTC.dataField) SEQUENCE*/ /* Decode key (DataView.TcBuffer-T.myTC.dataField.key) ENUMERATED*/ if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 4)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->arr[i1].dataField.key = tc55; break; case 1: pVal->arr[i1].dataField.key = tc56; break; case 2: pVal->arr[i1].dataField.key = tc81; break; case 3: pVal->arr[i1].dataField.key = tc121; break; case 4: pVal->arr[i1].dataField.key = tc122; break; case 5: pVal->arr[i1].dataField.key = tc123; break; case 6: pVal->arr[i1].dataField.key = tc125; break; case 7: pVal->arr[i1].dataField.key = tc126; break; case 8: pVal->arr[i1].dataField.key = tc1210; break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_key_unknown_enumeration_value; return FALSE; } /* Decode telecommand (DataView.TcBuffer-T.myTC.dataField.telecommand) CHOICE*/ /* &&& */ if (!BitStream_DecodeConstraintWholeNumber(pBitStrm, &nChoiceIndex, 0, 8)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(nChoiceIndex) { case 0: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TcBuffer-T.myTC.dataField.telecommand.tc55.numberRIDS) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc55.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc55.exist.numberRIDS = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc55.numberRIDS.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc55.rid) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc55.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc55.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc55.rid.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc55.rid.nCount;i2++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = segmentHeader; break; case 1: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = packetHeader; break; case 2: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = dataField; break; case 3: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = tc55RID; break; case 4: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = tc56RID; break; case 5: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = tc81CommandID; break; case 6: pVal->arr[i1].dataField.telecommand.u.tc55.rid.arr[i2] = tc81Params; break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_telecommand_tc55_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->arr[i1].dataField.telecommand.kind = tc55_PRESENT; break; case 1: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberRIDS (DataView.TcBuffer-T.myTC.dataField.telecommand.tc56.numberRIDS) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc56.exist.numberRIDS = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc56.exist.numberRIDS = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc56.numberRIDS.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc56.rid) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc56.exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc56.exist.rid = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc56.rid.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc56.rid.nCount;i2++) { if (!Acn_Dec_Int_PositiveInteger_ConstSize(pBitStrm, &enumIndex, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } switch(enumIndex) { case 0: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = segmentHeader; break; case 1: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = packetHeader; break; case 2: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = dataField; break; case 3: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = tc55RID; break; case 4: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = tc56RID; break; case 5: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = tc81CommandID; break; case 6: pVal->arr[i1].dataField.telecommand.u.tc56.rid.arr[i2] = tc81Params; break; default: *pErrCode = ERR_TcBuffer_T_myTC_dataField_telecommand_tc56_rid_elem_unknown_enumeration_value; return FALSE; } } } pVal->arr[i1].dataField.telecommand.kind = tc56_PRESENT; break; case 2: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode functionId (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.functionId) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc81.functionId.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.numberParams) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc81.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc81.exist.numberParams = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc81.numberParams.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode params (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc81.exist.params = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc81.exist.params = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc81.params.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc81.params.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 1)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params..paramID) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].paramID.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc81.params..paramValue) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].exist.paramValue = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].exist.paramValue = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc81.params.arr[i2].paramValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } pVal->arr[i1].dataField.telecommand.kind = tc81_PRESENT; break; case 3: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc121.numberParams) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc121.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc121.exist.numberParams = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc121.numberParams.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc121.paramID) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc121.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc121.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc121.paramID.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc121.paramID.nCount;i2++) { nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc121.paramID.arr[i2].arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->arr[i1].dataField.telecommand.kind = tc121_PRESENT; break; case 4: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc122.numberParams) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc122.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc122.exist.numberParams = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc122.numberParams.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc122.paramID) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc122.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc122.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc122.paramID.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc122.paramID.nCount;i2++) { nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc122.paramID.arr[i2].arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->arr[i1].dataField.telecommand.kind = tc122_PRESENT; break; case 5: /* Decode maxReportingDelay (DataView.TcBuffer-T.myTC.dataField.telecommand.tc123.maxReportingDelay) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc123.maxReportingDelay.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } pVal->arr[i1].dataField.telecommand.kind = tc123_PRESENT; break; case 6: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 5)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode paramMonitoringInterval (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramMonitoringInterval) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramMonitoringInterval = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramMonitoringInterval.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode valueRep (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.valueRep) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.exist.valueRep = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.exist.valueRep = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.valueRep.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode deltaRep (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.deltaRep) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.exist.deltaRep = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.exist.deltaRep = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.deltaRep.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode numberParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.numberParam) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.exist.numberParam = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.exist.numberParam = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.numberParam.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramID = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 1); pVal->arr[i1].dataField.telecommand.u.tc125.paramID.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.nCount;i2++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 6)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode nol (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nol) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nol = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nol = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nol.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nolSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nolSeq = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nolSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.nCount = (long)nCount; for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.nCount;i3++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.checkSelectionParam = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].checkSelectionParam.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowLimit (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..lowLimit) OCTET STRING*/ nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].lowLimit.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..ridLow) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridLow = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].ridLow.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highLimit (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..highLimit) OCTET STRING*/ nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].highLimit.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nolSeq..ridHigh) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].exist.ridHigh = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nolSeq.arr[i3].ridHigh.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode nod (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nod) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nod = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nod = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nod.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode nodSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nodSeq = 0; if ((bitMask[0] & 0x10) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.nodSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.nCount = (long)nCount; for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.nCount;i3++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 3)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.checkSelectionParam = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].checkSelectionParam.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode lowDelta (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..lowDelta) OCTET STRING*/ nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].lowDelta.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridLow (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..ridLow) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridLow = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridLow = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].ridLow.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode highDelta (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..highDelta) OCTET STRING*/ nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].highDelta.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode ridHigh (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..nodSeq..ridHigh) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridHigh = 0; if ((bitMask[0] & 0x20) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].exist.ridHigh = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].nodSeq.arr[i3].ridHigh.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } /* Decode noe (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noe) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noe = 0; if ((bitMask[0] & 0x08) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noe = 1; nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noe.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode noeSeq (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noeSeq = 0; if ((bitMask[0] & 0x04) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].exist.noeSeq = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.nCount = (long)nCount; for(i3=0;i3<pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.nCount;i3++) { /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode checkSelectionParam (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..checkSelectionParam) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.checkSelectionParam = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.checkSelectionParam = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].checkSelectionParam.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode expectedValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..expectedValue) OCTET STRING*/ nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].expectedValue.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode rid (DataView.TcBuffer-T.myTC.dataField.telecommand.tc125.paramID..noeSeq..rid) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.rid = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].exist.rid = 1; nCount = 4; for(i4=0;i4<4;i4++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc125.paramID.arr[i2].noeSeq.arr[i3].rid.arr[i4])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } } } } pVal->arr[i1].dataField.telecommand.kind = tc125_PRESENT; break; case 7: /* Decode Bit Mask for optional and default fields*/ if (!BitStream_ReadBits(pBitStrm, bitMask, 2)) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } /* Decode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc126.numberParams) OCTET STRING*/ pVal->arr[i1].dataField.telecommand.u.tc126.exist.numberParams = 0; if ((bitMask[0] & 0x80) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc126.exist.numberParams = 1; nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc126.numberParams.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc126.paramID) SEQUENCE OF*/ pVal->arr[i1].dataField.telecommand.u.tc126.exist.paramID = 0; if ((bitMask[0] & 0x40) != 0 ) { pVal->arr[i1].dataField.telecommand.u.tc126.exist.paramID = 1; Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc126.paramID.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc126.paramID.nCount;i2++) { nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc126.paramID.arr[i2].arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } } pVal->arr[i1].dataField.telecommand.kind = tc126_PRESENT; break; case 8: /* Decode numberParams (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.numberParams) OCTET STRING*/ nCount = 4; for(i2=0;i2<4;i2++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.numberParams.arr[i2])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode params (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params) SEQUENCE OF*/ Acn_Dec_Length(pBitStrm, &nCount, 3); pVal->arr[i1].dataField.telecommand.u.tc1210.params.nCount = (long)nCount; for(i2=0;i2<pVal->arr[i1].dataField.telecommand.u.tc1210.params.nCount;i2++) { /* Decode paramID (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..paramID) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].paramID.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode paramValue (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..paramValue) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].paramValue.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode limitCrossed (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..limitCrossed) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].limitCrossed.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode previousCheckingStatus (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..previousCheckingStatus) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].previousCheckingStatus.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode currentCheckingStatus (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..currentCheckingStatus) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].currentCheckingStatus.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } /* Decode transitionTime (DataView.TcBuffer-T.myTC.dataField.telecommand.tc1210.params..transitionTime) OCTET STRING*/ nCount = 4; for(i3=0;i3<4;i3++) { if (!BitStream_ReadByte(pBitStrm, &pVal->arr[i1].dataField.telecommand.u.tc1210.params.arr[i2].transitionTime.arr[i3])) { *pErrCode = ERR_INSUFFICIENT_DATA; return FALSE; } } } pVal->arr[i1].dataField.telecommand.kind = tc1210_PRESENT; break; default: *pErrCode = ERR_Telecommand_T_unknown_choice_index; return FALSE; } } return TRUE; }
Class System.Collections.Generic.List`1[[System.Byte, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] has no such attribute: Length in template context [mainSrc anonymous PrintTypeAssigment PrintInitialize SEQUENCE_init if(!v)_subtemplate anonymous PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate <invoke SetCount arg context>] Class tinyAsn1.OctetStringValue has no such attribute: NumberOfOctets in template context [mainSrc anonymous PrintTypeAssigment PrintInitialize SEQUENCE_init if(!v)_subtemplate anonymous PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate] Class System.Collections.Generic.List`1[[System.Byte, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] has no such attribute: Length in template context [mainSrc anonymous PrintTypeAssigment anonymous uPER_encBodies PrintDecodeBody SEQUENCE_decode anonymous if(ch.IsOptionalOrHasDefaultValue)_subtemplate if(ch.m_defaultValue)_subtemplate PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate <invoke SetCount arg context>] Class tinyAsn1.OctetStringValue has no such attribute: NumberOfOctets in template context [mainSrc anonymous PrintTypeAssigment anonymous uPER_encBodies PrintDecodeBody SEQUENCE_decode anonymous if(ch.IsOptionalOrHasDefaultValue)_subtemplate if(ch.m_defaultValue)_subtemplate PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate] Class System.Collections.Generic.List`1[[System.Byte, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] has no such attribute: Length in template context [mainSrc anonymous PrintTypeAssigment anonymous ACN_encBodies PrintAcnDecodeBody SEQUENCE_acn_decode anonymous if(ch.IsOptionalOrHasDefaultValue)_subtemplate if(ch.m_defaultValue)_subtemplate PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate <invoke SetCount arg context>] Class tinyAsn1.OctetStringValue has no such attribute: NumberOfOctets in template context [mainSrc anonymous PrintTypeAssigment anonymous ACN_encBodies PrintAcnDecodeBody SEQUENCE_acn_decode anonymous if(ch.IsOptionalOrHasDefaultValue)_subtemplate if(ch.m_defaultValue)_subtemplate PrintInitialize ReferenceType_init if(v)_subtemplate PrintInitialize OctetString_init BitString_init if(v)_subtemplate] [32mCompilation of generated sources failed - is gcc installed? (report inside '/tmp/tmpkH7vLy.asn1c/ShowNativeBuffers.stats.err') [0m Failed while executing:
Attachment:
ShowNativeBuffers.stats.err
Description: ShowNativeBuffers.stats.err
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |