Devuan fork of gpsd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
2.5 KiB

  1. /* This code is generated. Do not hand-hack it! */
  2. /*
  3. * Also, beware that it is something of a CPU hog when called on every packet.
  4. * Try to write guards so it is only called at higher log levels.
  5. */
  6. #include "gpsd_config.h" /* must be before all includes */
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include "gpsd.h"
  10. const char *gps_maskdump(gps_mask_t set)
  11. {
  12. static char buf[226];
  13. const struct {
  14. gps_mask_t mask;
  15. const char *name;
  16. } *sp, names[] = {
  17. {ONLINE_SET, "ONLINE"},
  18. {TIME_SET, "TIME"},
  19. {TIMERR_SET, "TIMERR"},
  20. {LATLON_SET, "LATLON"},
  21. {ALTITUDE_SET, "ALTITUDE"},
  22. {SPEED_SET, "SPEED"},
  23. {TRACK_SET, "TRACK"},
  24. {CLIMB_SET, "CLIMB"},
  25. {STATUS_SET, "STATUS"},
  26. {MODE_SET, "MODE"},
  27. {DOP_SET, "DOP"},
  28. {HERR_SET, "HERR"},
  29. {VERR_SET, "VERR"},
  30. {ATTITUDE_SET, "ATTITUDE"},
  31. {SATELLITE_SET, "SATELLITE"},
  32. {SPEEDERR_SET, "SPEEDERR"},
  33. {TRACKERR_SET, "TRACKERR"},
  34. {CLIMBERR_SET, "CLIMBERR"},
  35. {DEVICE_SET, "DEVICE"},
  36. {DEVICELIST_SET, "DEVICELIST"},
  37. {DEVICEID_SET, "DEVICEID"},
  38. {RTCM2_SET, "RTCM2"},
  39. {RTCM3_SET, "RTCM3"},
  40. {AIS_SET, "AIS"},
  41. {PACKET_SET, "PACKET"},
  42. {SUBFRAME_SET, "SUBFRAME"},
  43. {GST_SET, "GST"},
  44. {VERSION_SET, "VERSION"},
  45. {POLICY_SET, "POLICY"},
  46. {LOGMESSAGE_SET, "LOGMESSAGE"},
  47. {ERROR_SET, "ERROR"},
  48. {TOFF_SET, "TOFF"},
  49. {PPS_SET, "PPS"},
  50. {NAVDATA_SET, "NAVDATA"},
  51. {OSCILLATOR_SET, "OSCILLATOR"},
  52. {ECEF_SET, "ECEF"},
  53. {VECEF_SET, "VECEF"},
  54. {MAGNETIC_TRACK_SET, "MAGNETIC_TRACK"},
  55. {RAW_SET, "RAW"},
  56. {NED_SET, "NED"},
  57. {VNED_SET, "VNED"},
  58. {RAW_IS, "RAW"},
  59. {USED_IS, "USED"},
  60. {DRIVER_IS, "DRIVER"},
  61. {CLEAR_IS, "CLEAR"},
  62. {REPORT_IS, "REPORT"},
  63. {NODATA_IS, "NODATA"},
  64. {NTPTIME_IS, "NTPTIME"},
  65. {PERR_IS, "PERR"},
  66. {PASSTHROUGH_IS, "PASSTHROUGH"},
  67. {EOF_IS, "EOF"},
  68. {GOODTIME_IS, "GOODTIME"},
  69. };
  70. memset(buf, '\0', sizeof(buf));
  71. buf[0] = '{';
  72. for (sp = names; sp < names + sizeof(names)/sizeof(names[0]); sp++)
  73. if ((set & sp->mask)!=0) {
  74. (void)strlcat(buf, sp->name, sizeof(buf));
  75. (void)strlcat(buf, "|", sizeof(buf));
  76. }
  77. if (buf[1] != '\0')
  78. buf[strlen(buf)-1] = '\0';
  79. (void)strlcat(buf, "}", sizeof(buf));
  80. return buf;
  81. }