Kaynağa Gözat

Add documentation to the encoding interface

Infinity95 7 yıl önce
ebeveyn
işleme
3ad5b85275
1 değiştirilmiş dosya ile 14 ekleme ve 0 silme
  1. 14 0
      src/ua_types_encoding_binary.h

+ 14 - 0
src/ua_types_encoding_binary.h

@@ -13,6 +13,20 @@ extern "C" {
 
 
 typedef UA_StatusCode (*UA_exchangeEncodeBuffer)(void *handle, UA_Byte **bufPos, const UA_Byte **bufEnd);
 typedef UA_StatusCode (*UA_exchangeEncodeBuffer)(void *handle, UA_Byte **bufPos, const UA_Byte **bufEnd);
 
 
+/* Encode the data scalar (or structure) described by type in the binary
+ * encoding.
+ *
+ * @param data Points to the data.
+ * @param type Points to the type description.
+ * @param buf_pos Points to a pointer to the current position in the encoding buffer.
+ *        Must not be NULL. The pointer is advanced by the number of encoded bytes, or,
+ *        if the buffer is exchanged, to the position in the new buffer.
+ * @param buf_end Points to a pointer to the end of the encoding buffer (encoding always stops
+ *        before *buf_end). Must not be NULL. The pointer is changed when the buffer is exchanged.
+ * @param exchangeCallback Function that is called when the end of the encoding
+ *        buffer is reached.
+ * @param exchangeHandle Custom data passed intp the exchangeCallback.
+ * @return Returns a statuscode whether encoding succeeded. */
 UA_StatusCode
 UA_StatusCode
 UA_encodeBinary(const void *src, const UA_DataType *type,
 UA_encodeBinary(const void *src, const UA_DataType *type,
                 UA_Byte **bufPos, const UA_Byte **bufEnd,
                 UA_Byte **bufPos, const UA_Byte **bufEnd,