1- From 0f0a1495b3b2ae9da09ea1a05510492bae05a928 Mon Sep 17 00:00:00 2001
1+ From c8d7548a0c306bc07cdde94f6a81ba0851b0008c Mon Sep 17 00:00:00 2001
22From: Bjorn Andersson <
[email protected] >
33Date: Wed, 4 Apr 2018 04:29:09 +0000
44Subject: [PATCH] Introduce Qualcomm PDS service support
3535Upstream-Status: Submitted [https://gitlab.com/gpsd/gpsd/-/merge_requests/139]
3636---
3737 SConscript | 11 ++
38- drivers/driver_pds.c | 406 +++++++++++++++++++++++++++++++++++++++++++
38+ drivers/driver_pds.c | 407 +++++++++++++++++++++++++++++++++++++++++++
3939 drivers/drivers.c | 5 +
4040 gpsd/libgpsd_core.c | 16 +-
4141 include/driver_pds.h | 20 +++
4242 include/gpsd.h | 9 +
4343 man/gpsd.adoc | 8 +
44- 7 files changed, 474 insertions(+), 1 deletion(-)
44+ 7 files changed, 475 insertions(+), 1 deletion(-)
4545 create mode 100644 drivers/driver_pds.c
4646 create mode 100644 include/driver_pds.h
4747
4848diff --git a/SConscript b/SConscript
49- index e3fed4c27..cae23de9c 100644
49+ index 28105fa7b..f5689da1c 100644
5050--- a/SConscript
5151+++ b/SConscript
52- @@ -315,6 +315,8 @@ boolopts = (
52+ @@ -336,6 +336,8 @@ boolopts = (
53+ ("tnt", True, "True North Technologies support"),
5354 ("tripmate", True, "DeLorme TripMate support"),
5455 ("tsip", True, "Trimble TSIP support"),
55- ("ublox", True, "u-blox Protocol support"),
5656+ ("pds", sys.platform.startswith('linux'),
5757+ "Qualcomm PDS support"),
5858 # Non-GPS protocols
5959 ("aivdm", True, "AIVDM support"),
6060 ("gpsclock", True, "Furuno GPSClock support"),
61- @@ -1156 ,6 +1158 ,14 @@ if not cleaning and not helping:
61+ @@ -1256 ,6 +1258 ,14 @@ if not cleaning and not helping:
6262 announce("You do not have kernel CANbus available.")
6363 config.env["nmea2000"] = False
6464
@@ -73,7 +73,7 @@ index e3fed4c27..cae23de9c 100644
7373 # check for C11 or better, and __STDC__NO_ATOMICS__ is not defined
7474 # before looking for stdatomic.h
7575 if ((config.CheckC11() and
76- @@ -1684 ,6 +1694 ,7 @@ libgpsd_sources = [
76+ @@ -1829 ,6 +1839 ,7 @@ libgpsd_sources = [
7777 "drivers/driver_nmea0183.c",
7878 "drivers/driver_nmea2000.c",
7979 "drivers/driver_oncore.c",
@@ -83,7 +83,7 @@ index e3fed4c27..cae23de9c 100644
8383 "drivers/drivers.c",
8484diff --git a/drivers/driver_pds.c b/drivers/driver_pds.c
8585new file mode 100644
86- index 000000000..2ac77ec17
86+ index 000000000..ddddd1c82
8787--- /dev/null
8888+++ b/drivers/driver_pds.c
8989@@ -0,0 +1,407 @@
@@ -218,7 +218,7 @@ index 000000000..2ac77ec17
218218+ }
219219+
220220+ session->driver.pds.ready = 1;
221- + session->device_type->event_hook(session, event_reactivate );
221+ + session->device_type->event_hook(session, EVENT_REACTIVATE );
222222+ return 1;
223223+ }
224224+
@@ -293,7 +293,7 @@ index 000000000..2ac77ec17
293293+ int ret;
294294+
295295+ switch (event) {
296- + case event_deactivate :
296+ + case EVENT_DEACTIVATE :
297297+ if (!session->driver.pds.ready)
298298+ return;
299299+
@@ -318,7 +318,7 @@ index 000000000..2ac77ec17
318318+ return;
319319+ }
320320+ break;
321- + case event_reactivate :
321+ + case EVENT_REACTIVATE :
322322+ if (!session->driver.pds.ready)
323323+ return;
324324+
@@ -495,30 +495,30 @@ index 000000000..2ac77ec17
495495+
496496+ #endif /* of defined(PDS_ENABLE) */
497497diff --git a/drivers/drivers.c b/drivers/drivers.c
498- index 5c7c67b30..47a292423 100644
498+ index ecf5140e7..a1e85d307 100644
499499--- a/drivers/drivers.c
500500+++ b/drivers/drivers.c
501- @@ -1694,6 +1694,7 @@ extern const struct gps_type_t driver_greis;
502- extern const struct gps_type_t driver_italk;
501+ @@ -1698,6 +1698,7 @@ extern const struct gps_type_t driver_italk;
503502 extern const struct gps_type_t driver_navcom;
504503 extern const struct gps_type_t driver_nmea2000;
505- + extern const struct gps_type_t driver_pds;
506504 extern const struct gps_type_t driver_oncore;
505+ + extern const struct gps_type_t driver_pds;
507506 extern const struct gps_type_t driver_sirf;
508507 extern const struct gps_type_t driver_skytraq;
509- @@ -1787,6 +1788,10 @@ static const struct gps_type_t *gpsd_driver_array[] = {
508+ extern const struct gps_type_t driver_superstar2;
509+ @@ -1786,6 +1787,10 @@ static const struct gps_type_t *gpsd_driver_array[] = {
510510 &driver_nmea2000,
511511 #endif // NMEA2000_ENABLE
512512
513513+ #ifdef PDS_ENABLE
514514+ &driver_pds,
515515+ #endif /* PDS_ENABLE */
516516+
517- #ifdef RTCM104V2_ENABLE
518517 &driver_rtcm104v2,
519- #endif // RTCM104V2_ENABLE
518+ &driver_rtcm104v3,
519+ #ifdef GARMINTXT_ENABLE
520520diff --git a/gpsd/libgpsd_core.c b/gpsd/libgpsd_core.c
521- index 60a7c2e2f..ceebb1a2a 100644
521+ index f328648f7..abc385867 100644
522522--- a/gpsd/libgpsd_core.c
523523+++ b/gpsd/libgpsd_core.c
524524@@ -39,6 +39,9 @@
@@ -531,7 +531,7 @@ index 60a7c2e2f..ceebb1a2a 100644
531531
532532 // pass low-level data to devices straight through
533533 ssize_t gpsd_write(struct gps_device_t *session,
534- @@ -358 ,6 +361 ,11 @@ void gpsd_deactivate(struct gps_device_t *session)
534+ @@ -380 ,6 +383 ,11 @@ void gpsd_deactivate(struct gps_device_t *session)
535535 (void)nmea2000_close(session);
536536 } else
537537 #endif // NMEA2000_ENABLE
@@ -543,7 +543,7 @@ index 60a7c2e2f..ceebb1a2a 100644
543543 {
544544 // could be serial, udp://, tcp://, etc.
545545 gpsd_close(session);
546- @@ -629 ,6 +637 ,11 @@ int gpsd_open(struct gps_device_t *session)
546+ @@ -682 ,6 +690 ,11 @@ int gpsd_open(struct gps_device_t *session)
547547 #endif // defined(NMEA2000_ENABLE)
548548 /* fall through to plain serial open.
549549 * could be a naked /dev/ppsX */
@@ -555,8 +555,8 @@ index 60a7c2e2f..ceebb1a2a 100644
555555 return gpsd_serial_open(session);
556556 }
557557
558- @@ -656 ,7 +669 ,8 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
559- #ifdef NON_NMEA0183_ENABLE
558+ @@ -729 ,7 +742 ,8 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
559+
560560 // if it's a sensor, it must be probed
561561 if ((SERVICE_SENSOR == session->servicetype) &&
562562- (SOURCE_CAN != session->sourcetype)) {
@@ -592,18 +592,18 @@ index 000000000..3b373743d
592592+ #endif /* of defined(PDS_ENABLE) */
593593+ #endif /* of ifndef _DRIVER_PDS_H_ */
594594diff --git a/include/gpsd.h b/include/gpsd.h
595- index 110c5601f..b55f1913c 100644
595+ index fb8e63586..e85e0c37d 100644
596596--- a/include/gpsd.h
597597+++ b/include/gpsd.h
598- @@ -464 ,6 +464 ,7 @@ typedef enum {SOURCE_UNKNOWN,
598+ @@ -489 ,6 +489 ,7 @@ typedef enum {SOURCE_UNKNOWN,
599599 SOURCE_USB, // potential GPS source, discoverable
600600 SOURCE_BLUETOOTH, // potential GPS source, discoverable
601601 SOURCE_CAN, // potential GPS source, fixed CAN format
602602+ SOURCE_QRTR, // potential GPS source, discoverable
603603 SOURCE_PTY, // PTY: we don't require exclusive access
604604 SOURCE_TCP, // TCP/IP stream: case detected but not used
605605 SOURCE_UDP, // UDP stream: case detected but not used
606- @@ -800 ,6 +801 ,14 @@ struct gps_device_t {
606+ @@ -857 ,6 +858 ,14 @@ struct gps_device_t {
607607 char ais_channel;
608608 } aivdm;
609609 #endif // AIVDM_ENABLE
@@ -619,7 +619,7 @@ index 110c5601f..b55f1913c 100644
619619
620620 /*
621621diff --git a/man/gpsd.adoc b/man/gpsd.adoc
622- index 348c6b2b0..61013a8c3 100644
622+ index a5fbb4e8c..12376a5d1 100644
623623--- a/man/gpsd.adoc
624624+++ b/man/gpsd.adoc
625625@@ -242,6 +242,14 @@ NMEA2000 CAN data::
@@ -638,5 +638,5 @@ index 348c6b2b0..61013a8c3 100644
638638 (The "ais:://" source type supported in some older versions of the
639639 daemon has been retired in favor of the more general "tcp://".)
640640- -
641- 2.33.0
641+ 2.47.3
642642
0 commit comments