8#include "pico/stdlib.h"
21std::array<std::string, NMEA_MAX_REPLIES>
replies;
28std::array<nmea::gsv, NMEA_MAX_REPLIES>
gsv_set = {};
32 printf(
"%02i:%02i:%02i.%03i",
33 (
int)(t.hours().count()), (
int)(t.minutes().count()),
34 (
int)(t.seconds().count()), (
int)(t.subseconds().count()));
37void print_d(
const std::chrono::year_month_day& t) {
38 printf(
"%4i-%02i-%02i",
63 if (!
valid) {
return false; }
71 if (!
valid) {
return 0; }
89 [source](
const auto& o){ return (o.source == source); });
94 gps.writer().set([](
const std::string& s) ->
void {
write(s); });
95 gps.reader().set([](std::string& s) ->
void {
read(s); });
112 printf(
"+-- start --+\r\n");
121 printf(
"\r\nstatus: %s\r\nlat(n) lon(e): %f %f\r\ndate: ",
122 rmc.valid?
"active" :
"void",
rmc.lat,
rmc.lon);
130 printf(
" count: %i\r\n",
count);
133 printf(
" count: %i\r\n",
count);
139 for (
const auto& s : o.sats | std::views::filter([](
const nmea::gsv_sat& s){ return s.prn != 0;})) {
140 printf(
" %i", s.prn);
147 for (
const auto& s : o.sats | std::views::filter([](
const nmea::gsv_sat& s){ return s.prn != 0;})) {
148 printf(
"sat id: %i, elev: %i, azim: %i, snr: %i, source: ", s.prn, s.elev, s.azim, s.snr);
154 printf(
"+-- end --+\r\n\r\n");
static bool from_data(const std::string &data, gsv &gsv)
static bool from_data(const std::string &data, rmc &rmc)
Driver class for ST Teseo IC.
void read(::std::string &s)
void write(const ::std::string &s)
std::chrono::hh_mm_ss< std::chrono::duration< long long, std::ratio< 1, 1000 > > > time_t
void print_d(const std::chrono::year_month_day &t)
void print_t(const nmea::time_t &t)
void print_talker(const nmea::talker_id &talker_id)
size_t count_constellations(const nmea::talker_id source)
std::array< nmea::gsv, NMEA_MAX_REPLIES > gsv_set
std::array< std::string, NMEA_MAX_REPLIES > replies