Skip to content

[Feature Request] add ability to discard a message from a message buffer #268

Open
@galenseitz

Description

@galenseitz

If a message sender writes a message that is longer than the receiver is expecting to handle, there is no way to discard the message other than to perform a message buffer reset. Of course, a message buffer reset will discard all messages, not just the message with the problematic length. For more robust error recovery, I think it would be useful to have a way to discard a message without requiring a buffer large enough to hold whatever message may be sent.

I suggest adding a new function like xMessageBufferDiscard(MessageBufferHandle_t xMessageBuffer, TickType_t xTicksToWait ). (I'm unsure whether a timeout param is appropriate here.) Alternatively, and perhaps better, would be to allow xMessageBufferReceive to discard a message if the pvRxData parameter is NULL.

For the time being, I will probably change my sending code to prevent messages that are too long. I will also issue a message buffer reset if a too long message is received.

See the forum discussion here

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions