gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] [PATCH 2/3] Allow test_gpsmm to connect via shared memory


From: Robert Norris
Subject: [gpsd-dev] [PATCH 2/3] Allow test_gpsmm to connect via shared memory
Date: Sun, 5 Mar 2017 23:16:09 +0000

Simply skip calling gps_stream() which is only for socket connections.

TESTED:
test_gpsmm can connect to gpsd shared memory on Linux.
---
 test_gpsmm.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test_gpsmm.cpp b/test_gpsmm.cpp
index 8379c0e0..4106b476 100644
--- a/test_gpsmm.cpp
+++ b/test_gpsmm.cpp
@@ -141,9 +141,12 @@ int main(int argc, char *argv[])
     //gpsmm gps_rec("localhost", DEFAULT_GPSD_PORT);
     gpsmm gps_rec(source.server, source.port);
 
-    if (gps_rec.stream(WATCH_ENABLE|WATCH_JSON) == NULL) {
-        cerr << "No GPSD running.\n";
-        return 1;
+    if ( !((std::string)source.server == (std::string)GPSD_SHARED_MEMORY ||
+          (std::string)source.server == (std::string)GPSD_DBUS_EXPORT) ) {
+        if (gps_rec.stream(WATCH_ENABLE|WATCH_JSON) == NULL) {
+            cerr << "No GPSD running.\n";
+            return 1;
+        }
     }
 
     // Loop for the specified number of times
-- 
2.11.0




reply via email to

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