-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Transfers may not begin with the first frame in the presence of frame reordering:
pycyphal/pycyphal/transport/commons/high_overhead_transport/_transfer_reassembler.py
Lines 138 to 149 in 01b9a9b
| # DETECT NEW TRANSFERS. Either a newer TID or TID-timeout is reached. | |
| # Restarting the transfer reassembly only makes sense if the new frame is a start of transfer. | |
| # Otherwise, the new transfer would be impossible to reassemble anyway since the first frame is lost. | |
| # As we can reassemble transfers with out-of-order frames, we need to also take into account the case | |
| # when the first frame arrives when we already have some data from this transfer stored, | |
| # in which case we must suppress the transfer-ID condition. | |
| is_future_transfer_id = frame.transfer_id > self._transfer_id | |
| is_tid_timeout = ( | |
| frame.index == 0 | |
| and frame.transfer_id != self._transfer_id | |
| and timestamp.monotonic - self._ts.monotonic > transfer_id_timeout | |
| ) |