opcua_binaryEncDec.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * opcua_BinaryEncDec.h
  3. *
  4. * Created on: Dec 18, 2013
  5. * Author: opcua
  6. */
  7. #ifndef OPCUA_BINARYENCDEC_NEU_H_
  8. #define OPCUA_BINARYENCDEC_NEU_H_
  9. #include "opcua_builtInDatatypes.h"
  10. #include "opcua_advancedDatatypes.h"
  11. //functions
  12. /**
  13. *
  14. * @param buf binary encoded message
  15. * @param pos position at which the data is located in/out, parser position after the conversion
  16. * @return
  17. */
  18. Byte convertToByte(const char* buf, Int32 *pos);
  19. /**
  20. *
  21. * @param encodeByte byte that should be encoded
  22. * @param pos position at which the data is located in/out, parser position after the conversion
  23. * @param dstBuf rawMessage where the Byte is encoded in
  24. */
  25. void encodeByte(Byte encodeByte, Int32 *pos, AD_RawMessage *dstBuf);
  26. /**
  27. *
  28. * @param buf
  29. * @param pos
  30. * @return
  31. */
  32. Int16 convertToInt16(const char* buf, Int32 *pos);
  33. /**
  34. *
  35. * @param buf
  36. * @param pos
  37. * @return
  38. */
  39. UInt16 convertToUInt16(const char* buf, Int32 *pos);
  40. /**
  41. *
  42. * @param buf binary encoded message
  43. * @param pos position at which the data is located in/out, parser position after the conversion
  44. * @return
  45. */
  46. Int32 convertToInt32(const char* buf, Int32 *pos);
  47. /**
  48. *
  49. * @param buf binary encoded message
  50. * @param pos position at which the data is located in/out, parser position after the conversion
  51. * @return encoded data
  52. */
  53. UInt32 convertToUInt32(const char* buf, Int32 *pos);
  54. /**
  55. *
  56. * @param buf
  57. * @param pos
  58. * @return
  59. */
  60. Int64 convertToInt64(const char* buf, Int32 *pos);
  61. /**
  62. *
  63. * @param buf binary encoded message
  64. * @param pos position at which the data is located in/out, parser position after the conversion
  65. * @param dstNodeId receiver of the nodeid structure
  66. * @param return success = 0
  67. */
  68. Int32 convertToUANodeId(const char* buf, Int32 *pos, UA_NodeId *dstNodeId);
  69. /**
  70. *
  71. * @param buf
  72. * @param pos
  73. * @param dstGUID
  74. * @return
  75. */
  76. Int32 convertToUAGuid(const char *buf, Int32 *pos, UA_Guid *dstGUID);
  77. /**
  78. *
  79. * @param buf
  80. * @param pos
  81. * @return
  82. */
  83. UA_StatusCode convertToUAStatusCode(const char* buf, Int32 *pos);
  84. /**
  85. *
  86. * @param buf
  87. * @param pos
  88. * @return
  89. */
  90. UA_DateTime convertToUADateTime(const char *buf, Int32 *pos);
  91. /**
  92. *
  93. * @param buf
  94. * @param pos
  95. * @param dstUAString
  96. * @return
  97. */
  98. Int32 convertToUAString(const char* buf, Int32 *pos, UA_String *dstUAString);
  99. /**
  100. *
  101. * @param value
  102. * @param dstBuf
  103. * @param pos
  104. */
  105. void convertUInt32ToByteArray(UInt32 value, char *dstBuf, Int32 *pos);
  106. #endif /* OPCUA_BINARYENCDEC_NEU_H_ */