OpenV2G
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
AbstractDecoderChannel.c File Reference
#include "DecoderChannel.h"
#include "EXIConfig.h"
#include "EXIOptions.h"
#include "BitInputStream.h"
#include "EXITypes.h"
#include "MethodsBag.h"
#include "ErrorCodes.h"

Macros

#define ABSTRACT_DECODER_CHANNEL_C
 
#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_64   10
 
#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_32   5
 

Functions

int decodeUnsignedInteger (bitstream_t *stream, exi_integer_t *iv)
 Decode unsigned integer. More...
 
int decodeUnsignedInteger16 (bitstream_t *stream, uint16_t *uint16)
 Decode unsigned integer. More...
 
int decodeUnsignedInteger32 (bitstream_t *stream, uint32_t *uint32)
 Decode unsigned integer. More...
 
int decodeUnsignedInteger64 (bitstream_t *stream, uint64_t *uint64)
 Decode unsigned integer. More...
 
int decodeInteger (bitstream_t *stream, exi_integer_t *iv)
 Decode integer. More...
 
int decodeInteger16 (bitstream_t *stream, int16_t *int16)
 Decode integer. More...
 
int decodeInteger32 (bitstream_t *stream, int32_t *int32)
 Decode integer. More...
 
int decodeInteger64 (bitstream_t *stream, int64_t *int64)
 Decode integer. More...
 
int decodeFloat (bitstream_t *stream, exi_float_me_t *f)
 Decode float. More...
 
int decodeDecimal (bitstream_t *stream, exi_decimal_t *d)
 Decode decimal. More...
 
int decodeStringOnly (bitstream_t *stream, uint16_t len, exi_string_t *s)
 Decode String (no length prefix) More...
 
int decodeString (bitstream_t *stream, exi_string_t *s)
 Decode String. More...
 
int decodeStringValue (bitstream_t *stream, exi_state_t *state, uint16_t qnameID, exi_string_value_t *s)
 Decode String value. More...
 
int decodeRCSStringValue (bitstream_t *stream, exi_state_t *state, uint16_t qnameID, exi_rcs_t *rcs, exi_string_value_t *s)
 Decode Restricted characters set string value. More...
 
int decodeCharacters (bitstream_t *stream, uint16_t len, exi_string_character_t *chars)
 Decode characters. More...
 
int decodeRCSCharacters (bitstream_t *stream, uint16_t len, exi_string_character_t *chars, uint16_t rcsCodeLength, uint16_t rcsSize, const exi_string_character_t rcsSet[])
 Decode restricted character set characters. More...
 
int decodeBinary (bitstream_t *stream, exi_bytes_t *bytes)
 Decode Binary. More...
 
int decodeBytes (bitstream_t *stream, uint16_t len, uint8_t *data)
 Decode Binary data. More...
 
int decodeDateTime (bitstream_t *stream, exi_datetime_type_t type, exi_datetime_t *datetime)
 Decode DateTime. More...
 

Macro Definition Documentation

#define ABSTRACT_DECODER_CHANNEL_C
#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_32   5
#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_64   10

Function Documentation

int decodeBinary ( bitstream_t stream,
exi_bytes_t bytes 
)

Decode Binary.

Decode a binary value as a length-prefixed sequence of octets.

int decodeBytes ( bitstream_t stream,
uint16_t  len,
uint8_t *  data 
)

Decode Binary data.

Decode a sequence of octets.

Parameters
streamInput Stream
lenLength
dataBytes (out)
Returns
Error-Code <> 0
int decodeCharacters ( bitstream_t stream,
uint16_t  len,
exi_string_character_t chars 
)

Decode characters.

Decode a sequence of characters according to a given length. Each character is represented by its UCS [ISO/IEC 10646] code point encoded as an Unsigned Integer

int decodeDateTime ( bitstream_t stream,
exi_datetime_type_t  type,
exi_datetime_t datetime 
)

Decode DateTime.

Decode Date-Time as sequence of values representing the individual components of the Date-Time.

int decodeDecimal ( bitstream_t stream,
exi_decimal_t d 
)

Decode decimal.

Decode a decimal represented as a Boolean sign followed by two Unsigned Integers. A sign value of zero (0) is used to represent positive Decimal values and a sign value of one (1) is used to represent negative Decimal values The first Integer represents the integral portion of the Decimal value. The second positive integer represents the fractional portion of the decimal with the digits in reverse order to preserve leading zeros.

int decodeFloat ( bitstream_t stream,
exi_float_me_t f 
)

Decode float.

Decode a Float datatype as two consecutive Integers. The first Integer represents the mantissa of the floating point number and the second Integer represents the base-10 exponent of the floating point number.

int decodeInteger ( bitstream_t stream,
exi_integer_t iv 
)

Decode integer.

Decode an arbitrary precision integer using a sign bit followed by a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

Parameters
streamInput Stream
ivInteger Value 64 bits (out)
Returns
Error-Code <> 0
int decodeInteger16 ( bitstream_t stream,
int16_t *  int16 
)

Decode integer.

Decode an arbitrary precision integer using a sign bit followed by a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

int decodeInteger32 ( bitstream_t stream,
int32_t *  int32 
)

Decode integer.

Decode an arbitrary precision integer using a sign bit followed by a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

int decodeInteger64 ( bitstream_t stream,
int64_t *  int64 
)

Decode integer.

Decode an arbitrary precision integer using a sign bit followed by a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

int decodeRCSCharacters ( bitstream_t stream,
uint16_t  len,
exi_string_character_t chars,
uint16_t  rcsCodeLength,
uint16_t  rcsSize,
const exi_string_character_t  rcsSet[] 
)

Decode restricted character set characters.

Decode a sequence of characters according to a given length and rcs code-length, size and set.

Parameters
streamInput Stream
lenLength
charsCharacters (out)
rcsCodeLengthRCS code-length
rcsCodeLengthRCS size
rcsCodeLengthRCS set
Returns
Error-Code <> 0
int decodeRCSStringValue ( bitstream_t stream,
exi_state_t state,
uint16_t  qnameID,
exi_rcs_t rcs,
exi_string_value_t s 
)

Decode Restricted characters set string value.

Parameters
streamInput Stream
stateCodec state
qnameIDQualified Name ID
rcsRestricted character set
sString Value (out)
Returns
Error-Code <> 0
int decodeString ( bitstream_t stream,
exi_string_t s 
)

Decode String.

Decode a length prefixed sequence of characters.

int decodeStringOnly ( bitstream_t stream,
uint16_t  len,
exi_string_t s 
)

Decode String (no length prefix)

Decode a sequence of characters for a given length.

int decodeStringValue ( bitstream_t stream,
exi_state_t state,
uint16_t  qnameID,
exi_string_value_t s 
)

Decode String value.

Decode a length prefixed sequence of characters in the sense of string tables. length == 0: local value partition hit. length == 1: global value partition hit. length > 1: string literal is encoded as a String with the length incremented by two

Parameters
streamInput Stream
stateCodec state
qnameIDQualified Name ID
sString Value (out)
Returns
Error-Code <> 0
int decodeUnsignedInteger ( bitstream_t stream,
exi_integer_t iv 
)

Decode unsigned integer.

Decode an arbitrary precision non negative integer using a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

Parameters
streamInput Stream
ivUnsigned Integer Value (out)
Returns
Error-Code <> 0
int decodeUnsignedInteger16 ( bitstream_t stream,
uint16_t *  uint16 
)

Decode unsigned integer.

Decode an arbitrary precision non negative integer using a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

Parameters
streamInput Stream
uint16Unsigned Integer Value 16 bits (out)
Returns
Error-Code <> 0
int decodeUnsignedInteger32 ( bitstream_t stream,
uint32_t *  uint32 
)

Decode unsigned integer.

Decode an arbitrary precision non negative integer using a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

Parameters
streamInput Stream
uint32Unsigned Integer Value 32 bits (out)
Returns
Error-Code <> 0
int decodeUnsignedInteger64 ( bitstream_t stream,
uint64_t *  uint64 
)

Decode unsigned integer.

Decode an arbitrary precision non negative integer using a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.