]> sigrok.org Git - libserialport.git/blobdiff - libserialport.h.in
Add sp_input_waiting() and sp_output_waiting() functions.
[libserialport.git] / libserialport.h.in
index ff2aaac75bb7b4a01d51f3d86c97bf3646a4e218..3d38a0dc3302b98a456cb1da007c684cd3ffe7a1 100644 (file)
@@ -827,6 +827,24 @@ enum sp_return sp_blocking_write(struct sp_port *port, const void *buf, size_t c
  */
 enum sp_return sp_nonblocking_write(struct sp_port *port, const void *buf, size_t count);
 
+/**
+ * Gets the number of bytes waiting in the input buffer.
+ *
+ * @param port Pointer to port structure.
+ *
+ * @return Number of bytes waiting on success, a negative error code otherwise.
+ */
+enum sp_return sp_input_waiting(struct sp_port *port);
+
+/**
+ * Gets the number of bytes waiting in the output buffer.
+ *
+ * @param port Pointer to port structure.
+ *
+ * @return Number of bytes waiting on success, a negative error code otherwise.
+ */
+enum sp_return sp_output_waiting(struct sp_port *port);
+
 /**
  * Flush serial port buffers. Data in the selected buffer(s) is discarded.
  *