nanoMODBUS icon indicating copy to clipboard operation
nanoMODBUS copied to clipboard

Meaning of byte_timeout_ms < 0

Open wallace-diatomic opened this issue 3 months ago • 2 comments

I'm reading the documentation in preparation for my first use of this module. Thanks very much for providing it. I'm confused by a discrepancy regarding byte_timeout_ms.

In ./README.md under Transport read/write, and in ./nanomodbus.h in the comments before the definition of typedef struct nmbs_platform_conf:

A value < 0 for byte_timeout_ms means infinite timeout. With a value == 0 for byte_timeout_ms, the method should read/write once in a non-blocking fashion and return immediately.

But in the Doxygen-generated reference for that struct at https://debevv.github.io/nanoMODBUS/structnmbs__platform__conf.html:

A value < 0 for byte_timeout_ms means no timeout.

Is the Doxygen info out of date?

wallace-diatomic avatar Sep 12 '25 17:09 wallace-diatomic

Hi, basically infinite timeout == no timeout. The function should return only when the required bytes are read/written. The problem is that the doxygen html was not regenerated after updating nanomdbus.h. I will fix it, thank you

debevv avatar Sep 22 '25 10:09 debevv

Ah, thank you.

wallace-diatomic avatar Sep 22 '25 15:09 wallace-diatomic