123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- /*
- * opcua_BinaryEncDec.h
- *
- * Created on: Dec 18, 2013
- * Author: opcua
- */
- #ifndef OPCUA_BINARYENCDEC_NEU_H_
- #define OPCUA_BINARYENCDEC_NEU_H_
- #include "opcua_builtInDatatypes.h"
- #include "opcua_advancedDatatypes.h"
- #include "opcua_types.h"
- #define UA_TRUE 1
- #define UA_FALSE 0
- #define MAX_PICO_SECONDS 9999
- //functions
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- Boolean decodeBoolean(char * const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeBoolean(Boolean value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- SByte decodeSByte(char * const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeSByte(SByte value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf binary encoded message
- * @param pos position at which the data is located in/out, parser position after the conversion
- * @return
- */
- Byte decodeByte(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeByte(Byte value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- UInt16 decodeUInt16(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeUInt16(UInt16 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- Int16 decodeInt16(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeInt16(Int16 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf binary encoded message
- * @param pos position at which the data is located in/out, parser position after the conversion
- * @return
- */
- Int32 decodeInt32(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeInt32(Int32 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf binary encoded message
- * @param pos position at which the data is located in/out, parser position after the conversion
- * @return encoded data
- */
- UInt32 decodeUInt32(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param dstBuf
- * @param pos
- */
- void encodeUInt32(UInt32 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- Int64 decodeInt64(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeInt64(Int64 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- UInt64 decodeUInt64(char *const buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- */
- void encodeUInt64(UInt64 value, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf binary encoded message
- * @param pos position at which the data is located in/out, parser position after the conversion
- * @param dstNodeId receiver of the nodeid structure
- * @param return success = 0
- */
- Int32 decodeUANodeId(char *const buf, Int32 *pos, UA_NodeId *dstNodeId);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- Float decodeFloat(char *buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- * @return
- */
- Int32 encodeFloat(Float value,Int32 *pos,char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- Double decodeDouble(char *buf, Int32 *pos);
- /**
- *
- * @param value
- * @param pos
- * @param dstBuf
- * @return
- */
- Int32 encodeDouble(Double value, Int32 *pos,char *dstBuf);
- /**
- *
- * @param srcNodeId
- * @param pos
- * @param buf
- * @return
- */
- Int32 encodeUANodeId(UA_NodeId *srcNodeId, Int32 *pos, char *buf);
- /**
- *
- * @param srcGuid
- * @param pos
- * @param buf
- * @return
- */
- Int32 encodeUAGuid(UA_Guid *srcGuid, Int32 *pos, char *buf);
- /**
- *
- * @param buf
- * @param pos
- * @param dstGUID
- * @return
- */
- Int32 decodeUAGuid(char *const buf, Int32 *pos, UA_Guid *dstGUID);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- UA_StatusCode decodeUAStatusCode(char *const buf, Int32 *pos);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- UA_DateTime decodeUADateTime(char *const buf, Int32 *pos);
- /**
- *
- * @param time
- * @param pos
- * @param dstBuf
- * @return
- */
- void encodeUADateTime(UA_DateTime time, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @param dstUAString
- * @return
- */
- Int32 decodeUAString(char *const buf, Int32 *pos, UA_String *dstUAString);
- /**
- *
- * @param byteString
- * @return length of the binary encoded data
- */
- Int32 UAByteString_calcSize(UA_ByteString *byteString);
- /**
- *
- * @param xmlElement
- * @param pos
- * @param dstBuf
- * @return
- */
- Int32 encodeXmlElement(UA_XmlElement xmlElement, Int32 *pos, char *dstBuf);
- /**
- *
- * @param buf
- * @param pos
- * @param xmlElement
- * @return
- */
- Int32 decodeXmlElement(char * const buf, Int32* pos, UA_XmlElement *xmlElement);
- /**
- *
- * @param buf
- * @param pos
- * @return
- */
- T_IntegerId decodeIntegerId(char* buf, Int32 *pos);
- /**
- *
- * @param integerId
- * @param pos
- * @param buf
- */
- void encodeIntegerId(T_IntegerId integerId, Int32 *pos, char *buf);
- /**
- * \brief
- * \param srcRaw pointer to raw data which holds the encoded data
- * \param pos
- * \param dstRequestHeader pointer to a structure which hold the encoded header
- * \return 0 = success
- */
- Int32 decodeRequestHeader(const AD_RawMessage *srcRaw,Int32 *pos, T_RequestHeader *dstRequestHeader);
- /**
- *
- * @param srcHeader
- * @param pos
- * @param dstRaw
- * @return
- */
- Int32 encodeRequestHeader(const T_RequestHeader *srcHeader,Int32 *pos,AD_RawMessage *dstRaw);
- /**
- *
- * @param srcRaw
- * @param pos
- * @param dstResponseHeader
- * @return
- */
- Int32 decodeResponseHeader(const AD_RawMessage *srcRaw, Int32 *pos, T_ResponseHeader *dstResponseHeader);
- /**
- * @brief function to encode a secureChannelRequestHeader
- *
- * @param header a open secure channel header structure which should be encoded to binary format
- * @param dstBuf pointer to a structure which hold the encoded header
- * @return
- */
- Int32 encodeResponseHeader(const T_ResponseHeader *responseHeader, Int32 *pos, AD_RawMessage *dstBuf);
- /**
- *
- * @param diagnosticInfo
- * @return length of the binary encoded data
- */
- Int32 diagnosticInfo_calcSize(UA_DiagnosticInfo *diagnosticInfo);
- /**
- *
- * @param extensionObject
- * @return length of the binary encoded data
- */
- Int32 extensionObject_calcSize(UA_ExtensionObject *extensionObject);
- #endif /* OPCUA_BINARYENCDEC_NEU_H_ */
|