More elaborate k_fifo API?

Paul Sokolovsky


Motivation: BSD Sockets API work.

I already have code like:

+ // TODO: k_fifo accessor for this?
+ struct net_buf *last_buf = (struct net_buf*)sys_slist_peek_tail(&socket->recv_q.data_q);

to peek tail element of the fifo.

And I get a next net_buf and store it in a pointer within a socket
structure, but instead I could just peek a head element - as long as
fifo would allow me to wait until it becomes non-empty (without
extracting first element, I'll peek it afterwards). Granted, this can
be done with adhoc code like peeking tail, but becomes more and more

Best Regards,
Paul | Open source software for ARM SoCs
Follow Linaro:!/linaroorg -

Join to automatically receive all group messages.