From 85dd33d6dcfe7f2a725f53ddf5f15d17e4d82044 Mon Sep 17 00:00:00 2001 From: Valerio De Benedetto Date: Mon, 25 Nov 2024 13:30:51 +0100 Subject: [PATCH] Better docs for platform funcs' `byte_timeout_ms` --- README.md | 4 +++- nanomodbus.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e105f9e..7baf54e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/nanomodbus.h b/nanomodbus.h index f2d1bc6..5cc814c 100644 --- a/nanomodbus.h +++ b/nanomodbus.h @@ -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