/* -*-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
*
/*----- Revision history --------------------------------------------------*
*
* $Log: serial.h,v $
+ * Revision 1.2 2002/01/30 09:23:58 mdw
+ * Follow new transport configuration interface. Add parameters for flow
+ * control. Break the format into separate parameters for independent
+ * configuration.
+ *
* Revision 1.1 2002/01/25 19:34:45 mdw
* Initial revision
*
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.
*
* 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 -------------------------------------------------*/