correctly handle the talkerId

This commit is contained in:
andreas 2021-11-06 20:41:08 +01:00
parent 3100582581
commit 616ca1348b
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ N2kDataToNMEA0183::N2kDataToNMEA0183(GwLog * logger, GwBoatData *boatData, tNMEA
SendNMEA0183MessageCallback=0; SendNMEA0183MessageCallback=0;
this->SendNMEA0183MessageCallback=callback; this->SendNMEA0183MessageCallback=callback;
strncpy(this->talkerId,talkerId.c_str(),2); strncpy(this->talkerId,talkerId.c_str(),2);
talkerId[2]=0; this->talkerId[2]=0;
sourceId=id; sourceId=id;
} }
@ -338,7 +338,7 @@ private:
updateDouble(boatData->TWS, WindSpeed); updateDouble(boatData->TWS, WindSpeed);
} }
if (NMEA0183SetMWV(NMEA0183Msg, formatCourse(WindAngle), NMEA0183Reference, WindSpeed)) if (NMEA0183SetMWV(NMEA0183Msg, formatCourse(WindAngle), NMEA0183Reference, WindSpeed,talkerId))
SendMessage(NMEA0183Msg); SendMessage(NMEA0183Msg);
if (WindReference == N2kWind_Apparent && boatData->SOG->isValid()) if (WindReference == N2kWind_Apparent && boatData->SOG->isValid())