OpenV2G
Functions
DecoderChannel.h File Reference

EXI Decoder Channel. More...

#include "EXIOptions.h"
#include "EXITypes.h"

Go to the source code of this file.

Functions

int decode (bitstream_t *stream, uint8_t *b)
 Decode byte value. More...
 
int decodeBoolean (bitstream_t *stream, int *b)
 Decode boolean. More...
 
int decodeNBitUnsignedInteger (bitstream_t *stream, size_t nbits, uint32_t *uint32)
 Decode n-bit unsigned integer. More...
 
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 decodeUnsignedIntegerSizeT (bitstream_t *stream, size_t *sizeT)
 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, size_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_value_string_table_t *stringTable, size_t namespaceUriID, size_t localNameID, exi_string_value_t *s)
 Decode String value. More...
 
int decodeRCSStringValue (bitstream_t *stream, exi_value_string_table_t *stringTable, size_t namespaceUriID, size_t localNameID, exi_rcs_t *rcs, exi_string_value_t *s)
 Decode Restricted characters set string value. More...
 
int decodeCharacters (bitstream_t *stream, size_t len, exi_string_character_t *chars, size_t charsSize)
 Decode characters. More...
 
int decodeRCSCharacters (bitstream_t *stream, size_t len, exi_string_character_t *chars, size_t charsSize, size_t rcsCodeLength, size_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, size_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...
 

Detailed Description

EXI Decoder Channel.

Function Documentation

◆ decode()

int decode ( bitstream_t stream,
uint8_t *  b 
)

Decode byte value.

Parameters
streamInput Stream
bbyte (out)
Returns
Error-Code <> 0

◆ decodeBinary()

int decodeBinary ( bitstream_t stream,
exi_bytes_t bytes 
)

Decode Binary.

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

Parameters
streamInput Stream
bytesBytes (out)
Returns
Error-Code <> 0

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

◆ decodeBoolean()

int decodeBoolean ( bitstream_t stream,
int *  b 
)

Decode boolean.

Decode a single boolean value. The value false is represented by 0, and the value true is represented by 1.

Parameters
streamInput Stream
bboolean (out)
Returns
Error-Code <> 0

◆ decodeBytes()

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

Decode Binary data.

Decode a sequence of octets.

Parameters
streamInput Stream
lenLength
dataBytes (out)
Returns
Error-Code <> 0

◆ decodeCharacters()

int decodeCharacters ( bitstream_t stream,
size_t  len,
exi_string_character_t chars,
size_t  charsSize 
)

Decode characters.

Decode a sequence of characters according to a given length.

Parameters
streamInput Stream
lenLength
charsCharacters (out)
charsSizeSize of possible characters
Returns
Error-Code <> 0

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

◆ decodeDateTime()

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.

Parameters
streamInput Stream
typeDatetime type
datetimeDatetime (out)
Returns
Error-Code <> 0

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

◆ decodeDecimal()

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.

Parameters
streamInput Stream
dDecimal Value (out)
Returns
Error-Code <> 0

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.

◆ decodeFloat()

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.

Parameters
streamInput Stream
fFloat Value (out)
Returns
Error-Code <> 0

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.

◆ decodeInteger()

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

◆ decodeInteger16()

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.

Parameters
streamInput Stream
int16Integer Value 16 bits (out)
Returns
Error-Code <> 0

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.

◆ decodeInteger32()

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.

Parameters
streamInput Stream
int32Integer Value 32 bits (out)
Returns
Error-Code <> 0

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.

◆ decodeInteger64()

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.

Parameters
streamInput Stream
int64Integer Value 64 bits (out)
Returns
Error-Code <> 0

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.

◆ decodeNBitUnsignedInteger()

int decodeNBitUnsignedInteger ( bitstream_t stream,
size_t  nbits,
uint32_t *  uint32 
)

Decode n-bit unsigned integer.

Decodes and returns an n-bit unsigned integer.

Parameters
streamInput Stream
nbitsNumber of bits
uint32Value (out)
Returns
Error-Code <> 0

Decodes and returns an n-bit unsigned integer using the minimum number of bytes required for n bits.

◆ decodeRCSCharacters()

int decodeRCSCharacters ( bitstream_t stream,
size_t  len,
exi_string_character_t chars,
size_t  charsSize,
size_t  rcsCodeLength,
size_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)
charsSizeSize of possible characters
rcsCodeLengthRCS code-length
rcsCodeLengthRCS size
rcsCodeLengthRCS set
Returns
Error-Code <> 0

◆ decodeRCSStringValue()

int decodeRCSStringValue ( bitstream_t stream,
exi_value_string_table_t stringTable,
size_t  namespaceUriID,
size_t  localNameID,
exi_rcs_t rcs,
exi_string_value_t s 
)

Decode Restricted characters set string value.

Parameters
streamInput Stream
stringTableStringTable
namespaceUriIDqualified namespace ID
localNameIDqualified localName ID
rcsRestricted character set
sString Value (out)
Returns
Error-Code <> 0

◆ decodeString()

int decodeString ( bitstream_t stream,
exi_string_t s 
)

Decode String.

Decode a length prefixed sequence of characters.

Parameters
streamInput Stream
sString Value (out)
Returns
Error-Code <> 0

Decode a length prefixed sequence of characters.

◆ decodeStringOnly()

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

Decode String (no length prefix)

Decode a sequence of characters for a given length.

Parameters
streamInput Stream
lenCharacters length
sString Value (out)
Returns
Error-Code <> 0

Decode a sequence of characters for a given length.

◆ decodeStringValue()

int decodeStringValue ( bitstream_t stream,
exi_value_string_table_t stringTable,
size_t  namespaceUriID,
size_t  localNameID,
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
stringTableString Table
qnameIDQualified Name ID
namespaceUriIDQualified Namespace ID
localNameIDQualified LocalName ID
sString Value (out)
Returns
Error-Code <> 0

◆ decodeUnsignedInteger()

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

◆ decodeUnsignedInteger16()

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

◆ decodeUnsignedInteger32()

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

◆ decodeUnsignedInteger64()

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.

Parameters
streamInput Stream
uint64Unsigned Integer Value 64 bits (out)
Returns
Error-Code <> 0

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.

◆ decodeUnsignedIntegerSizeT()

int decodeUnsignedIntegerSizeT ( bitstream_t stream,
size_t *  sizeT 
)

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
sizeTUnsigned Integer Value (out)
Returns
Error-Code <> 0