-
Notifications
You must be signed in to change notification settings - Fork 2
/
ublox_worker.h
48 lines (34 loc) · 1.16 KB
/
ublox_worker.h
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
44
45
46
47
48
#pragma once
#include "ublox_device.h"
typedef struct UbloxWorker UbloxWorker;
typedef enum {
UbloxWorkerStateNone,
UbloxWorkerStateReady,
UbloxWorkerStateRead,
UbloxWorkerStateSyncTime,
UbloxWorkerStateResetOdometer,
UbloxWorkerStateStop,
} UbloxWorkerState;
typedef enum {
// reserve space for application events
UbloxWorkerEventReserved = 50,
UbloxWorkerEventSuccess,
UbloxWorkerEventFailed,
UbloxWorkerEventDataReady,
UbloxWorkerEventOdoReset,
// specific event to update the screen on log state changed
UbloxWorkerEventLogStateChanged,
} UbloxWorkerEvent;
typedef void (*UbloxWorkerCallback)(UbloxWorkerEvent event, void* context);
UbloxWorker* ublox_worker_alloc();
UbloxWorkerState ublox_worker_get_state(UbloxWorker* ublox_worker);
void ublox_worker_free(UbloxWorker* ublox_worker);
void ublox_worker_start(
UbloxWorker* ublox_worker,
UbloxWorkerState state,
UbloxWorkerCallback callback,
void* context);
void ublox_worker_stop(UbloxWorker* ublox_worker);
bool ublox_worker_init_gps();
void ublox_worker_read_nav_messages(void* context);
void ublox_worker_sync_to_gps_time(void* context);