Skip to content

Commit

Permalink
cobsr.h: add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotterleben committed Oct 16, 2018
1 parent 8200dde commit 3b2f7bc
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions cobsr.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,33 @@ typedef struct
extern "C" {
#endif

cobsr_encode_result cobsr_encode(uint8_t *dst_buf_ptr, size_t dst_buf_len, const uint8_t * src_ptr, size_t src_len);
cobsr_decode_result cobsr_decode(uint8_t *dst_buf_ptr, size_t dst_buf_len, const uint8_t * src_ptr, size_t src_len);
/* COBS/R-encode a string of input bytes, which may save one byte of output.
*
* dst_buf_ptr: The buffer into which the result will be written
* dst_buf_len: Length of the buffer into which the result will be written
* src_ptr: The byte string to be encoded
* src_len Length of the byte string to be encoded
*
* returns: A struct containing the success status of the encoding
* operation and the length of the result (that was written to
* dst_buf_ptr)
*/
cobsr_encode_result cobsr_encode(uint8_t *dst_buf_ptr, size_t dst_buf_len,
const uint8_t * src_ptr, size_t src_len);

/* Decode a COBS/R byte string.
*
* dst_buf_ptr: The buffer into which the result will be written
* dst_buf_len: Length of the buffer into which the result will be written
* src_ptr: The byte string to be decoded
* src_len Length of the byte string to be decoded
*
* returns: A struct containing the success status of the decoding
* operation and the length of the result (that was written to
* dst_buf_ptr)
*/
cobsr_decode_result cobsr_decode(uint8_t *dst_buf_ptr, size_t dst_buf_len,
const uint8_t * src_ptr, size_t src_len);


#ifdef __cplusplus
Expand Down

0 comments on commit 3b2f7bc

Please sign in to comment.