OpenV2G
Functions
EncoderChannel.h File Reference

EXI Encoder Channel. More...

#include "EXITypes.h"

Go to the source code of this file.

Functions

int encode (bitstream_t *stream, uint8_t b)
 Encode byte value. More...
 
int encodeBoolean (bitstream_t *stream, int b)
 Encode a single boolean value. More...
 
int encodeNBitUnsignedInteger (bitstream_t *stream, size_t nbits, uint32_t val)
 Encode n-bit unsigned integer. More...
 
int encodeUnsignedInteger (bitstream_t *stream, exi_integer_t *iv)
 Encode unsigned integer. More...
 
int encodeUnsignedInteger16 (bitstream_t *stream, uint16_t n)
 Encode unsigned integer. More...
 
int encodeUnsignedInteger32 (bitstream_t *stream, uint32_t n)
 Encode unsigned integer. More...
 
int encodeUnsignedInteger64 (bitstream_t *stream, uint64_t n)
 Encode unsigned integer. More...
 
int encodeInteger (bitstream_t *stream, exi_integer_t *iv)
 Encode integer. More...
 
int encodeInteger16 (bitstream_t *stream, int16_t n)
 Encode integer. More...
 
int encodeInteger32 (bitstream_t *stream, int32_t n)
 Encode integer. More...
 
int encodeInteger64 (bitstream_t *stream, int64_t n)
 Encode integer. More...
 
int encodeFloat (bitstream_t *stream, exi_float_me_t *f)
 Encode float. More...
 
int encodeDecimal (bitstream_t *stream, exi_decimal_t *d)
 Encode decimal. More...
 
int encodeString (bitstream_t *stream, exi_string_t *string)
 Encode string. More...
 
int encodeStringValue (bitstream_t *stream, exi_value_string_table_t *stringTable, size_t namespaceUriID, size_t localNameID, exi_string_value_t *string)
 Encode string value. More...
 
int encodeRCSStringValue (bitstream_t *stream, exi_value_string_table_t *stringTable, size_t namespaceUriID, size_t localNameID, exi_rcs_t *rcs, exi_string_value_t *string)
 Encode restricted character set value. More...
 
int encodeCharacters (bitstream_t *stream, exi_string_character_t *chars, size_t len)
 Encode characters. More...
 
int encodeRCSCharacters (bitstream_t *stream, exi_string_character_t *chars, size_t len, size_t rcsCodeLength, size_t rcsSize, const exi_string_character_t rcsSet[])
 Encode characters. More...
 
int encodeBinary (bitstream_t *stream, exi_bytes_t *bytes)
 Encode binary. More...
 
int encodeBytes (bitstream_t *stream, uint8_t *data, size_t len)
 Encode binary data. More...
 
int encodeDateTime (bitstream_t *stream, exi_datetime_t *datetime)
 Encode datetime. More...
 
int encodeFinish (bitstream_t *stream)
 Flush underlying bit output stream. More...
 

Detailed Description

EXI Encoder Channel.

Function Documentation

◆ encode()

int encode ( bitstream_t stream,
uint8_t  b 
)

Encode byte value.

Parameters
streamOutput Stream
bbyte
Returns
Error-Code <> 0

◆ encodeBinary()

int encodeBinary ( bitstream_t stream,
exi_bytes_t bytes 
)

Encode binary.

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

Parameters
streamOutput Stream
bytesByte values
Returns
Error-Code <> 0

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

◆ encodeBoolean()

int encodeBoolean ( bitstream_t stream,
int  b 
)

Encode a single boolean value.

A false value is encoded as 0 and true value is encode as 1.

Parameters
streamOutput Stream
bboolean
Returns
Error-Code <> 0

Encode a single boolean value. A false value is encoded as bit 0 and true value is encode as bit 1.

◆ encodeBytes()

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

Encode binary data.

Encode a sequence of octets.

Parameters
streamOutput Stream
dataByte values
lenLength
Returns
Error-Code <> 0

◆ encodeCharacters()

int encodeCharacters ( bitstream_t stream,
exi_string_character_t chars,
size_t  len 
)

Encode characters.

Encode 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.

Parameters
streamOutput Stream
charsCharacters
lenNumbr of characters
Returns
Error-Code <> 0

Encode 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

◆ encodeDateTime()

int encodeDateTime ( bitstream_t stream,
exi_datetime_t datetime 
)

Encode datetime.

Encode a datetime representation which is a sequence of values representing the individual components of the Date-Time.

Parameters
streamOutput Stream
datetimeDatetime values
Returns
Error-Code <> 0

Encode a datetime representation which is a sequence of values representing the individual components of the Date-Time

◆ encodeDecimal()

int encodeDecimal ( bitstream_t stream,
exi_decimal_t d 
)

Encode decimal.

Encode 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
streamOutput Stream
dDecimal value
Returns
Error-Code <> 0

Encode 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.

◆ encodeFinish()

int encodeFinish ( bitstream_t stream)

Flush underlying bit output stream.

Parameters
streamOutput Stream
Returns
Error-Code <> 0

Flush underlying output stream.

◆ encodeFloat()

int encodeFloat ( bitstream_t stream,
exi_float_me_t f 
)

Encode float.

Encode 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
streamOutput Stream
fFloat value
Returns
Error-Code <> 0

The Float datatype representation is 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.

◆ encodeInteger()

int encodeInteger ( bitstream_t stream,
exi_integer_t iv 
)

Encode integer.

Encode an arbitrary precision integer using a sign boolean 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
streamOutput Stream
ivInteger value
Returns
Error-Code <> 0

◆ encodeInteger16()

int encodeInteger16 ( bitstream_t stream,
int16_t  n 
)

Encode integer.

Encode an arbitrary precision integer using a sign boolean 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
streamOutput Stream
nInteger value 16 bits
Returns
Error-Code <> 0

Encode 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.

◆ encodeInteger32()

int encodeInteger32 ( bitstream_t stream,
int32_t  n 
)

Encode integer.

Encode an arbitrary precision integer using a sign boolean 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
streamOutput Stream
nInteger value 32 bits
Returns
Error-Code <> 0

Encode 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.

◆ encodeInteger64()

int encodeInteger64 ( bitstream_t stream,
int64_t  n 
)

Encode integer.

Encode an arbitrary precision integer using a sign boolean 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
streamOutput Stream
nInteger value 64 bits
Returns
Error-Code <> 0

Encode 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.

◆ encodeNBitUnsignedInteger()

int encodeNBitUnsignedInteger ( bitstream_t stream,
size_t  nbits,
uint32_t  val 
)

Encode n-bit unsigned integer.

The n least significant bits of parameter b starting with the most significant, i.e. from left to right.

Parameters
streamOutput Stream
nbitsnumber of bits
valvalue
Returns
Error-Code <> 0

Encode n-bit unsigned integer. The n least significant bits of parameter b starting with the most significant, i.e. from left to right.

◆ encodeRCSCharacters()

int encodeRCSCharacters ( bitstream_t stream,
exi_string_character_t chars,
size_t  len,
size_t  rcsCodeLength,
size_t  rcsSize,
const exi_string_character_t  rcsSet[] 
)

Encode characters.

Encode 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.

Parameters
streamOutput Stream
charsCharacters
lenNumbr of characters
rcsCodeLengthRCS code-length
rcsCodeLengthRCS size
rcsCodeLengthRCS set
Returns
Error-Code <> 0

◆ encodeRCSStringValue()

int encodeRCSStringValue ( bitstream_t stream,
exi_value_string_table_t stringTable,
size_t  namespaceUriID,
size_t  localNameID,
exi_rcs_t rcs,
exi_string_value_t string 
)

Encode restricted character set value.

Encode a length prefixed sequence of characters in the sense of string tables

Parameters
streamOutput Stream
StringTableStringTable
namespaceUriIDQualified Namespace ID
localNameIDQualified LocalName ID
rcsRestricted character set
stringString value
Returns
Error-Code <> 0

◆ encodeString()

int encodeString ( bitstream_t stream,
exi_string_t string 
)

Encode string.

Encode a length prefixed sequence of characters.

Parameters
streamOutput Stream
stringString
Returns
Error-Code <> 0

Encode a length prefixed sequence of characters.

◆ encodeStringValue()

int encodeStringValue ( bitstream_t stream,
exi_value_string_table_t stringTable,
size_t  namespaceUriID,
size_t  localNameID,
exi_string_value_t string 
)

Encode string value.

Encode a length prefixed sequence of characters in the sense of string tables

Parameters
streamOutput Stream
stringTableString Table
namespaceUriIDQualified Namespace ID
localNameIDQualified LocalName ID
stringString value
Returns
Error-Code <> 0

◆ encodeUnsignedInteger()

int encodeUnsignedInteger ( bitstream_t stream,
exi_integer_t iv 
)

Encode unsigned integer.

Encode 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
streamOutput Stream
ivUnsigned integer value
Returns
Error-Code <> 0

◆ encodeUnsignedInteger16()

int encodeUnsignedInteger16 ( bitstream_t stream,
uint16_t  n 
)

Encode unsigned integer.

Encode 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
streamOutput Stream
nUnsigned integer value 16 bits
Returns
Error-Code <> 0

Encode 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.

◆ encodeUnsignedInteger32()

int encodeUnsignedInteger32 ( bitstream_t stream,
uint32_t  n 
)

Encode unsigned integer.

Encode 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
streamOutput Stream
nUnsigned integer value 32 bits
Returns
Error-Code <> 0

Encode 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.

◆ encodeUnsignedInteger64()

int encodeUnsignedInteger64 ( bitstream_t stream,
uint64_t  n 
)

Encode unsigned integer.

Encode 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
streamOutput Stream
nUnsigned integer value 64 bits
Returns
Error-Code <> 0

Encode 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.