-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
Thanks for this awesome crate!
I can use read_holding_registers without issue. However, when I send a custom request with function code 0x03 (to mimic read_holding_registers), the call
let request = tokio_modbus::Request::Custom(3, Cow::Owned([0x01, 0x52, 0x00, 0x01].to_vec()));
ctx.call(request).await??;returns:
Error: mismatching function codes: 3 Ok(ReadHoldingRegisters([47826]))
I skimmed through the source code but still couldn’t figure out where this mismatch is coming from. And the value 47826 is correct.
Am I misunderstanding how the custom request is supposed to be used?