gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] gpsctl -e adds error message to control stream


From: John Klug
Subject: [gpsd-dev] gpsctl -e adds error message to control stream
Date: Mon, 6 Mar 2017 20:57:10 +0000

This patch is for 3.16
Prevent message:
  (null)  identified as a unknown, at 0 baud.
which occurs in the control stream when the output
is stdout (-c option).
diff -Naur old/gpsctl.c new/gpsctl.c
--- old/gpsctl.c        2017-01-16 08:58:54.766070710 -0600
+++ new/gpsctl.c        2017-01-16 09:00:59.966069127 -0600
@@ -175,7 +175,7 @@
     int option, status;
     char *device = NULL, *devtype = NULL;
     char *speed = NULL, *control = NULL, *rate = NULL;
-    bool to_binary = false, to_nmea = false, reset = false;
+    bool to_binary = false, to_nmea = false, reset = false, control_stdout = 
false;
     bool lowlevel=false, echo=false;
     struct gps_data_t gpsdata;
     const struct gps_type_t *forcetype = NULL;
@@ -217,6 +217,7 @@
             break;
         case 'e':               /* echo specified control string with wrapper 
*/
             lowlevel = true;
+           control_stdout = true;  /* Prevent message going to stdout */
             echo = true;
             break;
         case 'f':               /* force direct access to the device */
@@ -704,7 +705,8 @@
             }
         }
 
-       (void)printf("%s identified as a %s at %u baud.\n",
+       if(!control_stdout)
+               (void)printf("%s identified as a %s at %u baud.\n",
                        device, gpsd_id(&session),
                        session.gpsdata.dev.baudrate);
 

John Klug

Senior Software Engineer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]