@@ -54,10 +54,30 @@ int circbuf_pop_byte(int handle, unsigned char *data);
54
54
* @param handle [in] Handle to circular buffer
55
55
* @param data [out] pointer to read buffer
56
56
* @param len [in] Length of data to read
57
- * @return On success, returns actual length read, -1 on error
57
+ * @return On success, returns actual length read, negative value on error
58
58
*/
59
59
int circbuf_pop (int handle , unsigned char * data , unsigned int len );
60
60
61
+ /**
62
+ * Peek a byte from head of circular buffer. Subsequent calls
63
+ * to this function will lead to same byte unless @ref circbuf_pop or
64
+ * @ref circbuf_pop_byte is called.
65
+ * @param handle [in] Handle to circular buffer
66
+ * @param data [out] Pointer to read buffer
67
+ * @return On success, returns actual length read, negative value on error
68
+ */
69
+ int circbuf_peek_byte (int handle , unsigned char * data );
70
+
71
+ /**
72
+ * Peek data from start of circular buffer. Data will not be removed
73
+ * from buffer unless @ref circbuf_pop or @ref circbuf_pop_byte is called.
74
+ * @param handle [in] Handle to circular buffer
75
+ * @param data [out] pointer to read buffer
76
+ * @param len [in] Length of data to read
77
+ * @return On success, returns actual length read, negative value on error
78
+ */
79
+ int circbuf_peek (int handle , unsigned char * data , int len );
80
+
61
81
/**
62
82
* Check if buffer is empty
63
83
* @param handle [in] Handle to circular buffer
0 commit comments