Ring buffer - metadata

Hi

I'm working with ringbuffers (docs.zephyrproject.org/.../ring_buffers.html). I'm using the data item mode. Periodically I put data into the buffer (if I'm correct, you need to use different values for 'my_value' everytime you put something in a ringbuffer). When I press a button, I want to get all the data out of the ringbuffer. Is there a way to call ring_buf_item_get() just once and get all the data of the ringbuffer? And is it possible to explain the meaning of 'my_value', because I'm not sure if I'm doing it right. 

Kind regards
Sarah

Parents Reply Children
  • And is it possible to explain the meaning of 'my_value', because I'm not sure if I'm doing it right. 

    The "value" is application specific. I.e. you can use this 8-bit value for whatever you want.

    Is there a way to call ring_buf_item_get() just once and get all the data of the ringbuffer?

    No, there isn't a way to get all the items out of the buffer at the same time. You have to do this in a loop in your application.

Related