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

only recreate value string in boatData if changed

This commit is contained in:
wellenvogel
2021-11-25 17:02:42 +01:00
parent aae16531ff
commit 5b39145e4f
3 changed files with 8 additions and 2 deletions

View File

@@ -172,12 +172,15 @@ static void writeToString(GwTextWriter *writer,GwSatInfoList &value){
template <class T>
void GwBoatItem<T>::fillString(){
bool valid=isValid();
if (writer.getSize() && (valid == lastStringValid)) return;
lastStringValid=valid;
writer.reset();
WriterWrapper wrapper(&writer);
GwTextWriter stringWriter(wrapper);
stringWriter.writeRaw(name.c_str());
stringWriter.writeChar(',');
stringWriter.writeInteger(isValid()?1:0);
stringWriter.writeInteger(valid?1:0);
stringWriter.writeChar(',');
stringWriter.writeInteger(lastSet);
stringWriter.writeChar(',');