Skip to content

Add control flow to serial (UART) connection #16

@cmaglie

Description

@cmaglie

On the UART serial connection, if a transmitter sends a large number of messages and the receiver is unable to consume them quickly enough, it may be possible to fill the receiving buffer of the serial port, causing the connection to drop bytes and leading to data corruption.

One solution is to use a hardware handshake; each side of the UART has a pair of GPIO pins (RTS/CTS and DTR/DSR) that signal when the other side has enough space to receive data. This solution requires the GPIO pins to be connected.

Another solution is to implement a software handshake where each RPC client sends a notification to the other side to acknowledge the number of messages successfully processed. Each client should then compare the number of sent messages with the number of acknowledged messages: if the difference exceeds a fixed threshold, the client should pause sending messages until the difference drops below the threshold again.
This solution also implies the presence of a "reset message" to restart the counting from 0.

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