1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-24 11:13:06 +01:00

Moved to c++17 and espressif32 @ 6.9.0, fixed waypoint boatdata code

This commit is contained in:
2025-08-06 14:04:54 +02:00
parent 2d47702627
commit f823dadc6b
7 changed files with 1983 additions and 1995 deletions

View File

@@ -254,6 +254,10 @@ static void writeToString(GwTextWriter *writer, const int16_t &value)
{
writer->writeInteger(value);
}
static void writeToString(GwTextWriter *writer, String value)
{
writer->writeString(value.c_str());
}
static void writeToString(GwTextWriter *writer, GwSatInfoList &value)
{
writer->writeInteger(value.getNumSats());

View File

@@ -121,7 +121,13 @@ template<class T> class GwBoatItem : public GwBoatItemBase{
if (! isValid(millis())) return defaultv;
return data;
}
virtual double getDoubleValue(){return (double)data;}
virtual double getDoubleValue(){
if constexpr (std::is_same<T, String>::value) {
return 0.0; // TODO any better ideas?
} else {
return (double)data;
}
}
virtual void fillString();
virtual void toJsonDoc(GwJsonDocument *doc, unsigned long minTime);
virtual int getLastSource(){return lastUpdateSource;}