Pico GPS Teseo
Loading...
Searching...
No Matches
teseo_iface.cpp
Go to the documentation of this file.
1module;
2
3#include <string>
4#include <utility>
5#include <span>
6
7export module teseo;
8
9import callbackmanager;
10
11export namespace teseo {
12
14struct nmea_rr {
15 const std::string command;
16 const std::string signature;
17 nmea_rr(const std::string& command, const std::string& signature) :
19};
20
22
30class teseo {
31public:
32
34 teseo() : single_line_parser_() {}
35
37
60
62
68 return reader_;
69 }
70
72
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
201private:
202
204 static nmea_rr gll_;
206 static nmea_rr gsv_;
208 static nmea_rr gsa_;
210 static nmea_rr gga_;
212 static nmea_rr rmc_;
214 static nmea_rr vtg_;
222 std::array<std::string,2> single_line_parser_;
223
224};
225
226} // namespace teseo
227
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)
Struct holds combinations of NMEA commands and their reply signature validation string.
const std::string command
const std::string signature
nmea_rr(const std::string &command, const std::string &signature)