File: gpsmon.h

package info (click to toggle)
gpsd 3.27-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,056 kB
  • sloc: ansic: 74,438; python: 16,521; sh: 890; cpp: 848; php: 225; makefile: 197; perl: 111; javascript: 26; xml: 11
file content (43 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* gpsmon.h -- what monitor capabuilities look like
 *
 * By Eric S. Raymond, 2009
 * This file is Copyright by the GPSD project
 * SPDX-License-Identifier: BSD-2-clause
 */

#ifndef _GPSD_GPSMON_H_
#define _GPSD_GPSMON_H_

#include <curses.h>

#define COMMAND_TERMINATE       -1
#define COMMAND_MATCH           1
#define COMMAND_UNKNOWN         0

struct monitor_object_t {
    // a device-specific capability table for the monitor
    bool (*initialize)(void);           // paint legends on windows
    void (*update)(void);               // now paint the data
    int (*command)(char[]);             // interpret device-specific commands
    void (*wrap)(void);                 // deallocate storage
    int min_y, min_x;                   // space required for device info
    const struct gps_type_t *driver;    // device driver table
};

// Device-specific may need these.
extern bool monitor_control_send(unsigned char *buf, size_t len);
extern void monitor_fixframe(WINDOW *win);
extern void monitor_log(const char *fmt, ...);
extern void monitor_complain(const char *fmt, ...);

#define BUFLEN          2048

extern WINDOW *devicewin;
extern struct gps_device_t      session;
extern bool serial;     // True - direct mode, False - daemon mode
void toff_update(WINDOW *, int, int);
void pps_update(WINDOW *, int, int);
void pastef(WINDOW *win, int y, int x, int flen, char *fmt, double f);

#endif  // _GPSD_GPSMON_H
// vim: set expandtab shiftwidth=4