[CCode (lower_case_cprefix="", cprefix="", cheader_filename="gps.h")] namespace libgps { public const int MAXCHANNELS; [SimpleType] [IntegerType (rank = 9)] public struct mask_t {} [CCode (cname = "struct gps_fix_t")] public struct fix_t { double time; /* Time of update, seconds since Unix epoch */ int mode; /* Mode of fix */ double ept; /* Expected time uncertainty */ double latitude; /* Latitude in degrees (valid if mode >= 2) */ double epy; /* Latitude position uncertainty, meters */ double longitude; /* Longitude in degrees (valid if mode >= 2) */ double epx; /* Longitude position uncertainty, meters */ double altitude; /* Altitude in meters (valid if mode == 3) */ double epv; /* Vertical position uncertainty, meters */ double track; /* Course made good (relative to true north) */ double epd; /* Track uncertainty, degrees */ double speed; /* Speed over ground, meters/sec */ double eps; /* Speed uncertainty, meters/sec */ double climb; /* Vertical speed, meters/sec */ double epc; /* Vertical speed uncertainty */ } public const int MODE_NOT_SEEN; /* mode update not seen yet */ public const int MODE_NO_FIX; /* none */ public const int MODE_2D; /* good for latitude/longitude */ public const int MODE_3D; /* good for altitude/climb too */ [CCode (cname = "struct dop_t")] public struct dop_t { /* Dilution of precision factors */ double xdop; double ydop; double pdop; double hdop; double vdop; double tdop; double gdop; } [CCode (cname = "struct gps_data_t", destroy_function = "")] public struct data_t { mask_t set; double online; int gps_fd; fix_t fix; double separation; int status; int satellites_used; /* Number of satellites used in solution */ int[] used; /* PRNs of satellites used in solution */ dop_t dop; /* redundant with the estimate elements in the fix structure */ double epe; /* spherical position error, 95% confidence (meters) */ /* satellite status -- valid when satellites_visible > 0 */ double skyview_time; /* skyview timestamp */ int satellites_visible; /* # of satellites in view */ int[] PRN; /* PRNs of satellite */ int[] elevation; /* elevation of satellite */ int[] azimuth; /* azimuth */ double[] ss; /* signal-to-noise ratio (dB) */ //struct devconfig_t dev; /* device that shipped last update */ //struct policy_t policy; /* our listening policy */ //char tag[MAXTAGLEN+1]; /* tag of last sentence processed */ } public const int ONLINE_SET; public const int TIME_SET; public const int TIMERR_SET; public const int LATLON_SET; public const int ALTITUDE_SET; public const int SPEED_SET; public const int TRACK_SET; public const int CLIMB_SET; public const int STATUS_SET; public const int MODE_SET; public const int DOP_SET; public const int VERSION_SET; /* only used in client library */ public const int HERR_SET; public const int VERR_SET; public const int PERR_SET; public const int POLICY_SET; /* only used in client library */ public const int ERR_SET; public const int SATELLITE_SET; public const int RAW_SET; public const int USED_SET; public const int SPEEDERR_SET; public const int TRACKERR_SET; public const int CLIMBERR_SET; public const int DEVICE_SET; public const int DEVICELIST_SET; public const int DEVICEID_SET; public const int ERROR_SET; public const int RTCM2_SET; public const int RTCM3_SET; public const int AIS_SET; public const int PACKET_SET; public const int CLEAR_SET; /* sentence starts a reporting cycle */ public const int REPORT_SET; /* sentence ends a reporting cycle */ public const int DATA_SET; public const int STATUS_NO_FIX; /* no */ public const int STATUS_FIX; /* yes, without DGPS */ public const int STATUS_DGPS_FIX; /* yes, with DGPS */ [CCode (cname = "gps_open_r")] public int open_r(string server, string port, ref data_t gpsdata); [CCode (cname = "gps_close")] public int close(ref data_t gpsdata); [CCode (cname = "gps_errstr")] public weak string errstr(int err); [CCode (cname = "gps_poll")] public int poll(ref data_t gpsdata); [CCode (cname = "gps_waiting")] public bool waiting(ref data_t gpsdata); [CCode (cname = "gps_send")] public int send(ref data_t gpsdata, string fmt, ...); [CCode (cname = "gps_stream")] public int stream(ref data_t gpsdata, uint flags, void* data); /* mode flags for gps_stream() */ public int WATCH_DISABLE; /* disable watching */ public int WATCH_ENABLE; /* enable streaming */ public int WATCH_JSON; /* enable JSON output */ public int WATCH_NMEA; /* enable output in NMEA */ public int WATCH_RARE; /* enable output of packets in hex */ public int WATCH_RAW; /* enable output of raw packets */ public int WATCH_SCALED; /* scale output to floats, when applicable */ public int WATCH_NEWSTYLE; /* force JSON streaming */ public int WATCH_OLDSTYLE; /* force old-style streaming */ public int WATCH_DEVICE; /* watch specific device */ public int POLL_NONBLOCK; /* set non-blocking poll */ /* [CCode (cname = "struct input_event")] public struct Event { public Posix.timeval time; public uint16 type; public uint16 code; [CCode (cname="value")] public int32 val; } [CCode (cprefix="KEY_")] public enum Key { POWER } [CCode (cprefix="EV_")] public enum Type { SYN, KEY, REL, ABS, MSC, SW, LED, SND, REP, FF, PWR, FF_STATUS } } [CCode (cprefix="", cheader_filename="omhacks/all.h")] namespace Omhacks { [CCode (cname = "struct om_led", cheader_filename = "omhacks/led.h", destroy_function = "")] public struct Led { public char name[255]; public string dir; public int dir_len; public int brightness; public char trigger[255]; public int delay_on; public int delay_off; [CCode (cname = "om_led_init")] public int init(string name); [CCode (cname = "om_led_get")] public int get(); [CCode (cname = "om_led_set")] public int set(); } namespace Screen { namespace Brightness { [CCode (cname = "om_screen_brightness_get")] public int get(); [CCode (cname = "om_screen_brightness_get_max")] public int get_max(); [CCode (cname = "om_screen_brightness_set")] public int set(int val); } } namespace UEvent { [CCode (cname = "struct om_uevent", cheader_filename = "omhacks/uevent.h", destroy_function = "")] public struct Event { public string buffer; size_t buflen; weak string action; weak string devpath; weak string[] envp; } [CCode (cname = "om_uevent_open")] public int open(); [CCode (cname = "om_uevent_read")] public int read(int sock, ref Event ou); [CCode (cname = "om_uevent_parse")] public int parse(ref Event ou); } */ }