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:
@@ -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());
|
||||
|
||||
@@ -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;}
|
||||
|
||||
Reference in New Issue
Block a user