monitor_nmea0183.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. /*
  2. * monitor_nmea0183.c - gpsmon support for NMEA devices.
  3. *
  4. * To do: Support for GPGLL, GPGBS, GPZDA, PASHR NMEA sentences.
  5. *
  6. * This file is Copyright (c) 2010-2018 by the GPSD project
  7. * SPDX-License-Identifier: BSD-2-clause
  8. */
  9. #include "gpsd_config.h" /* must be before all includes */
  10. #include <stdio.h>
  11. #include <string.h>
  12. #include <math.h>
  13. #include <stdlib.h> /* for labs() */
  14. #include <assert.h>
  15. #include <stdarg.h>
  16. #include <unistd.h>
  17. #include "gpsd.h"
  18. #include "gpsmon.h"
  19. #include "gpsdclient.h"
  20. #include "strfuncs.h"
  21. #ifdef NMEA0183_ENABLE
  22. extern const struct gps_type_t driver_nmea0183;
  23. static WINDOW *cookedwin, *nmeawin, *satwin, *gprmcwin, *gpggawin, *gpgsawin, *gpgstwin;
  24. static timespec_t last_tick, tick_interval;
  25. static char sentences[NMEA_MAX * 2];
  26. /*****************************************************************************
  27. *
  28. * NMEA0183 support
  29. *
  30. *****************************************************************************/
  31. #define SENTENCELINE 1 /* index of sentences line in the NMEA window */
  32. #define MAXSATS 12 /* max satellites we can display */
  33. static bool nmea_initialize(void)
  34. {
  35. int i;
  36. cookedwin = derwin(devicewin, 3, 80, 0, 0);
  37. assert(cookedwin !=NULL);
  38. (void)wborder(cookedwin, 0, 0, 0, 0, 0, 0, 0, 0);
  39. (void)syncok(cookedwin, true);
  40. (void)wattrset(cookedwin, A_BOLD);
  41. (void)mvwaddstr(cookedwin, 1, 1, "Time: ");
  42. (void)mvwaddstr(cookedwin, 1, 32, "Lat: ");
  43. (void)mvwaddstr(cookedwin, 1, 55, "Lon: ");
  44. (void)mvwaddstr(cookedwin, 2, 34, " Cooked TPV ");
  45. (void)wattrset(cookedwin, A_NORMAL);
  46. nmeawin = derwin(devicewin, 3, 80, 3, 0);
  47. assert(nmeawin !=NULL);
  48. (void)wborder(nmeawin, 0, 0, 0, 0, 0, 0, 0, 0);
  49. (void)syncok(nmeawin, true);
  50. (void)wattrset(nmeawin, A_BOLD);
  51. (void)mvwaddstr(nmeawin, 2, 34, " Sentences ");
  52. (void)wattrset(nmeawin, A_NORMAL);
  53. satwin = derwin(devicewin, MAXSATS + 3, 20, 6, 0);
  54. assert(satwin !=NULL);
  55. (void)wborder(satwin, 0, 0, 0, 0, 0, 0, 0, 0), (void)syncok(satwin, true);
  56. (void)wattrset(satwin, A_BOLD);
  57. (void)mvwprintw(satwin, 1, 1, "Ch PRN Az El S/N");
  58. for (i = 0; i < MAXSATS; i++)
  59. (void)mvwprintw(satwin, (int)(i + 2), 1, "%2d", i);
  60. (void)mvwprintw(satwin, 14, 7, " GSV ");
  61. (void)wattrset(satwin, A_NORMAL);
  62. gprmcwin = derwin(devicewin, 9, 30, 6, 20);
  63. assert(gprmcwin !=NULL);
  64. (void)wborder(gprmcwin, 0, 0, 0, 0, 0, 0, 0, 0),
  65. (void)syncok(gprmcwin, true);
  66. (void)wattrset(gprmcwin, A_BOLD);
  67. (void)mvwprintw(gprmcwin, 1, 1, "Time: ");
  68. (void)mvwprintw(gprmcwin, 2, 1, "Latitude: ");
  69. (void)mvwprintw(gprmcwin, 3, 1, "Longitude: ");
  70. (void)mvwprintw(gprmcwin, 4, 1, "Speed: ");
  71. (void)mvwprintw(gprmcwin, 5, 1, "Course: ");
  72. (void)mvwprintw(gprmcwin, 6, 1, "Status: FAA: ");
  73. (void)mvwprintw(gprmcwin, 7, 1, "MagVar: ");
  74. (void)mvwprintw(gprmcwin, 8, 12, " RMC ");
  75. (void)wattrset(gprmcwin, A_NORMAL);
  76. gpgsawin = derwin(devicewin, 6, 30, 15, 20);
  77. assert(gpgsawin !=NULL);
  78. (void)wborder(gpgsawin, 0, 0, 0, 0, 0, 0, 0, 0);
  79. (void)syncok(gpgsawin, true);
  80. (void)wattrset(gpgsawin, A_BOLD);
  81. #define MODE_LINE 1
  82. (void)mvwprintw(gpgsawin, MODE_LINE, 1, "Mode: ");
  83. #define SATS_LINE 1
  84. #define SATS_COL 10
  85. (void)mvwprintw(gpgsawin, SATS_LINE, SATS_COL, "Sats: ");
  86. #define DOP_LINE 2
  87. (void)mvwprintw(gpgsawin, DOP_LINE, 1, "DOP: H= V= P=");
  88. #define TOFF_LINE 3
  89. (void)mvwprintw(gpgsawin, TOFF_LINE, 1, "TOFF: ");
  90. (void)mvwaddstr(gpgsawin, TOFF_LINE, 7, "N/A");
  91. #define PPS_LINE 4
  92. (void)mvwprintw(gpgsawin, PPS_LINE, 1, "PPS: ");
  93. (void)mvwaddstr(gpgsawin, PPS_LINE, 6, "N/A");
  94. (void)mvwprintw(gpgsawin, 5, 9, " GSA + PPS ");
  95. (void)wattrset(gpgsawin, A_NORMAL);
  96. (void)syncok(gpgsawin, true);
  97. gpggawin = derwin(devicewin, 9, 30, 6, 50);
  98. assert(gpggawin !=NULL);
  99. (void)wborder(gpggawin, 0, 0, 0, 0, 0, 0, 0, 0);
  100. (void)syncok(gpggawin, true);
  101. (void)wattrset(gpggawin, A_BOLD);
  102. (void)mvwprintw(gpggawin, 1, 1, "Time: ");
  103. (void)mvwprintw(gpggawin, 2, 1, "Latitude: ");
  104. (void)mvwprintw(gpggawin, 3, 1, "Longitude: ");
  105. (void)mvwprintw(gpggawin, 4, 1, "Altitude: ");
  106. (void)mvwprintw(gpggawin, 5, 1, "Quality: Sats: ");
  107. (void)mvwprintw(gpggawin, 6, 1, "HDOP: ");
  108. (void)mvwprintw(gpggawin, 7, 1, "Geoid: ");
  109. (void)mvwprintw(gpggawin, 8, 12, " GGA ");
  110. (void)wattrset(gpggawin, A_NORMAL);
  111. gpgstwin = derwin(devicewin, 6, 30, 15, 50);
  112. assert(gpgstwin !=NULL);
  113. (void)wborder(gpgstwin, 0, 0, 0, 0, 0, 0, 0, 0);
  114. (void)syncok(gpgstwin, true);
  115. (void)wattrset(gpgstwin, A_BOLD);
  116. (void)mvwprintw(gpgstwin, 1, 1, "UTC: ");
  117. (void)mvwprintw(gpgstwin, 1, 16, "RMS: ");
  118. (void)mvwprintw(gpgstwin, 2, 1, "MAJ: ");
  119. (void)mvwprintw(gpgstwin, 2, 16, "MIN: ");
  120. (void)mvwprintw(gpgstwin, 3, 1, "ORI: ");
  121. (void)mvwprintw(gpgstwin, 3, 16, "LAT: ");
  122. (void)mvwprintw(gpgstwin, 4, 1, "LON: ");
  123. (void)mvwprintw(gpgstwin, 4, 16, "ALT: ");
  124. (void)mvwprintw(gpgstwin, 5, 12, " GST ");
  125. (void)wattrset(gpgstwin, A_NORMAL);
  126. (void)clock_gettime(CLOCK_REALTIME, &last_tick);
  127. sentences[0] = '\0';
  128. return (nmeawin != NULL);
  129. }
  130. static void cooked_pvt(void)
  131. {
  132. char scr[128];
  133. if (0 < session.gpsdata.fix.time.tv_sec) {
  134. (void)timespec_to_iso8601(session.gpsdata.fix.time, scr, sizeof(scr));
  135. } else
  136. (void)snprintf(scr, sizeof(scr), "n/a");
  137. (void)mvwprintw(cookedwin, 1, 7, "%-24s", scr);
  138. if (session.gpsdata.fix.mode >= MODE_2D) {
  139. deg_to_str2(deg_ddmm, session.gpsdata.fix.latitude,
  140. scr, sizeof(scr), " N", " S");
  141. } else
  142. (void)strncpy(scr, "n/a", sizeof(scr));
  143. (void)mvwprintw(cookedwin, 1, 37, "%-17s", scr);
  144. if (session.gpsdata.fix.mode >= MODE_2D) {
  145. deg_to_str2(deg_ddmm, session.gpsdata.fix.longitude,
  146. scr, sizeof(scr), " E", " W");
  147. } else
  148. (void)strncpy(scr, "n/a", sizeof(scr));
  149. (void)mvwprintw(cookedwin, 1, 60, "%-17s", scr);
  150. }
  151. static void monitor_satlist(WINDOW *win, int y, int x)
  152. /* display as much as we can of a satlist in a specified window */
  153. {
  154. int ymax, xmax;
  155. char scr[128];
  156. int i;
  157. assert(win != NULL);
  158. (void)wmove(win, y, x);
  159. (void)wclrtoeol(win);
  160. scr[0] = '\0';
  161. for (i = 0; i < MAXCHANNELS; i++) {
  162. if (session.gpsdata.skyview[i].used)
  163. str_appendf(scr, sizeof(scr),
  164. "%d ", session.gpsdata.skyview[i].PRN);
  165. }
  166. getmaxyx(win, ymax, xmax);
  167. assert(ymax != 0); /* suppress compiler warning */
  168. (void)mvwaddnstr(win, y, x, scr, xmax - 2 - x);
  169. if (strlen(scr) >= (size_t) (xmax - 2)) {
  170. (void)mvwaddch(win, y, xmax - 2 - x, (chtype) '.');
  171. (void)mvwaddch(win, y, xmax - 3 - x, (chtype) '.');
  172. (void)mvwaddch(win, y, xmax - 4 - x, (chtype) '.');
  173. }
  174. monitor_fixframe(win);
  175. }
  176. static void nmea_update(void)
  177. {
  178. char **fields;
  179. assert(cookedwin != NULL);
  180. assert(nmeawin != NULL);
  181. assert(gpgsawin != NULL);
  182. assert(gpggawin != NULL);
  183. assert(gprmcwin != NULL);
  184. assert(gpgstwin != NULL);
  185. /* can be NULL if packet was overlong */
  186. fields = session.nmea.field;
  187. if (session.lexer.outbuffer[0] == (unsigned char)'$'
  188. && fields != NULL && fields[0] != NULL) {
  189. int ymax, xmax;
  190. timespec_t now;
  191. timespec_t ts_diff;
  192. getmaxyx(nmeawin, ymax, xmax);
  193. assert(ymax > 0);
  194. if (strstr(sentences, fields[0]) == NULL) {
  195. char *s_end = sentences + strlen(sentences);
  196. if ((int)(strlen(sentences) + strlen(fields[0])) < xmax - 2) {
  197. *s_end++ = ' ';
  198. (void)strlcpy(s_end, fields[0], NMEA_MAX);
  199. } else {
  200. *--s_end = '.';
  201. *--s_end = '.';
  202. *--s_end = '.';
  203. }
  204. (void)mvwaddstr(nmeawin, SENTENCELINE, 1, sentences);
  205. }
  206. /*
  207. * If the interval between this and last update is
  208. * the longest we've seen yet, boldify the corresponding
  209. * tag.
  210. */
  211. (void)clock_gettime(CLOCK_REALTIME, &now);
  212. TS_SUB(&ts_diff, &now, &last_tick);
  213. if (TS_GZ(&ts_diff) && TS_GT(&ts_diff, &tick_interval)) {
  214. char *findme = strstr(sentences, fields[0]);
  215. tick_interval = ts_diff;
  216. if (findme != NULL) {
  217. (void)mvwchgat(nmeawin, SENTENCELINE, 1, xmax - 13, A_NORMAL, 0,
  218. NULL);
  219. (void)mvwchgat(nmeawin, SENTENCELINE, 1 + (findme - sentences),
  220. (int)strlen(fields[0]), A_BOLD, 0, NULL);
  221. }
  222. }
  223. last_tick = now;
  224. if (strcmp(fields[0], "GPGSV") == 0
  225. || strcmp(fields[0], "GNGSV") == 0
  226. || strcmp(fields[0], "GLGSV") == 0) {
  227. int i;
  228. int nsats =
  229. (session.gpsdata.satellites_visible <
  230. MAXSATS) ? session.gpsdata.satellites_visible : MAXSATS;
  231. for (i = 0; i < nsats; i++) {
  232. (void)wmove(satwin, i + 2, 3);
  233. (void)wprintw(satwin, " %3d %3d%3d %3.0f",
  234. session.gpsdata.skyview[i].PRN,
  235. session.gpsdata.skyview[i].azimuth,
  236. session.gpsdata.skyview[i].elevation,
  237. session.gpsdata.skyview[i].ss);
  238. }
  239. /* add overflow mark to the display */
  240. if (nsats <= MAXSATS)
  241. (void)mvwaddch(satwin, MAXSATS + 2, 18, ACS_HLINE);
  242. else
  243. (void)mvwaddch(satwin, MAXSATS + 2, 18, ACS_DARROW);
  244. }
  245. if (strcmp(fields[0], "GPRMC") == 0
  246. || strcmp(fields[0], "GNRMC") == 0
  247. || strcmp(fields[0], "GLRMC") == 0) {
  248. /* time, lat, lon, course, speed */
  249. (void)mvwaddstr(gprmcwin, 1, 12, fields[1]);
  250. (void)mvwprintw(gprmcwin, 2, 12, "%12s %s", fields[3], fields[4]);
  251. (void)mvwprintw(gprmcwin, 3, 12, "%12s %s", fields[5], fields[6]);
  252. (void)mvwaddstr(gprmcwin, 4, 12, fields[7]);
  253. (void)mvwaddstr(gprmcwin, 5, 12, fields[8]);
  254. /* the status field, FAA code, and magnetic variation */
  255. (void)mvwaddstr(gprmcwin, 6, 12, fields[2]);
  256. (void)mvwaddstr(gprmcwin, 6, 25, fields[12]);
  257. (void)mvwprintw(gprmcwin, 7, 12, "%-5s%s", fields[10],
  258. fields[11]);
  259. cooked_pvt(); /* cooked version of TPV */
  260. }
  261. if (strcmp(fields[0], "GPGSA") == 0
  262. || strcmp(fields[0], "GNGSA") == 0
  263. || strcmp(fields[0], "GLGSA") == 0) {
  264. (void)mvwprintw(gpgsawin, MODE_LINE, 7, "%1s%s", fields[1], fields[2]);
  265. monitor_satlist(gpgsawin, SATS_LINE, SATS_COL+6);
  266. (void)mvwprintw(gpgsawin, DOP_LINE, 8, "%-5s", fields[16]);
  267. (void)mvwprintw(gpgsawin, DOP_LINE, 16, "%-5s", fields[17]);
  268. (void)mvwprintw(gpgsawin, DOP_LINE, 24, "%-5s", fields[15]);
  269. monitor_fixframe(gpgsawin);
  270. }
  271. toff_update(gpgsawin, TOFF_LINE, 7);
  272. if (strcmp(fields[0], "GPGGA") == 0
  273. || strcmp(fields[0], "GNGGA") == 0
  274. || strcmp(fields[0], "GLGGA") == 0) {
  275. (void)mvwprintw(gpggawin, 1, 12, "%-17s", fields[1]);
  276. (void)mvwprintw(gpggawin, 2, 12, "%-17s", fields[2]);
  277. (void)mvwprintw(gpggawin, 3, 12, "%-17s", fields[4]);
  278. (void)mvwprintw(gpggawin, 4, 12, "%-17s", fields[9]);
  279. (void)mvwprintw(gpggawin, 5, 12, "%1.1s", fields[6]);
  280. (void)mvwprintw(gpggawin, 5, 22, "%2.2s", fields[7]);
  281. (void)mvwprintw(gpggawin, 6, 12, "%-5.5s", fields[8]);
  282. (void)mvwprintw(gpggawin, 7, 12, "%-5.5s", fields[11]);
  283. }
  284. if (strcmp(fields[0], "GPGST") == 0) {
  285. (void)mvwprintw(gpgstwin, 1, 6, "%-10s", fields[1]);
  286. (void)mvwprintw(gpgstwin, 1, 21, "%-8s", fields[2]);
  287. (void)mvwprintw(gpgstwin, 2, 6, "%-10s", fields[3]);
  288. (void)mvwprintw(gpgstwin, 2, 21, "%-8s", fields[4]);
  289. (void)mvwprintw(gpgstwin, 3, 6, "%-10s", fields[5]);
  290. (void)mvwprintw(gpgstwin, 3, 21, "%-8s", fields[6]);
  291. (void)mvwprintw(gpgstwin, 4, 6, "%-10s", fields[7]);
  292. (void)mvwprintw(gpgstwin, 4, 21, "%-8s", fields[8]);
  293. }
  294. }
  295. pps_update(gpgsawin, PPS_LINE, 6);
  296. }
  297. #undef SENTENCELINE
  298. static void nmea_wrap(void)
  299. {
  300. (void)delwin(nmeawin);
  301. (void)delwin(gpgsawin);
  302. (void)delwin(gpggawin);
  303. (void)delwin(gprmcwin);
  304. }
  305. const struct monitor_object_t nmea_mmt = {
  306. .initialize = nmea_initialize,
  307. .update = nmea_update,
  308. .command = NULL,
  309. .wrap = nmea_wrap,
  310. .min_y = 21,.min_x = 80,
  311. .driver = &driver_nmea0183,
  312. };
  313. /*****************************************************************************
  314. *
  315. * Extended NMEA support
  316. *
  317. *****************************************************************************/
  318. #if defined(CONTROLSEND_ENABLE) && defined(ASHTECH_ENABLE)
  319. static void monitor_nmea_send(const char *fmt, ...)
  320. {
  321. char buf[BUFSIZ];
  322. va_list ap;
  323. va_start(ap, fmt);
  324. (void)vsnprintf(buf, sizeof(buf) - 5, fmt, ap);
  325. va_end(ap);
  326. (void)monitor_control_send((unsigned char *)buf, strlen(buf));
  327. }
  328. #endif /* defined(CONTROLSEND_ENABLE) && defined(ASHTECH_ENABLE) */
  329. /*
  330. * Yes, it's OK for most of these to be clones of the generic NMEA monitor
  331. * object except for the pointer to the GPSD driver. That pointer makes
  332. * a difference, as it will automatically enable stuff like speed-switcher
  333. * and mode-switcher commands. It's really only necessary to write a
  334. * separate monitor object if you want to change the device-window
  335. * display or implement device-specific commands.
  336. */
  337. #if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
  338. extern const struct gps_type_t driver_garmin;
  339. const struct monitor_object_t garmin_mmt = {
  340. .initialize = nmea_initialize,
  341. .update = nmea_update,
  342. .command = NULL,
  343. .wrap = nmea_wrap,
  344. .min_y = 21,.min_x = 80,
  345. .driver = &driver_garmin,
  346. };
  347. #endif /* GARMIN_ENABLE && NMEA0183_ENABLE */
  348. #ifdef ASHTECH_ENABLE
  349. extern const struct gps_type_t driver_ashtech;
  350. #define ASHTECH_SPEED_9600 5
  351. #define ASHTECH_SPEED_57600 8
  352. #ifdef CONTROLSEND_ENABLE
  353. static int ashtech_command(char line[])
  354. {
  355. switch (line[0]) {
  356. case 'N': /* normal = 9600, GGA+GSA+GSV+RMC+ZDA */
  357. monitor_nmea_send("$PASHS,NME,ALL,A,OFF"); /* silence outbound chatter */
  358. monitor_nmea_send("$PASHS,NME,ALL,B,OFF");
  359. monitor_nmea_send("$PASHS,NME,GGA,A,ON");
  360. monitor_nmea_send("$PASHS,NME,GSA,A,ON");
  361. monitor_nmea_send("$PASHS,NME,GSV,A,ON");
  362. monitor_nmea_send("$PASHS,NME,RMC,A,ON");
  363. monitor_nmea_send("$PASHS,NME,ZDA,A,ON");
  364. monitor_nmea_send("$PASHS,INI,%d,%d,,,0,",
  365. ASHTECH_SPEED_9600, ASHTECH_SPEED_9600);
  366. (void)sleep(6); /* it takes 4-6 sec for the receiver to reboot */
  367. monitor_nmea_send("$PASHS,WAS,ON"); /* enable WAAS */
  368. break;
  369. case 'R': /* raw = 57600, normal+XPG+POS+SAT+MCA+PBN+SNV */
  370. monitor_nmea_send("$PASHS,NME,ALL,A,OFF"); /* silence outbound chatter */
  371. monitor_nmea_send("$PASHS,NME,ALL,B,OFF");
  372. monitor_nmea_send("$PASHS,NME,GGA,A,ON");
  373. monitor_nmea_send("$PASHS,NME,GSA,A,ON");
  374. monitor_nmea_send("$PASHS,NME,GSV,A,ON");
  375. monitor_nmea_send("$PASHS,NME,RMC,A,ON");
  376. monitor_nmea_send("$PASHS,NME,ZDA,A,ON");
  377. monitor_nmea_send("$PASHS,INI,%d,%d,,,0,",
  378. ASHTECH_SPEED_57600, ASHTECH_SPEED_9600);
  379. (void)sleep(6); /* it takes 4-6 sec for the receiver to reboot */
  380. monitor_nmea_send("$PASHS,WAS,ON"); /* enable WAAS */
  381. monitor_nmea_send("$PASHS,NME,POS,A,ON"); /* Ashtech TPV solution */
  382. monitor_nmea_send("$PASHS,NME,SAT,A,ON"); /* Ashtech Satellite status */
  383. monitor_nmea_send("$PASHS,NME,MCA,A,ON"); /* MCA measurements */
  384. monitor_nmea_send("$PASHS,NME,PBN,A,ON"); /* ECEF TPV solution */
  385. monitor_nmea_send("$PASHS,NME,SNV,A,ON,10"); /* Almanac data */
  386. monitor_nmea_send("$PASHS,NME,XMG,A,ON"); /* exception messages */
  387. break;
  388. default:
  389. return COMMAND_UNKNOWN;
  390. }
  391. return COMMAND_UNKNOWN;
  392. }
  393. #endif /* CONTROLSEND_ENABLE */
  394. const struct monitor_object_t ashtech_mmt = {
  395. .initialize = nmea_initialize,
  396. .update = nmea_update,
  397. #ifdef CONTROLSEND_ENABLE
  398. .command = ashtech_command,
  399. #else
  400. .command = NULL,
  401. #endif /* CONTROLSEND_ENABLE */
  402. .wrap = nmea_wrap,
  403. .min_y = 21,.min_x = 80,
  404. .driver = &driver_ashtech,
  405. };
  406. #endif /* ASHTECH_ENABLE */
  407. #ifdef FV18_ENABLE
  408. extern const struct gps_type_t driver_fv18;
  409. const struct monitor_object_t fv18_mmt = {
  410. .initialize = nmea_initialize,
  411. .update = nmea_update,
  412. .command = NULL,
  413. .wrap = nmea_wrap,
  414. .min_y = 21,.min_x = 80,
  415. .driver = &driver_fv18,
  416. };
  417. #endif /* FV18_ENABLE */
  418. #ifdef GPSCLOCK_ENABLE
  419. extern const struct gps_type_t driver_gpsclock;
  420. const struct monitor_object_t gpsclock_mmt = {
  421. .initialize = nmea_initialize,
  422. .update = nmea_update,
  423. .command = NULL,
  424. .wrap = nmea_wrap,
  425. .min_y = 21,.min_x = 80,
  426. .driver = &driver_gpsclock,
  427. };
  428. #endif /* GPSCLOCK_ENABLE */
  429. #ifdef MTK3301_ENABLE
  430. extern const struct gps_type_t driver_mtk3301;
  431. const struct monitor_object_t mtk3301_mmt = {
  432. .initialize = nmea_initialize,
  433. .update = nmea_update,
  434. .command = NULL,
  435. .wrap = nmea_wrap,
  436. .min_y = 21,.min_x = 80,
  437. .driver = &driver_mtk3301,
  438. };
  439. #endif /* MTK3301_ENABLE */
  440. #ifdef AIVDM_ENABLE
  441. extern const struct gps_type_t driver_aivdm;
  442. const struct monitor_object_t aivdm_mmt = {
  443. .initialize = nmea_initialize,
  444. .update = nmea_update,
  445. .command = NULL,
  446. .wrap = nmea_wrap,
  447. .min_y = 21,.min_x = 80,
  448. .driver = &driver_aivdm,
  449. };
  450. #endif /* AIVDM_ENABLE */
  451. #endif /* NMEA0183_ENABLE */