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. */
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);