]> sigrok.org Git - libserialport.git/blobdiff - serialport.h
Add SP_ERR_MEM failure code.
[libserialport.git] / serialport.h
index 4e79340bfb6c808c4a2bf6533532b6117313cc80..3d6410e071308e0816457ebfa28a95cfe3fa0b15 100644 (file)
@@ -41,10 +41,12 @@ struct sp_port {
 enum {
        /* Operation completed successfully. */
        SP_OK = 0,
-       /* A system error occured while executing the operation. */
-       SP_ERR_FAIL = -1,
        /* Invalid arguments were passed to the function. */
-       SP_ERR_ARG = -2
+       SP_ERR_ARG = -1,
+       /* A system error occured while executing the operation. */
+       SP_ERR_FAIL = -2,
+       /* A memory allocation failed while executing the operation. */
+       SP_ERR_MEM = -3
 };
 
 /* Port access modes. */
@@ -67,6 +69,16 @@ enum {
        SP_PARITY_ODD = 2
 };
 
+/* Flow control settings. */
+enum {
+       /* No flow control. */
+       SP_FLOW_NONE = 0,
+       /* Hardware (RTS/CTS) flow control. */
+       SP_FLOW_HARDWARE = 1,
+       /* Software (XON/XOFF) flow control. */
+       SP_FLOW_SOFTWARE = 2
+};
+
 char **sp_list_ports(void);
 void sp_free_port_list(char **ports);
 int sp_open(struct sp_port *port, char *portname, int flags);