Hi!
We're using RTT to write out a binary packet log file (e.g. like .pcap). To avoid using a special outgoing packet buffer and extra memcpy calls, we first write the packet header and then the packet itself with SEGGER_RTT_Write. If the RTT buffer gets full after writing the header and the RTT mode is set to SEGGER_RTT_MODE_NO_BLOCK_SKIP, the packet can not get written and the log gets corrupted.
Would it be possible to add a SEGGER_RTT_GetAvailWriteSpace(bufferIndex) or SEGGER_RTT_CanWriteBytes(bufferIndex, numBytes)?
Here's a draft: github.com/bluekitchen/btstack…639c0a9cb764edb04e3d5e483
I'm aware that this would only works without multi-threading or when using RTT from ISRs.
Thanks for consideration
Matthias
We're using RTT to write out a binary packet log file (e.g. like .pcap). To avoid using a special outgoing packet buffer and extra memcpy calls, we first write the packet header and then the packet itself with SEGGER_RTT_Write. If the RTT buffer gets full after writing the header and the RTT mode is set to SEGGER_RTT_MODE_NO_BLOCK_SKIP, the packet can not get written and the log gets corrupted.
Would it be possible to add a SEGGER_RTT_GetAvailWriteSpace(bufferIndex) or SEGGER_RTT_CanWriteBytes(bufferIndex, numBytes)?
Here's a draft: github.com/bluekitchen/btstack…639c0a9cb764edb04e3d5e483
I'm aware that this would only works without multi-threading or when using RTT from ISRs.
Thanks for consideration
Matthias