From: Martin Ling Date: Sun, 3 Nov 2013 22:34:17 +0000 (+0000) Subject: Clarify documentation for sp_read() and sp_write(). X-Git-Tag: libserialport-0.1.0~145 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=25ab82f6c061a92077aa1c2f62a2ceb3de02fdb5;p=libserialport.git Clarify documentation for sp_read() and sp_write(). --- diff --git a/README b/README index 2bd7fea..0ad7370 100644 --- a/README +++ b/README @@ -164,26 +164,30 @@ Reading, writing and flushing data int sp_read(struct sp_port *port, const void *buf, size_t count) - Reads a number of bytes from the specified serial port. + Reads bytes from the specified serial port. Note that this function may + return after reading less than the specified number of bytes; it is the + user's responsibility to iterate as necessary in this case. Parameters: port: Pointer to port structure. buf: Buffer in which to store the bytes read. - count: Number of bytes to read. + count: Maximum number of bytes to read. Returns: The number of bytes read, SP_ERR_FAIL on failure, or SP_ERR_ARG for invalid arguments. int sp_write(struct sp_port *port, const void *buf, size_t count) - Writes a number of bytes to the specified serial port. + Write bytes to the specified serial port. Note that this function may + return after writing less than the specified number of bytes; it is the + user's responsibility to iterate as necessary in this case. Parameters: port: Pointer to port structure. buf: Buffer containing the bytes to write. - count: Number of bytes to write. + count: Maximum number of bytes to write. Returns: The number of bytes written, SP_ERR_FAIL on failure, or SP_ERR_ARG for invalid arguments.