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

optimize boat data string handling

This commit is contained in:
wellenvogel
2021-12-12 11:47:56 +01:00
parent e08bcf1009
commit de04e5443b
4 changed files with 216 additions and 145 deletions

View File

@@ -1205,10 +1205,10 @@ function parseBoatDataLine(line){
let rt={};
let parts=line.split(',');
rt.name=parts[0];
rt.valid=parts[1] === '1';
rt.update=parseInt(parts[2]);
rt.source=parseInt(parts[3]);
rt.format=parts[4];
rt.valid=parts[2] === '1';
rt.update=parseInt(parts[3]);
rt.source=parseInt(parts[4]);
rt.format=parts[1];
rt.value=parts[5];
return rt;
}