template<unsigned int pktLen, unsigned int pktNum>
class Boardcore::SyncPacketQueue< pktLen, pktNum >
A SyncPacketQueue is a SyncCircularBuffer of Packets.
The difference is that you pop() Packets but you append() bytes. The bytes will be appended to the first available packet and the next ones. This class is suitable for synchronization between two threads.
- Template Parameters
-
pktLen | Maximum length of each packet [bytes]. |
pktNum | Total number of packets. |
Definition at line 209 of file SyncPacketQueue.h.
template<unsigned int pktLen, unsigned int pktNum>
Try to append a given message to the packets queue.
The message is appended to the last packet and if the space isn't enough, it is divided into successive packets. If there are no more available packets, the oldest one is overwritten.
The message isn't added to the queue only if there is no space considering all the queue packets.
- Parameters
-
msg | The message to be appended. |
msgLen | Length of the message [bytes]. |
- Returns
- True if the message was appended.
Definition at line 226 of file SyncPacketQueue.h.