-
Notifications
You must be signed in to change notification settings - Fork 21
Description
TCP is a protocol based on streams. The underlying packages are an implementation detail, and modbus ADUs can be split over multiple packages or merged together into a single package.
codec::tcp::client::decode_response
, codec::tcp::server::decode_response
and codec::tcp::client::decode_request
currently only return the parsed ADU, but discard the FrameLocation
that has the information on where the parsed bytes of the ADU were located in the input buf
.
Given that two ADUs might arrive in the same buffer, this makes these functions unusable for actual parsing of modbus ADUs. Can we either change these functions to return the FrameLocation
/ the number of bytes used / the remaining slice of the input buf
that was not used, or add a second decode function that exposes this information?
I'm willing to provide a PR if you tell me which of these solutions you prefer.