Commit c5c89915 authored by Maxime Perrotin's avatar Maxime Perrotin

Update configuration files

parent bfda62a8
......@@ -13,8 +13,6 @@ extern "C" {
typedef asn1SccUint __po_hi_c_Node_Addr_T;
flag __po_hi_c_Node_Addr_T_Equal(const __po_hi_c_Node_Addr_T* pVal1, const __po_hi_c_Node_Addr_T* pVal2);
void __po_hi_c_Node_Addr_T_Initialize(__po_hi_c_Node_Addr_T* pVal);
#define ERR_NODE_ADDR_T 1 /**/
......@@ -24,7 +22,9 @@ typedef enum {
__po_hi_c_mil1553b = 1
} __po_hi_c_Standard_T;
flag __po_hi_c_Standard_T_Equal(const __po_hi_c_Standard_T* pVal1, const __po_hi_c_Standard_T* pVal2);
// please use the following macros to avoid breaking code.
#define __po_hi_c_Standard_T_mil1553a __po_hi_c_mil1553a
#define __po_hi_c_Standard_T_mil1553b __po_hi_c_mil1553b
void __po_hi_c_Standard_T_Initialize(__po_hi_c_Standard_T* pVal);
......@@ -36,7 +36,10 @@ typedef enum {
__po_hi_c_monitor = 2
} __po_hi_c_Mode_T;
flag __po_hi_c_Mode_T_Equal(const __po_hi_c_Mode_T* pVal1, const __po_hi_c_Mode_T* pVal2);
// please use the following macros to avoid breaking code.
#define __po_hi_c_Mode_T_controller __po_hi_c_controller
#define __po_hi_c_Mode_T_terminal __po_hi_c_terminal
#define __po_hi_c_Mode_T_monitor __po_hi_c_monitor
void __po_hi_c_Mode_T_Initialize(__po_hi_c_Mode_T* pVal);
......@@ -49,7 +52,11 @@ typedef enum {
__po_hi_c_both = 3
} __po_hi_c_Bus_T;
flag __po_hi_c_Bus_T_Equal(const __po_hi_c_Bus_T* pVal1, const __po_hi_c_Bus_T* pVal2);
// please use the following macros to avoid breaking code.
#define __po_hi_c_Bus_T_none __po_hi_c_none
#define __po_hi_c_Bus_T_bus_a __po_hi_c_bus_a
#define __po_hi_c_Bus_T_bus_b __po_hi_c_bus_b
#define __po_hi_c_Bus_T_both __po_hi_c_both
void __po_hi_c_Bus_T_Initialize(__po_hi_c_Bus_T* pVal);
......@@ -57,7 +64,6 @@ void __po_hi_c_Bus_T_Initialize(__po_hi_c_Bus_T* pVal);
flag __po_hi_c_Bus_T_IsConstraintValid(const __po_hi_c_Bus_T* pVal, int* pErrCode);
/*-- __po_hi_c_mil_1553_conf_t --------------------------------------------*/
typedef char __po_hi_c_mil_1553_conf_t_devname[21];
typedef struct {
__po_hi_c_mil_1553_conf_t_devname devname;
__po_hi_c_Standard_T standard;
......@@ -75,21 +81,18 @@ typedef struct {
} __po_hi_c_mil_1553_conf_t;
flag __po_hi_c_mil_1553_conf_t_devname_Equal(const __po_hi_c_mil_1553_conf_t_devname val1, const __po_hi_c_mil_1553_conf_t_devname val2);
flag __po_hi_c_mil_1553_conf_t_Equal(const __po_hi_c_mil_1553_conf_t* pVal1, const __po_hi_c_mil_1553_conf_t* pVal2);
void __po_hi_c_mil_1553_conf_t_devname_Initialize(__po_hi_c_mil_1553_conf_t_devname val);
void __po_hi_c_mil_1553_conf_t_Initialize(__po_hi_c_mil_1553_conf_t* pVal);
#define ERR_MIL_1553_CONF_T 105 /**/
#define ERR_MIL_1553_CONF_T_DEVNAME 29 /**/
#define ERR_MIL_1553_CONF_T_STANDARD 36 /**/
#define ERR_MIL_1553_CONF_T_MODE 47 /**/
#define ERR_MIL_1553_CONF_T_BUS 58 /**/
#define ERR_MIL_1553_CONF_T_TERMADDR 69 /**/
#define ERR_MIL_1553_CONF_T_BROADCAST 80 /**/
#define ERR_MIL_1553_CONF_T_RXBLOCK 87 /**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 94 /**/
#define ERR_MIL_1553_CONF_T_STANDARD_2 43 /**/
#define ERR_MIL_1553_CONF_T_MODE_2 55 /**/
#define ERR_MIL_1553_CONF_T_BUS_2 67 /**/
#define ERR_MIL_1553_CONF_T_TERMADDR_2 79 /**/
#define ERR_MIL_1553_CONF_T_BROADCAST 84 /**/
#define ERR_MIL_1553_CONF_T_RXBLOCK 91 /**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 98 /**/
flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t* pVal, int* pErrCode);
......@@ -107,4 +110,4 @@ flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t
#endif
#endif
\ No newline at end of file
#endif
#ifndef ASN1SCC_ASN1CRT_H_
#define ASN1SCC_ASN1CRT_H_
#if (!defined(_MSC_VER) || _MSC_VER >= 1800)
# ifndef SWIG
# include <stdbool.h>
# endif
#else
typedef unsigned char bool;
#define true 1
#define false 0
#endif
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#include <cstdint>
#else
// C99 check
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
# include <stdbool.h>
# include <stdint.h>
#else
typedef unsigned char bool;
# define true 1
# define false 0
typedef unsigned char uint8_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif
#endif /* __cplusplus */
#ifndef NULL
#define NULL 0
......@@ -35,20 +49,19 @@ extern "C" {
#define FP_WORD_SIZE 8
#endif
#define OBJECT_IDENTIFIER_MAX_LENGTH 20
typedef float asn1Real32;
typedef double asn1Real64;
typedef uint8_t byte;
typedef int32_t asn1SccSint32;
typedef uint32_t asn1SccUint32;
typedef unsigned char byte;
typedef int asn1SccSint32;
typedef unsigned int asn1SccUint32;
typedef long long asn1SccSint64;
typedef unsigned long long asn1SccUint64;
typedef int64_t asn1SccSint64;
typedef uint64_t asn1SccUint64;
#if WORD_SIZE==8
typedef asn1SccUint64 asn1SccUint;
......@@ -58,6 +71,9 @@ typedef asn1SccUint32 asn1SccUint;
typedef asn1SccSint32 asn1SccSint;
#endif
asn1SccUint int2uint(asn1SccSint v);
asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes);
#if FP_WORD_SIZE==8
typedef asn1Real64 asn1Real;
#else
......@@ -78,14 +94,29 @@ typedef bool flag;
typedef char NullType;
typedef struct {
struct BitStream_t;
typedef void(*PushDataFnc)(struct BitStream_t* pThis, void* pushDataPrm);
typedef void(*FetchDataFnc)(struct BitStream_t* pThis, void* fetchDataPrm);
typedef struct BitStream_t {
byte* buf;
long count;
long currentByte;
/* Next available bit for writting. Possible vallues 0..7, 0 is most significant bit of current byte*/
/* Next available bit for writting.
Possible vallues 0..7, 0 is most significant
bit of current byte*/
int currentBit;
PushDataFnc pushData;
void* pushDataPrm;
FetchDataFnc fetchData;
void* fetchDataPrm;
} BitStream;
typedef struct {
byte* buf;
long count;
......@@ -108,6 +139,10 @@ typedef struct {
int nCount;
} XmlAttributeArray;
typedef struct {
int nCount;
asn1SccUint values[OBJECT_IDENTIFIER_MAX_LENGTH];
} Asn1ObjectIdentifier;
#define ERR_INSUFFICIENT_DATA 101
#define ERR_INCORRECT_PER_STREAM 102
......@@ -117,293 +152,85 @@ typedef struct {
#define ERR_INVALID_BER_FILE 201
#define ERR_BER_LENGTH_MISMATCH 202
/* Bit strean functions */
void BitStream_Init(BitStream* pBitStrm, unsigned char* buf, long count);
void BitStream_AttachBuffer(BitStream* pBitStrm, unsigned char* buf, long count);
void BitStream_AppendBit(BitStream* pBitStrm, flag v);
void BitStream_AppendBits(BitStream* pBitStrm, const byte* srcBuffer, int nBitsToWrite);
void BitStream_AppendByte(BitStream* pBitStrm, byte v, flag negate);
void BitStream_AppendByte0(BitStream* pBitStrm, byte v);
void ByteStream_Init(ByteStream* pStrm, byte* buf, long count);
void ByteStream_AttachBuffer(ByteStream* pStrm, unsigned char* buf, long count);
asn1SccSint ByteStream_GetLength(ByteStream* pStrm);
asn1SccSint BitStream_GetLength(BitStream* pBitStrm);
void BitStream_AppendBitOne(BitStream* pBitStrm);
void BitStream_AppendBitZero(BitStream* pBitStrm);
flag BitStream_ReadBit(BitStream* pBitStrm, flag* v);
flag BitStream_ReadBits(BitStream* pBitStrm, byte* BuffToWrite, int nBitsToRead);
flag BitStream_ReadByte(BitStream* pBitStrm, byte* v);
/* Integer functions */
void BitStream_EncodeUnConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v);
void BitStream_EncodeSemiConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v, asn1SccSint min);
void BitStream_EncodeSemiConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint v, asn1SccUint min);
void BitStream_EncodeConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v, asn1SccSint min, asn1SccSint max);
void BitStream_EncodeConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint v, asn1SccUint min, asn1SccUint max);
flag BitStream_DecodeUnConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v);
flag BitStream_DecodeSemiConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v, asn1SccSint min);
flag BitStream_DecodeSemiConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint* v, asn1SccUint min);
flag BitStream_DecodeConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v, asn1SccSint min, asn1SccSint max);
flag BitStream_DecodeConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint* v, asn1SccUint min, asn1SccUint max);
void BitStream_EncodeReal(BitStream* pBitStrm, asn1Real v);
flag BitStream_DecodeReal(BitStream* pBitStrm, asn1Real* v);
void CalculateMantissaAndExponent(asn1Real d, int* exp, asn1SccUint64* mantissa);
asn1Real GetDoubleByMantissaAndExp(asn1SccUint mantissa, int exp);
int GetNumberOfBitsForNonNegativeInteger(asn1SccUint v);
int GetCharIndex(char ch, byte allowedCharSet[], int setLen);
/*
db ,ad8888ba, 888b 88 88888888888 88
d88b d8"' `"8b 8888b 88 88 ,d ""
d8'`8b d8' 88 `8b 88 88 88
d8' `8b 88 88 `8b 88 88aaaaa 88 88 8b,dPPYba, ,adPPYba, MM88MMM 88 ,adPPYba, 8b,dPPYba, ,adPPYba,
d8YaaaaY8b 88 88 `8b 88 88""""" 88 88 88P' `"8a a8" "" 88 88 a8" "8a 88P' `"8a I8[ ""
d8""""""""8b Y8, 88 `8b 88 88 88 88 88 88 8b 88 88 8b d8 88 88 `"Y8ba,
d8' `8b Y8a. .a8P 88 `8888 88 "8a, ,a88 88 88 "8a, ,aa 88, 88 "8a, ,a8" 88 88 aa ]8I
d8' `8b `"Y8888Y"' 88 `888 88 `"YbbdP'Y8 88 88 `"Ybbd8"' "Y888 88 `"YbbdP"' 88 88 `"YbbdP"
void ObjectIdentifier_Init(Asn1ObjectIdentifier *pVal);
flag ObjectIdentifier_equal(const Asn1ObjectIdentifier *pVal1, const Asn1ObjectIdentifier *pVal2);
flag ObjectIdentifier_isValid(const Asn1ObjectIdentifier *pVal);
flag RelativeOID_isValid(const Asn1ObjectIdentifier *pVal);
/* Time Classes
Asn1LocalTime, // TIME-OF-DAY ::= TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=L")
Asn1UtcTime, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=Z")
Asn1LocalTimeWithTimeZone, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=LD")
Asn1Date, // DATE ::= TIME(SETTINGS "Basic=Date Date=YMD Year=Basic")
Asn1Date_LocalTime, // DATE-TIME ::= TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=L")
Asn1Date_UtcTime, // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=Z")
Asn1Date_LocalTimeWithTimeZone // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=LD")
*/
typedef struct {
int sign; //-1 or +1
int hours;
int mins;
} Asn1TimeZone;
void Acn_AlignToNextByte(BitStream* pBitStrm);
void Acn_AlignToNextWord(BitStream* pBitStrm);
void Acn_AlignToNextDWord(BitStream* pBitStrm);
/*ACN Integer functions*/
void Acn_Enc_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInBits);
void Acn_Enc_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBits);
void Acn_Enc_Int_TwosComplement_ConstSize_8(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_TwosComplement_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInNibbles);
void Acn_Enc_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint intVal); /*encoding ends when 'F' is reached*/
void Acn_Enc_SInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBytes);
void Acn_Enc_SInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal);
void Acn_Enc_SInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint intVal, byte null_character); /*encoding ends when null_character is reached*/
void Acn_Enc_UInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInBytes);
void Acn_Enc_UInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal);
void Acn_Enc_UInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint intVal, byte null_character); /*encoding ends when null_character is reached*/
/*ACN Decode Integer functions*/
flag Acn_Dec_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInBits);
flag Acn_Dec_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBits);
flag Acn_Dec_Int_TwosComplement_ConstSize_8(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_TwosComplement_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInNibbles);
flag Acn_Dec_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal);
/*encoding ends when 'F' is reached*/
flag Acn_Dec_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_SInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBytes);
flag Acn_Dec_SInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal);
flag Acn_Dec_SInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint* pIntVal, byte null_character);
flag Acn_Dec_UInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInBytes);
flag Acn_Dec_UInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal);
flag Acn_Dec_UInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint* pIntVal, byte null_character);
/*flag Acn_Dec_Int_ASCII_NullTerminated_FormattedInteger(BitStream* pBitStrm, const char* format, asn1SccSint* pIntVal);*/
/* Boolean Decode */
flag BitStream_ReadBitPattern(BitStream* pBitStrm, const byte* patternToRead, int nBitsToRead, flag* pBoolValue);
/*Real encoding functions*/
void Acn_Enc_Real_IEEE754_32_big_endian(BitStream* pBitStrm, asn1Real realValue);
void Acn_Enc_Real_IEEE754_64_big_endian(BitStream* pBitStrm, asn1Real realValue);
void Acn_Enc_Real_IEEE754_32_little_endian(BitStream* pBitStrm, asn1Real realValue);
void Acn_Enc_Real_IEEE754_64_little_endian(BitStream* pBitStrm, asn1Real realValue);
flag Acn_Dec_Real_IEEE754_32_big_endian(BitStream* pBitStrm, asn1Real* pRealValue);
flag Acn_Dec_Real_IEEE754_64_big_endian(BitStream* pBitStrm, asn1Real* pRealValue);
flag Acn_Dec_Real_IEEE754_32_little_endian(BitStream* pBitStrm, asn1Real* pRealValue);
flag Acn_Dec_Real_IEEE754_64_little_endian(BitStream* pBitStrm, asn1Real* pRealValue);
/*String functions*/
void Acn_Enc_String_Ascii_FixSize (BitStream* pBitStrm, asn1SccSint max, const char* strVal);
void Acn_Enc_String_Ascii_Null_Teminated (BitStream* pBitStrm, asn1SccSint max, char null_character, const char* strVal);
void Acn_Enc_String_Ascii_External_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, const char* strVal);
void Acn_Enc_String_Ascii_Internal_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, const char* strVal);
void Acn_Enc_String_CharIndex_FixSize (BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, const char* strVal);
void Acn_Enc_String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, const char* strVal);
void Acn_Enc_String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint min, const char* strVal);
void Acn_Enc_IA5String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, const char* strVal);
void Acn_Enc_IA5String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, const char* strVal);
flag Acn_Dec_String_Ascii_FixSize (BitStream* pBitStrm, asn1SccSint max, char* strVal);
flag Acn_Dec_String_Ascii_Null_Teminated (BitStream* pBitStrm, asn1SccSint max, char null_character, char* strVal);
flag Acn_Dec_String_Ascii_External_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint extSizeDeterminatFld, char* strVal);
flag Acn_Dec_String_Ascii_Internal_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, char* strVal);
flag Acn_Dec_String_CharIndex_FixSize (BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, char* strVal);
flag Acn_Dec_String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint extSizeDeterminatFld, char* strVal);
flag Acn_Dec_String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint min, char* strVal);
flag Acn_Dec_IA5String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, asn1SccSint extSizeDeterminatFld, char* strVal);
flag Acn_Dec_IA5String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, char* strVal);
/* Length Determinant functions*/
void Acn_Enc_Length(BitStream* pBitStrm, asn1SccUint lengthValue, int lengthSizeInBits);
flag Acn_Dec_Length(BitStream* pBitStrm, asn1SccUint* pLengthValue, int lengthSizeInBits);
void BitStream_AppendNBitZero(BitStream* pBitStrm, int nbits);
void BitStream_EncodeNonNegativeInteger(BitStream* pBitStrm, asn1SccUint v);
void BitStream_AppendNBitOne(BitStream* pBitStrm, int nbits);
void BitStream_EncodeNonNegativeIntegerNeg(BitStream* pBitStrm, asn1SccUint v, flag negate);
flag BitStream_DecodeNonNegativeInteger(BitStream* pBitStrm, asn1SccUint* v, int nBits);
flag BitStream_ReadPartialByte(BitStream* pBitStrm, byte *v, byte nbits);
void BitStream_AppendPartialByte(BitStream* pBitStrm, byte v, byte nbits, flag negate);
void Xer_EncodeXmlHeader(ByteStream* pByteStrm, const char* xmlHeader);
flag Xer_EncodeComment(ByteStream* pByteStrm, const char* comment, int *pErrCode);
typedef struct {
int hours;
int mins;
int secs;
int fraction;
Asn1TimeZone tz;
} Asn1TimeWithTimeZone;
flag Xer_EncodeInteger(ByteStream* pByteStrm, const char* elementTag, asn1SccSint value, int *pErrCode, int level);
flag Xer_EncodePosInteger(ByteStream* pByteStrm, const char* elementTag, asn1SccUint value, int *pErrCode, int level);
flag Xer_EncodeBoolean(ByteStream* pByteStrm, const char* elementTag, flag value, int *pErrCode, int level);
flag Xer_EncodeEnumerated(ByteStream* pByteStrm, const char* elementTag, const char* value, int *pErrCode, int level);
flag Xer_EncodeReal(ByteStream* pByteStrm, const char* elementTag, asn1Real value, int *pErrCode, int level);
flag Xer_EncodeString(ByteStream* pByteStrm, const char* elementTag, const char* value, int *pErrCode, int level);
flag Xer_EncodeOctetString(ByteStream* pByteStrm, const char* elementTag, const byte value[], int nCount, int *pErrCode, int level);
flag Xer_EncodeBitString(ByteStream* pByteStrm, const char* elementTag, const byte value[], int nCount, int *pErrCode, int level);
typedef struct {
int hours;
int mins;
int secs;
int fraction;
} Asn1UtcTime;
typedef struct {
int hours;
int mins;
int secs;
int fraction;
} Asn1LocalTime;
typedef struct {
int years;
int months;
int days;
} Asn1Date;
flag Xer_DecodeInteger(ByteStream* pByteStrm, const char* elementTag, asn1SccSint* value, int *pErrCode);
flag Xer_DecodePosInteger(ByteStream* pByteStrm, const char* elementTag, asn1SccUint* value, int *pErrCode);
flag Xer_DecodeBoolean(ByteStream* pByteStrm, const char* elementTag, flag* value, int *pErrCode);
flag Xer_DecodeEnumerated(ByteStream* pByteStrm, const char* elementTag, char* value, int *pErrCode);
flag Xer_DecodeReal(ByteStream* pByteStrm, const char* elementTag, asn1Real* value, int *pErrCode);
flag Xer_DecodeString(ByteStream* pByteStrm, const char* elementTag, char* value, int *pErrCode);
flag Xer_DecodeOctetString(ByteStream* pByteStrm, const char* elementTag, byte value[], int bufferMaxSize, int* nCount, int *pErrCode);
flag Xer_DecodeBitString(ByteStream* pByteStrm, const char* elementTag, byte value[], int bufferMaxSize, int* nCount, int *pErrCode);
flag Xer_EncodeComplexElementStart(ByteStream* pByteStrm, const char* elementTag, XmlAttributeArray* pAttrs, int *pErrCode, int level);
flag Xer_EncodeComplexElementEnd(ByteStream* pByteStrm, const char* elementTag, int *pErrCode, int level);
flag Xer_DecodeComplexElementStart(ByteStream* pByteStrm, const char* elementTag, XmlAttributeArray* pAttrs, int *pErrCode);
flag Xer_DecodeComplexElementEnd(ByteStream* pByteStrm, const char* elementTag, int *pErrCode);
flag Xer_NextEndElementIs(ByteStream* pByteStrm, const char* elementTag);
flag Xer_NextStartElementIs(ByteStream* pByteStrm, const char* elementTag);
flag Xer_LA_NextElementTag(ByteStream* pByteStrm, char* elementTag);
flag LoadXmlFile(const char* fileName, ByteStream* pStrm, int* nBytesLoaded);
typedef struct {
Asn1Date date;
Asn1LocalTime time;
} Asn1DateLocalTime;
typedef struct {
Asn1Date date;
Asn1UtcTime time;
} Asn1DateUtcTime;
typedef struct {
Asn1Date date;
Asn1TimeWithTimeZone time;
} Asn1DateTimeWithTimeZone;
typedef enum {
Asn1TC_LocalTimeStamp,
Asn1TC_UtcTimeStamp,
Asn1TC_LocalTimeTZStamp
} Asn1TimeZoneClass;
typedef asn1SccUint BerTag;
flag BerEncodeTag(ByteStream* pByteStrm, BerTag tag, int *pErrCode);
flag BerDecodeTag(ByteStream* pByteStrm, BerTag tag, int *pErrCode);
flag BerEncodeLengthStart(ByteStream* pByteStrm, int *pErrCode);
flag BerEncodeLengthEnd(ByteStream* pByteStrm, int *pErrCode);
flag BerDecodeLength(ByteStream* pByteStrm, int* value, int *pErrCode);
flag BerDecodeTwoZeroes(ByteStream* pByteStrm, int *pErrCode);
flag BerEncodeInteger(ByteStream* pByteStrm, BerTag tag, asn1SccSint value, int *pErrCode);
flag BerDecodeInteger(ByteStream* pByteStrm, BerTag tag, asn1SccSint *value, int *pErrCode);
flag BerEncodeBoolean(ByteStream* pByteStrm, BerTag tag, flag value, int *pErrCode);
flag BerDecodeBoolean(ByteStream* pByteStrm, BerTag tag, flag *value, int *pErrCode);
flag BerEncodeReal(ByteStream* pByteStrm, BerTag tag, asn1Real value, int *pErrCode);
flag BerDecodeReal(ByteStream* pByteStrm, BerTag tag, asn1Real *value, int *pErrCode);
flag BerEncodeIA5String(ByteStream* pByteStrm, BerTag tag, const char* value, int length, int *pErrCode);
flag BerDecodeIA5String(ByteStream* pByteStrm, BerTag tag, char* value, int maxLength, int *pErrCode);
flag BerEncodeNull(ByteStream* pByteStrm, BerTag tag, int *pErrCode);
flag BerDecodeNull(ByteStream* pByteStrm, BerTag tag, int *pErrCode);
flag BerEncodeBitString(ByteStream* pByteStrm, BerTag tag, const byte* value, int bitCount, int *pErrCode);
flag BerDecodeBitString(ByteStream* pByteStrm, BerTag tag, byte* value, int *bitCount, int maxBitCount, int *pErrCode);
flag BerEncodeOctetString(ByteStream* pByteStrm, BerTag tag, const byte* value, int octCount, int *pErrCode);
flag BerDecodeOctetString(ByteStream* pByteStrm, BerTag tag, byte* value, int *octCount, int maxOctCount, int *pErrCode);
flag NextTagMatches(ByteStream* pByteStrm, BerTag tag);
flag LA_Next_Two_Bytes_00(ByteStream* pByteStrm);
asn1SccSint milbus_encode(asn1SccSint val);
asn1SccSint milbus_decode(asn1SccSint val);
#if WORD_SIZE==8
extern const asn1SccUint64 ber_aux[];
#else
extern const asn1SccUint32 ber_aux[];
#endif
asn1SccUint int2uint(asn1SccSint v);
asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes);
#define CHECK_BIT_STREAM(pBitStrm) assert((pBitStrm)->currentByte*8+(pBitStrm)->currentBit<=(pBitStrm)->count*8)
#ifdef _MSC_VER
......
......@@ -16,7 +16,10 @@ typedef enum {
__po_hi_c_d2M = 2
} __po_hi_c_Datarate_T;
flag __po_hi_c_Datarate_T_Equal(const __po_hi_c_Datarate_T* pVal1, const __po_hi_c_Datarate_T* pVal2);
// please use the following macros to avoid breaking code.
#define __po_hi_c_Datarate_T_d250K __po_hi_c_d250K
#define __po_hi_c_Datarate_T_d1M __po_hi_c_d1M
#define __po_hi_c_Datarate_T_d2M __po_hi_c_d2M
void __po_hi_c_Datarate_T_Initialize(__po_hi_c_Datarate_T* pVal);
......@@ -28,13 +31,13 @@ typedef struct {
} __po_hi_c_Address_T;
flag __po_hi_c_Address_T_Equal(const __po_hi_c_Address_T* pVal1, const __po_hi_c_Address_T* pVal2);
void __po_hi_c_Address_T_Initialize(__po_hi_c_Address_T* pVal);
#define ERR_ADDRESS_T 8 /**/
flag __po_hi_c_Address_T_IsConstraintValid(const __po_hi_c_Address_T* pVal, int* pErrCode);
/*-- __po_hi_c_bluetooth_conf_t --------------------------------------------*/
typedef asn1SccUint __po_hi_c_bluetooth_conf_t_channel;
typedef struct {
__po_hi_c_bluetooth_conf_t_channel channel;
__po_hi_c_Datarate_T datarate;
......@@ -47,15 +50,13 @@ typedef struct {
} __po_hi_c_bluetooth_conf_t;
flag __po_hi_c_bluetooth_conf_t_channel_Equal(const __po_hi_c_bluetooth_conf_t_channel* pVal1, const __po_hi_c_bluetooth_conf_t_channel* pVal2);
flag __po_hi_c_bluetooth_conf_t_Equal(const __po_hi_c_bluetooth_conf_t* pVal1, const __po_hi_c_bluetooth_conf_t* pVal2);
void __po_hi_c_bluetooth_conf_t_channel_Initialize(__po_hi_c_bluetooth_conf_t_channel* pVal);
void __po_hi_c_bluetooth_conf_t_Initialize(__po_hi_c_bluetooth_conf_t* pVal);
#define ERR_BLUETOOTH_CONF_T_CHANNEL 14 /**/
#define ERR_BLUETOOTH_CONF_T_DATARATE 21 /**/
#define ERR_BLUETOOTH_CONF_T 46 /**/
#define ERR_BLUETOOTH_CONF_T_CHANNEL 15 /**/
#define ERR_BLUETOOTH_CONF_T_DATARATE_2 29 /**/
#define ERR_BLUETOOTH_CONF_T_ADDRESS_2 41 /**/
flag __po_hi_c_bluetooth_conf_t_IsConstraintValid(const __po_hi_c_bluetooth_conf_t* pVal, int* pErrCode);
extern const __po_hi_c_bluetooth_conf_t crazyflie_default;
......@@ -73,4 +74,4 @@ extern const __po_hi_c_bluetooth_conf_t crazyflie_default;
#endif
#endif
\ No newline at end of file
#endif
......@@ -13,8 +13,6 @@ extern "C" {
typedef asn1SccUint __po_hi_c_Port_T;
flag __po_hi_c_Port_T_Equal(const __po_hi_c_Port_T* pVal1, const __po_hi_c_Port_T* pVal2);
void __po_hi_c_Port_T_Initialize(__po_hi_c_Port_T* pVal);
#define ERR_PORT_T 1 /**/
......@@ -24,7 +22,9 @@ typedef enum {
__po_hi_c_ipv6 = 1
} __po_hi_c_Version_T;
flag __po_hi_c_Version_T_Equal(const __po_hi_c_Version_T* pVal1, const __po_hi_c_Version_T* pVal2);
// please use the following macros to avoid breaking code.
#define __po_hi_c_Version_T_ipv4 __po_hi_c_ipv4
#define __po_hi_c_Version_T_ipv6 __po_hi_c_ipv6
void __po_hi_c_Version_T_Initialize(__po_hi_c_Version_T* pVal);
......@@ -37,7 +37,6 @@ typedef char __po_hi_c_ip_conf_t_broadcast[41];
typedef char __po_hi_c_ip_conf_t_netmask[41];
typedef char __po_hi_c_ip_conf_t_gateway[41];
typedef char __po_hi_c_ip_conf_t_dns[41];
typedef struct {
__po_hi_c_ip_conf_t_devname devname;
__po_hi_c_ip_conf_t_address address;
......@@ -58,20 +57,6 @@ typedef struct {
} __po_hi_c_ip_conf_t;
flag __po_hi_c_ip_conf_t_devname_Equal(const __po_hi_c_ip_conf_t_devname val1, const __po_hi_c_ip_conf_t_devname val2);
flag __po_hi_c_ip_conf_t_address_Equal(const __po_hi_c_ip_conf_t_address val1, const __po_hi_c_ip_conf_t_address val2);
flag __po_hi_c_ip_conf_t_broadcast_Equal(const __po_hi_c_ip_conf_t_broadcast val1, const __po_hi_c_ip_conf_t_broadcast val2);
flag __po_hi_c_ip_conf_t_netmask_Equal(const __po_hi_c_ip_conf_t_netmask val1, const __po_hi_c_ip_conf_t_netmask val2);
flag __po_hi_c_ip_conf_t_gateway_Equal(const __po_hi_c_ip_conf_t_gateway val1, const __po_hi_c_ip_conf_t_gateway val2);
flag __po_hi_c_ip_conf_t_dns_Equal(const __po_hi_c_ip_conf_t_dns val1, const __po_hi_c_ip_conf_t_dns val2);
flag __po_hi_c_ip_conf_t_Equal(const __po_hi_c_ip_conf_t* pVal1, const __po_hi_c_ip_conf_t* pVal2);