Skip to content

Commit

Permalink
Allow test_gpsmm to connect via shared memory
Browse files Browse the repository at this point in the history
Simply skip calling gps_stream() which is only for socket connections.

TESTED:
test_gpsmm can connect to gpsd shared memory on Linux.

Signed-off-by: Fred Wright <[email protected]>
  • Loading branch information
rnorris authored and fhgwright committed Mar 25, 2017
1 parent 3a8d8e8 commit a06522f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test_gpsmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a06522f

Please sign in to comment.