]> sigrok.org Git - libserialport.git/commitdiff
Minor cosmetics.
authorUwe Hermann <redacted>
Fri, 22 Nov 2013 14:53:34 +0000 (15:53 +0100)
committerUwe Hermann <redacted>
Fri, 22 Nov 2013 15:10:55 +0000 (16:10 +0100)
libserialport.h.in
linux_termios.c
serialport.c

index 85fd098300a9d441b4590622706155a0e60816ea..c24550e8b9c231c550c2531584e04a51df678a44 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 /**
- * 
  * @mainpage libserialport API
  *
  * Introduction
index 743af6000503fe7c9754c61eb860aa5867728186..5343e6e8268f15253aa82fb2f6983b76427591f5 100644 (file)
@@ -99,8 +99,8 @@ int get_termiox_size(void)
 int get_termiox_flow(void *data)
 {
        struct termiox *termx = (struct termiox *) data;
-
        int flags = 0;
+
        if (termx->x_cflag & RTSXOFF)
                flags |= RTS_FLOW;
        if (termx->x_cflag & CTSXON)
@@ -131,4 +131,3 @@ void set_termiox_flow(void *data, int flags)
 #endif
 
 #endif
-
index 35bb09b9e6a3316d0d3161b836670ae9fa831e5c..5e776072b2d580b206af740fe6df969d094bc413 100644 (file)
@@ -1028,7 +1028,7 @@ static enum sp_return set_config(struct sp_port *port, struct port_data *data,
                /* Non-standard baud rate */
                if (i == NUM_STD_BAUDRATES) {
 #ifdef __APPLE__
-                       /* Set "dummy" baud rate */
+                       /* Set "dummy" baud rate. */
                        if (cfsetspeed(&data->term, B9600) < 0)
                                return SP_ERR_FAIL;
                        baud_nonstd = config->baudrate;
@@ -1096,18 +1096,17 @@ static enum sp_return set_config(struct sp_port *port, struct port_data *data,
 #ifdef USE_TERMIOX
                data->flow &= ~(RTS_FLOW | CTS_FLOW);
                switch (config->rts) {
-                       case SP_RTS_OFF:
-                       case SP_RTS_ON:
-                               controlbits = TIOCM_RTS;
-                               if (ioctl(port->fd, config->rts == SP_RTS_ON ? TIOCMBIS : TIOCMBIC,
-                                               &controlbits) < 0)
-                                       return SP_ERR_FAIL;
-                               break;
-                       case SP_RTS_FLOW_CONTROL:
-                               data->flow |= RTS_FLOW;
-                               break;
-                       default:
-                               break;
+               case SP_RTS_OFF:
+               case SP_RTS_ON:
+                       controlbits = TIOCM_RTS;
+                       if (ioctl(port->fd, config->rts == SP_RTS_ON ? TIOCMBIS : TIOCMBIC, &controlbits) < 0)
+                               return SP_ERR_FAIL;
+                       break;
+               case SP_RTS_FLOW_CONTROL:
+                       data->flow |= RTS_FLOW;
+                       break;
+               default:
+                       break;
                }
                if (config->cts == SP_CTS_FLOW_CONTROL)
                        data->flow |= CTS_FLOW;
@@ -1152,18 +1151,17 @@ static enum sp_return set_config(struct sp_port *port, struct port_data *data,
 #ifdef USE_TERMIOX
                data->flow &= ~(DTR_FLOW | DSR_FLOW);
                switch (config->dtr) {
-                       case SP_DTR_OFF:
-                       case SP_DTR_ON:
-                               controlbits = TIOCM_DTR;
-                               if (ioctl(port->fd, config->dtr == SP_DTR_ON ? TIOCMBIS : TIOCMBIC,
-                                               &controlbits) < 0)
-                                       return SP_ERR_FAIL;
-                               break;
-                       case SP_DTR_FLOW_CONTROL:
-                               data->flow |= DTR_FLOW;
-                               break;
-                       default:
-                               break;
+               case SP_DTR_OFF:
+               case SP_DTR_ON:
+                       controlbits = TIOCM_DTR;
+                       if (ioctl(port->fd, config->dtr == SP_DTR_ON ? TIOCMBIS : TIOCMBIC, &controlbits) < 0)
+                               return SP_ERR_FAIL;
+                       break;
+               case SP_DTR_FLOW_CONTROL:
+                       data->flow |= DTR_FLOW;
+                       break;
+               default:
+                       break;
                }
                if (config->dsr == SP_DSR_FLOW_CONTROL)
                        data->flow |= DSR_FLOW;