microRTPS_transport.h: add clarifying comment for Transport_node::write()

This commit is contained in:
Beat Küng 2018-02-14 12:14:34 +01:00
parent 13a3791c47
commit 89b2fa2ba0

View File

@ -45,8 +45,22 @@ public:
virtual int init() {return 0;}
virtual uint8_t close() {return 0;}
ssize_t read(uint8_t *topic_ID, char out_buffer[], size_t buffer_len);
/**
* write a buffer
* @param topic_ID
* @param buffer buffer to write: it must leave get_header_length() bytes free at the beginning. This will be
* filled with the header. length does not include get_header_length(). So buffer looks like this:
* -------------------------------------------------
* | header (leave free) | payload data |
* | get_header_length() bytes | length bytes |
* -------------------------------------------------
* @param length buffer length excluding header length
* @return length on success, <0 on error
*/
ssize_t write(const uint8_t topic_ID, char buffer[], size_t length);
/* Get the Length of struct Header to make headroom for the size of struct Header alongwith payload*/
/** Get the Length of struct Header to make headroom for the size of struct Header along with payload */
ssize_t get_header_length();
protected: