-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathAP_GPS_Auto.h
48 lines (39 loc) · 1.31 KB
/
AP_GPS_Auto.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
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
//
// Auto-detecting pseudo-GPS driver
//
#ifndef AP_GPS_Auto_h
#define AP_GPS_Auto_h
#include "GPS.h"
class AP_GPS_Auto : public GPS
{
public:
/// Constructor
///
/// @note The stream is expected to be set up and configured for the
/// correct bitrate before ::init is called.
///
/// @param port Stream connected to the GPS module.
/// @param ptr Pointer to a GPS * that will be fixed up by ::init
/// when the GPS type has been detected.
///
AP_GPS_Auto(Stream *s, GPS **gps);
/// Dummy init routine, does nothing
virtual void init(enum GPS_Engine_Setting nav_setting = GPS_ENGINE_NONE);
/// Detect and initialise the attached GPS unit. Updates the
/// pointer passed into the constructor when a GPS is detected.
///
virtual bool read(void);
private:
/// Copy of the port, known at construction time to be a real Stream port.
Stream * _fs;
/// global GPS driver pointer, updated by auto-detection
///
GPS ** _gps;
/// low-level auto-detect routine
///
GPS * _detect(void);
static const prog_char _mtk_set_binary[];
static const prog_char _sirf_set_binary[];
};
#endif