gps_json.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* gps_json.h - JSON handling for libgps and gpsd
  2. *
  3. * By Eric S. Raymond, 2009
  4. * This file is Copyright 2009 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 gps_mask_t, 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. const struct attitude_t *, const char *);
  27. void json_oscillator_dump(const struct gps_data_t *, char *, size_t);
  28. void json_subframe_dump(const struct gps_data_t *, const bool scaled, char buf[], size_t);
  29. void json_device_dump(const struct gps_device_t *, char *, size_t);
  30. void json_watch_dump(const struct gps_policy_t *, char *, size_t);
  31. int json_watch_read(const char *, struct gps_policy_t *,
  32. const char **);
  33. char *json_policy_to_watch(struct gps_policy_t *ccp,
  34. char *outbuf, size_t outbuf_len);
  35. int json_device_read(const char *, struct devconfig_t *,
  36. const char **);
  37. void json_version_dump(char *, size_t);
  38. void json_aivdm_dump(const struct ais_t *, const char *, bool,
  39. char *, size_t);
  40. int json_rtcm2_read(const char *, char *, size_t, struct rtcm2_t *,
  41. const char **);
  42. int json_rtcm3_read(const char *, char *, size_t, struct rtcm3_t *,
  43. const char **);
  44. int json_ais_read(const char *, char *, size_t, struct ais_t *,
  45. const char **);
  46. int libgps_json_unpack(const char *, struct gps_data_t *,
  47. const char **);
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. /* these values don't matter in themselves, they just have to be out-of-band */
  52. #define DEVDEFAULT_BPS 0
  53. #define DEVDEFAULT_PARITY 'X'
  54. #define DEVDEFAULT_STOPBITS 3
  55. #define DEVDEFAULT_NATIVE -1
  56. /* gps_json.h ends here */
  57. // vim: set expandtab shiftwidth=4