Pico GPS Teseo
Toggle main menu visibility
Loading...
Searching...
No Matches
gps_teseo_lib-src
teseo
teseo_iface.cpp
Go to the documentation of this file.
1
module
;
2
3
#include <string>
4
#include <utility>
5
#include <span>
6
7
export
module
teseo
;
8
9
import
callbackmanager
;
10
11
export
namespace
teseo
{
12
14
struct
nmea_rr
{
15
const
std::string
command
;
16
const
std::string
signature
;
17
nmea_rr
(
const
std::string&
command
,
const
std::string&
signature
) :
18
command
(
command
),
signature
(
signature
) {}
19
};
20
22
30
class
teseo
{
31
public
:
32
34
teseo
() : single_line_parser_() {}
35
37
57
inline
callbackmanager::Callback<void, const std::string&>
&
writer
() {
58
return
writer_;
59
}
60
62
67
inline
callbackmanager::Callback<void, std::string&>
&
reader
() {
68
return
reader_;
69
}
70
72
78
inline
callbackmanager::Callback<void>
&
resetter
() {
79
return
resetter_;
80
}
81
83
92
void
initialize
();
93
95
104
static
bool
parse_multiline_reply(std::span<std::string> strings,
const
std::string s,
unsigned
int
&
count
,
const
nmea_rr
& command);
105
107
113
void
write
(
const
std::string& s);
114
116
122
void
read
(std::string& s);
123
125
132
bool
ask_nmea(
const
nmea_rr
& command, std::string& s);
133
135
143
bool
ask_nmea_multiple(
const
nmea_rr
& command, std::span<std::string> strings,
unsigned
int
&
count
);
144
146
152
bool
ask_gll(std::string& s);
153
155
162
bool
ask_gsv(std::span<std::string> strings,
unsigned
int
&
count
);
163
165
172
bool
ask_gsa(std::span<std::string> strings,
unsigned
int
&
count
);
173
175
181
bool
ask_rmc(std::string& s);
182
184
190
bool
ask_gga(std::string& s);
191
193
199
bool
ask_vtg(std::string& s);
200
201
private
:
202
204
const
static
nmea_rr
gll_;
206
const
static
nmea_rr
gsv_;
208
const
static
nmea_rr
gsa_;
210
const
static
nmea_rr
gga_;
212
const
static
nmea_rr
rmc_;
214
const
static
nmea_rr
vtg_;
216
callbackmanager::Callback<void, const std::string&>
writer_;
218
callbackmanager::Callback<void, std::string&>
reader_;
220
callbackmanager::Callback<void>
resetter_;
222
std::array<std::string,2> single_line_parser_;
223
224
};
225
226
}
// namespace teseo
227
callbackmanager::Callback
Definition
callbackmanager.cpp:25
teseo::teseo::teseo
teseo()
constructor.
Definition
teseo_iface.cpp:34
teseo::teseo::writer
callbackmanager::Callback< void, const std::string & > & writer()
expose the callback manager for writing to Teseo.
Definition
teseo_iface.cpp:57
teseo::teseo::reader
callbackmanager::Callback< void, std::string & > & reader()
expose the callback manager for reading from Teseo
Definition
teseo_iface.cpp:67
teseo::teseo::resetter
callbackmanager::Callback< void > & resetter()
expose the callback manager for resetting the Teseo
Definition
teseo_iface.cpp:78
initialize
void initialize()
Definition
i2c/teseo_communicate.cpp:41
read
void read(::std::string &s)
Definition
i2c/teseo_communicate.cpp:59
write
void write(const ::std::string &s)
Definition
i2c/teseo_communicate.cpp:54
callbackmanager
teseo
teseo
Definition
teseo.cpp:11
teseo::nmea_rr
Struct holds combinations of NMEA commands and their reply signature validation string.
Definition
teseo_iface.cpp:14
teseo::nmea_rr::command
const std::string command
Definition
teseo_iface.cpp:15
teseo::nmea_rr::signature
const std::string signature
Definition
teseo_iface.cpp:16
teseo::nmea_rr::nmea_rr
nmea_rr(const std::string &command, const std::string &signature)
Definition
teseo_iface.cpp:17
count
uint count
Definition
teseo_nmea_with_data_processing.cpp:22
Generated by
1.17.0