Skip to content

Experimental: unroll the transfer-ID counter #246

@pavel-kirienko

Description

@pavel-kirienko

We store the transfer-ID counter per remote sender:

typedef struct CanardInternalRxSession
{
CanardMicrosecond transfer_timestamp_usec; ///< Timestamp of the last received start-of-transfer.
size_t total_payload_size; ///< The payload size before the implicit truncation, including the CRC.
struct CanardMutablePayload payload; ///< Dynamically allocated and handed off to the application when done.
TransferCRC calculated_crc; ///< Updated with the received payload in real time.
CanardTransferID transfer_id;
uint8_t redundant_iface_index; ///< Arbitrary value in [0, 255].
bool toggle;
} CanardInternalRxSession;

We can easily extend it to 64 bits and thus eliminate the differences in transfer deduplication between cyclic- and monotonic transfer-ID transfers.

The transfer-ID timeout then could default to ~2 seconds and the corresponding parameter could be removed from the API. The user could still change it if necessary directly in the subscription struct, but this is only for arcane use cases. In the worst case, if the remote node restarts and loses the transfer-ID state, prior to the expiration of the transfer-ID timeout we could lose up to 16 transfers.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions