Pico GPS Teseo
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
15struct nmea_rr {
16 const std::string command;
17 const std::string signature;
18 nmea_rr(const std::string& command, const std::string& signature) :
20};
21
23
31class teseo {
32public:
33
35 teseo() : single_line_parser_() {}
36
38
61
63
69 return reader_;
70 }
71
73
80 return resetter_;
81 }
82
84
93 void initialize();
94
96
105 static bool parse_multiline_reply(std::span<std::string> strings, const std::string s, unsigned int& count, const nmea_rr& command);
106
108
114 void write(const std::string& s);
115
117
123 void read(std::string& s);
124
126
133 bool ask_nmea(const nmea_rr& command, std::string& s);
134
136
144 bool ask_nmea_multiple(const nmea_rr& command, std::span<std::string> strings, unsigned int& count);
145
147
153 bool ask_gll(std::string& s);
154
156
163 bool ask_gsv(std::span<std::string> strings, unsigned int& count);
164
166
173 bool ask_gsa(std::span<std::string> strings, unsigned int& count);
174
176
182 bool ask_rmc(std::string& s);
183
185
191 bool ask_gga(std::string& s);
192
194
200 bool ask_vtg(std::string& s);
201
202private:
203
205 static nmea_rr gll_;
207 static nmea_rr gsv_;
209 static nmea_rr gsa_;
211 static nmea_rr gga_;
213 static nmea_rr rmc_;
215 static nmea_rr vtg_;
223 std::array<std::string,2> single_line_parser_;
224
225};
226
227} // namespace teseo
228
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)