Describe the bug
When receiving ETP sessions, we can sometimes incorrectly issue a clear to send to the source control function with an incorrectly limited packet count, specifically on the final group of packets.
I have specifically seen a situation where we were receiving a session of 2291 bytes, and when the final group of packets was to be sent, we cleared the sender for 16 packets when only 8 were needed, causing them to abort the transfer with the ISO11783-3 error code ECTS requested packets exceeds message size
We should limit the CTS to be only as many frames as are required to complete the session in this case.
Supporting Documentation
can_extended_transport_protocol.cpp line 818
Environment (please complete the following information):
Describe the bug When receiving ETP sessions, we can sometimes incorrectly issue a clear to send to the source control function with an incorrectly limited packet count, specifically on the final group of packets.
I have specifically seen a situation where we were receiving a session of 2291 bytes, and when the final group of packets was to be sent, we cleared the sender for 16 packets when only 8 were needed, causing them to abort the transfer with the ISO11783-3 error code
ECTS requested packets exceeds message size
We should limit the CTS to be only as many frames as are required to complete the session in this case.
Supporting Documentation
can_extended_transport_protocol.cpp line 818![image](https://github.com/Open-Agriculture/AgIsoStack-plus-plus/assets/10929341/3e2a4682-fb7b-4690-81b8-44a485070392)
Environment (please complete the following information):