gps_json.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* gps_json.h - JSON handling for libgps and gpsd
  2. *
  3. * By Eric S. Raymond, 2009
  4. * This file is Copyright (c) 2010-2019 by the GPSD project
  5. * SPDX-License-Identifier: BSD-2-clause
  6. */
  7. #include "json.h"
  8. #define GPS_JSON_COMMAND_MAX 80
  9. /* u-blox 9 can make really long JSON in "RAW" messages */
  10. #define GPS_JSON_RESPONSE_MAX 10240
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. struct gps_device_t;
  15. void json_data_report(const gps_mask_t,
  16. const struct gps_device_t *,
  17. const struct gps_policy_t *,
  18. char *, size_t);
  19. char *json_stringify(char *, size_t, const char *);
  20. void json_tpv_dump(const struct gps_device_t *,
  21. const struct gps_policy_t *, char *, size_t);
  22. void json_noise_dump(const struct gps_data_t *, char *, size_t);
  23. void json_raw_dump(const struct gps_data_t *, char *, size_t);
  24. void json_sky_dump(const struct gps_data_t *, char *, size_t);
  25. void json_att_dump(const struct gps_data_t *, char *, size_t);
  26. void json_oscillator_dump(const struct gps_data_t *, char *, size_t);
  27. void json_subframe_dump(const struct gps_data_t *, char buf[], size_t);
  28. void json_device_dump(const struct gps_device_t *, char *, size_t);
  29. void json_watch_dump(const struct gps_policy_t *, char *, size_t);
  30. int json_watch_read(const char *, struct gps_policy_t *,
  31. const char **);
  32. int json_device_read(const char *, struct devconfig_t *,
  33. const char **);
  34. void json_version_dump(char *, size_t);
  35. void json_aivdm_dump(const struct ais_t *, const char *, bool,
  36. char *, size_t);
  37. int json_rtcm2_read(const char *, char *, size_t, struct rtcm2_t *,
  38. const char **);
  39. int json_rtcm3_read(const char *, char *, size_t, struct rtcm3_t *,
  40. const char **);
  41. int json_ais_read(const char *, char *, size_t, struct ais_t *,
  42. const char **);
  43. int libgps_json_unpack(const char *, struct gps_data_t *,
  44. const char **);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. /* these values don't matter in themselves, they just have to be out-of-band */
  49. #define DEVDEFAULT_BPS 0
  50. #define DEVDEFAULT_PARITY 'X'
  51. #define DEVDEFAULT_STOPBITS 3
  52. #define DEVDEFAULT_NATIVE -1
  53. /* gps_json.h ends here */