123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441 |
- /*
- * Copyright (C) 2007-2018 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 2017-03-02
- * @contact Richard.Kuntschke@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- * <p>Schema: V2G_CI_MsgDef.xsd</p>
- *
- *
- ********************************************************************/
- /**
- * \file DecoderChannel.h
- * \brief EXI Decoder Channel
- *
- */
- #ifndef DECODER_CHANNEL_H
- #define DECODER_CHANNEL_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "EXIOptions.h"
- #include "EXITypes.h"
- /**
- * \brief Decode byte value
- *
- * \param stream Input Stream
- * \param b byte (out)
- * \return Error-Code <> 0
- *
- */
- int decode(bitstream_t* stream, uint8_t* b);
- /**
- * \brief Decode boolean
- *
- * Decode a single boolean value. The value false is
- * represented by 0, and the value true is represented by 1.
- *
- * \param stream Input Stream
- * \param b boolean (out)
- * \return Error-Code <> 0
- *
- */
- int decodeBoolean(bitstream_t* stream, int* b);
- /**
- * \brief Decode n-bit unsigned integer
- *
- * Decodes and returns an n-bit unsigned integer.
- *
- * \param stream Input Stream
- * \param nbits Number of bits
- * \param uint32 Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint32_t* uint32);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param iv Unsigned Integer Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param uint16 Unsigned Integer Value 16 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param uint32 Unsigned Integer Value 32 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param sizeT Unsigned Integer Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedIntegerSizeT(bitstream_t* stream, size_t* sizeT);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param uint64 Unsigned Integer Value 64 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param size size array
- * \param data data array
- * \param len length array
- * \return Error-Code <> 0
- *
- */
- int decodeUnsignedIntegerBig(bitstream_t* stream, size_t size, uint8_t* data, size_t* len);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param iv Integer Value 64 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeInteger(bitstream_t* stream, exi_integer_t* iv);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param int16 Integer Value 16 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeInteger16(bitstream_t* stream, int16_t* int16);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param int32 Integer Value 32 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeInteger32(bitstream_t* stream, int32_t* int32);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param int64 Integer Value 64 bits (out)
- * \return Error-Code <> 0
- *
- */
- int decodeInteger64(bitstream_t* stream, int64_t* int64);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param negative negative integer
- * \param size size array
- * \param data data array
- * \param len length array
- * \return Error-Code <> 0
- *
- */
- int decodeIntegerBig(bitstream_t* stream, int* negative, size_t size, uint8_t* data, size_t* len);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param f Float Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeFloat(bitstream_t* stream, exi_float_me_t* f);
- /**
- * \brief 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.
- *
- * \param stream Input Stream
- * \param d Decimal Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeDecimal(bitstream_t* stream, exi_decimal_t* d);
- /**
- * \brief Decode String (no length prefix)
- *
- * Decode a sequence of characters for a given length.
- *
- * \param stream Input Stream
- * \param len Characters length
- * \param s String Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeStringOnly(bitstream_t* stream, size_t len, exi_string_t* s);
- /**
- * \brief Decode String
- *
- * Decode a length prefixed sequence of characters.
- *
- * \param stream Input Stream
- * \param s String Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeString(bitstream_t* stream, exi_string_t* s);
- /**
- * \brief 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
- *
- * \param stream Input Stream
- * \param stringTable String Table
- * \param qnameID Qualified Name ID
- * \param namespaceUriID Qualified Namespace ID
- * \param localNameID Qualified LocalName ID
- * \param s String Value (out)
- * \return Error-Code <> 0
- *
- */
- int decodeStringValue(bitstream_t* stream, exi_value_string_table_t* stringTable, size_t namespaceUriID, size_t localNameID, exi_string_value_t* s);
- /**
- * \brief Decode Restricted characters set string value
- *
- * \param stream Input Stream
- * \param stringTable StringTable
- * \param namespaceUriID qualified namespace ID
- * \param localNameID qualified localName ID
- * \param rcs Restricted character set
- * \param s String Value (out)
- * \return Error-Code <> 0
- *
- */
- 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);
- /**
- * \brief Decode characters
- *
- * Decode a sequence of characters according to a given length.
- *
- * \param stream Input Stream
- * \param len Length
- * \param chars Characters (out)
- * \param charsSize Size of possible characters
- * \return Error-Code <> 0
- *
- */
- int decodeCharacters(bitstream_t* stream, size_t len, exi_string_character_t* chars, size_t charsSize);
- /**
- * \brief Decode restricted character set characters
- *
- * Decode a sequence of characters according to a given length and rcs code-length, size and set.
- *
- * \param stream Input Stream
- * \param len Length
- * \param chars Characters (out)
- * \param charsSize Size of possible characters
- * \param rcsCodeLength RCS code-length
- * \param rcsCodeLength RCS size
- * \param rcsCodeLength RCS set
- * \return Error-Code <> 0
- *
- */
- 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[]);
- /**
- * \brief Decode Binary
- *
- * Decode a binary value as a length-prefixed sequence of octets.
- *
- * \param stream Input Stream
- * \param bytes Bytes (out)
- * \return Error-Code <> 0
- *
- */
- int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes);
- /**
- * \brief Decode Binary data
- *
- * Decode a sequence of octets.
- *
- * \param stream Input Stream
- * \param len Length
- * \param data Bytes (out)
- * \return Error-Code <> 0
- *
- */
- int decodeBytes(bitstream_t* stream, size_t len, uint8_t* data);
- /**
- * \brief Decode DateTime
- *
- * Decode Date-Time as sequence of values representing the
- * individual components of the Date-Time.
- *
- * \param stream Input Stream
- * \param type Datetime type
- * \param datetime Datetime (out)
- * \return Error-Code <> 0
- *
- */
- int decodeDateTime(bitstream_t* stream, exi_datetime_type_t type, exi_datetime_t* datetime);
- #ifdef __cplusplus
- }
- #endif
- #endif
|