X-Git-Url: https://git.distorted.org.uk/~mdw/jog/blobdiff_plain/2ec1e6937048636ec6761c3a76c5bf9544278601..08b95ae46c249ee9652c8645ac1701165fea28de:/serial.h diff --git a/serial.h b/serial.h index f514bda..c21fc09 100644 --- a/serial.h +++ b/serial.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: serial.h,v 1.1 2002/01/25 19:34:45 mdw Exp $ + * $Id: serial.h,v 1.2 2002/01/30 09:23:58 mdw Exp $ * * Common serial functionality * @@ -26,14 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: serial.h,v $ - * Revision 1.1 2002/01/25 19:34:45 mdw - * Initial revision - * - */ - #ifndef SERIAL_H #define SERIAL_H @@ -51,21 +43,23 @@ typedef struct serial_config { unsigned long baud; /* Baud rate */ - unsigned wordlen; /* Word length */ - unsigned parity; /* Parity type (magic constant) */ - unsigned stopbits; /* Number of stop bits */ + unsigned char wordlen; /* Word length */ + unsigned char parity; /* Parity type (magic constant) */ + unsigned char stopbits; /* Number of stop bits */ + unsigned char flow; /* Flow control */ } serial_config; enum { PARITY_NONE, PARITY_ODD, PARITY_EVEN }; +enum { FLOW_NONE, FLOW_XONXOFF, FLOW_RTSCTS }; -#define SERIAL_INIT { 9600, 8, PARITY_NONE, 1 } +#define SERIAL_INIT { 9600, 8, PARITY_NONE, 1, FLOW_NONE } /*----- Functions provided ------------------------------------------------*/ /* --- @serial_parse@ --- * * - * Arguments: @const char *p@ = configuration string to parse - * @serial_config *sc@ = pointer to serial config structure + * Arguments: @serial_config *sc@ = pointer to serial config structure + * @const char *k, *v@ = keyword and value pair * * Returns: Zero if OK, or @-1@ on error. * @@ -75,7 +69,8 @@ enum { PARITY_NONE, PARITY_ODD, PARITY_EVEN }; * already. */ -extern int serial_parse(const char */*p*/, serial_config */*sc*/); +extern int serial_parse(serial_config */*sc*/, + const char */*k*/, const char */*v*/); /*----- That's all, folks -------------------------------------------------*/