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 
8 #ifndef _GPSD_GPSMON_H_
9 #define _GPSD_GPSMON_H_
10 
11 #include <curses.h>
12 
13 #define COMMAND_TERMINATE	-1
14 #define COMMAND_MATCH		1
15 #define COMMAND_UNKNOWN		0
16 
17 struct monitor_object_t {
18     /* a device-specific capability table for the monitor */
19     bool (*initialize)(void);		/* paint legends on windows */
20     void (*update)(void);		/* now paint the data */
21     int (*command)(char[]);		/* interpret device-specific commands */
22     void (*wrap)(void);			/* deallocate storage */
23     int min_y, min_x;			/* space required for device info */
24     const struct gps_type_t *driver;	/* device driver table */
25 };
26 
27 // Device-specific may need these.
28 extern bool monitor_control_send(unsigned char *buf, size_t len);
29 extern void monitor_fixframe(WINDOW *win);
30 extern void monitor_log(const char *fmt, ...);
31 extern void monitor_complain(const char *fmt, ...);
32 
33 #define BUFLEN		2048
34 
35 extern WINDOW *devicewin;
36 extern struct gps_device_t	session;
37 extern bool serial;	/* True - direct mode, False - daemon mode */
38 void toff_update(WINDOW *, int, int);
39 void pps_update(WINDOW *, int, int);
40 
41 #endif /* _GPSD_GPSMON_H_ */
42 /* gpsmon.h ends here */
43