Updated docstrings

This commit is contained in:
Valerio De Benedetto 2022-06-02 11:59:45 +02:00
parent 83fb04392b
commit a8bf7428cc

View File

@ -111,20 +111,17 @@ typedef enum nmbs_transport {
* nanoMODBUS platform configuration struct. * nanoMODBUS platform configuration struct.
* Passed to nmbs_server_create() and nmbs_client_create(). * Passed to nmbs_server_create() and nmbs_client_create().
* *
* read_byte() and write_byte() are the platform-specific methods that read/write data to/from a serial port or a TCP connection. * read() and write() are the platform-specific methods that read/write data to/from a serial port or a TCP connection.
* *
* Both methods should block until either: * Both methods should block until either:
* - a byte is read/written * - `count` bytes of data are read/written
* - the timeout, with timeout_ms >= 0, expires * - the byte timeout, with `byte_timeout_ms >= 0`, expires
* *
* A value < 0 for timeout_ms means no timeout. * A value `< 0` for `byte_timeout_ms` means no timeout.
* *
* Their return values should be: * Their return value should be the number of bytes actually read/written, or `< 0` in case of error.
* - `1` in case of success * A return value between `0` and `count - 1` will be treated as if a timeout occurred on the transport side. All other
* - `0` if no data is available immediately or after timeout expiration * values will be treated as transport errors.
* - `-1` in case of error
*
* sleep() is the platform-specific method to pause for a certain amount of milliseconds.
* *
* These methods accept a pointer to arbitrary user-data, which is the arg member of this struct. * These methods accept a pointer to arbitrary user-data, which is the arg member of this struct.
* After the creation of an instance it can be changed with nmbs_set_platform_arg(). * After the creation of an instance it can be changed with nmbs_set_platform_arg().