1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

dynamic adding of xdr boat data for implemented n2k conversions

This commit is contained in:
wellenvogel
2021-11-24 18:52:33 +01:00
parent 166d8d826b
commit fb13a70ce6
7 changed files with 54 additions and 13 deletions

View File

@@ -17,6 +17,8 @@ template<class T> GwBoatItem<T> *GwBoatData::getOrCreate(T initial, GwBoatItemNa
if (it != values.end()) {
int expectedType=GwBoatItemTypes::getType(initial);
if (expectedType != it->second->getCurrentType()){
LOG_DEBUG(GwLog::DEBUG,"invalid type for boat item %s, expected %d, got %d",
name.c_str(),expectedType,it->second->getCurrentType());
return NULL;
}
return (GwBoatItem<T>*)(it->second);
@@ -26,6 +28,8 @@ template<class T> GwBoatItem<T> *GwBoatData::getOrCreate(T initial, GwBoatItemNa
provider->getInvalidTime(),
&values);
rt->update(initial);
LOG_DEBUG(GwLog::LOG,"creating boatItem %s, type %d",
name.c_str(),rt->getCurrentType());
return rt;
}
template<class T> bool GwBoatData::update(T value,int source,GwBoatItemNameProvider *provider){