Skip to content

Commit

Permalink
Better docs for platform funcs' byte_timeout_ms
Browse files Browse the repository at this point in the history
  • Loading branch information
debevv committed Nov 25, 2024
1 parent b8d247f commit 85dd33d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ Both methods should block until either:
- `count` bytes of data are read/written
- the byte timeout, with `byte_timeout_ms >= 0`, expires

A value `< 0` for `byte_timeout_ms` means no timeout.
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.

Their return value should be the number of bytes actually read/written, or `< 0` in case of error.
A return value between `0` and `count - 1` will be treated as if a timeout occurred on the transport side. All other
Expand Down
4 changes: 3 additions & 1 deletion nanomodbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ typedef enum nmbs_transport {
* - `count` bytes of data are read/written
* - the byte timeout, with `byte_timeout_ms >= 0`, expires
*
* A value `< 0` for `byte_timeout_ms` means no timeout.
* 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.
*
*
* Their return value should be the number of bytes actually read/written, or `< 0` in case of error.
* A return value between `0` and `count - 1` will be treated as if a timeout occurred on the transport side. All other
Expand Down

0 comments on commit 85dd33d

Please sign in to comment.