Pico GPS Teseo I2C
Loading...
Searching...
No Matches
teseo_iface.cpp
Go to the documentation of this file.
1module;
2
3#include <string>
4// std::pair
5#include <utility>
6#include <span>
7
8export module teseo;
9
10import callbackmanager;
11
12export namespace teseo {
13
17using nmea_rr = const std::pair<const std::string, const std::string>;
18
20
28class teseo {
29public:
30
32 teseo() : single_line_parser_() {}
33
35
58
60
66 return reader_;
67 }
68
70
77 return resetter_;
78 }
79
81
90 void initialize();
91
93
102 static bool parse_multiline_reply(std::span<std::string> strings, const std::string s, unsigned int& count, const nmea_rr& command);
103
105
111 void write(const std::string& s);
112
114
120 void read(std::string& s);
121
123
130 bool ask_nmea(const nmea_rr& command, std::string& s);
131
133
141 bool ask_nmea_multiple(const nmea_rr& command, std::span<std::string> strings, unsigned int& count);
142
144
150 bool ask_gll(std::string& s);
151
153
160 bool ask_gsv(std::span<std::string> strings, unsigned int& count);
161
163
170 bool ask_gsa(std::span<std::string> strings, unsigned int& count);
171
173
179 bool ask_rmc(std::string& s);
180
182
188 bool ask_gga(std::string& s);
189
191
197 bool ask_vtg(std::string& s);
198
199private:
200
202 static nmea_rr gll_;
204 static nmea_rr gsv_;
206 static nmea_rr gsa_;
208 static nmea_rr gga_;
210 static nmea_rr rmc_;
212 static nmea_rr vtg_;
220 std::array<std::string,2> single_line_parser_;
221
222};
223
224} // namespace teseo
225
teseo()
constructor.
callbackmanager::Callback< void, const std::string & > & writer()
expose the callback manager for writing to Teseo.
callbackmanager::Callback< void, std::string & > & reader()
expose the callback manager for reading from Teseo
callbackmanager::Callback< void > & resetter()
expose the callback manager for resetting the Teseo
void initialize()
void read(::std::string &s)
void write(const ::std::string &s)
const std::pair< const std::string, const std::string > nmea_rr