gpsmon.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* gpsmon.h -- what monitor capabuilities look like
  2. *
  3. * By Eric S. Raymond, 2009
  4. * This file is Copyright (c) 2010 by the GPSD project
  5. * SPDX-License-Identifier: BSD-2-clause
  6. */
  7. #ifndef _GPSD_GPSMON_H_
  8. #define _GPSD_GPSMON_H_
  9. #include <curses.h>
  10. #define COMMAND_TERMINATE -1
  11. #define COMMAND_MATCH 1
  12. #define COMMAND_UNKNOWN 0
  13. struct monitor_object_t {
  14. /* a device-specific capability table for the monitor */
  15. bool (*initialize)(void); /* paint legends on windows */
  16. void (*update)(void); /* now paint the data */
  17. int (*command)(char[]); /* interpret device-specific commands */
  18. void (*wrap)(void); /* deallocate storage */
  19. int min_y, min_x; /* space required for device info */
  20. const struct gps_type_t *driver; /* device driver table */
  21. };
  22. // Device-specific may need these.
  23. extern bool monitor_control_send(unsigned char *buf, size_t len);
  24. extern void monitor_fixframe(WINDOW *win);
  25. extern void monitor_log(const char *fmt, ...);
  26. extern void monitor_complain(const char *fmt, ...);
  27. #define BUFLEN 2048
  28. extern WINDOW *devicewin;
  29. extern struct gps_device_t session;
  30. extern bool serial; /* True - direct mode, False - daemon mode */
  31. void toff_update(WINDOW *, int, int);
  32. void pps_update(WINDOW *, int, int);
  33. #endif /* _GPSD_GPSMON_H_ */
  34. /* gpsmon.h ends here */