Skip to content

Commit

Permalink
Make recent changes work with branch usb-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sarfata committed Apr 23, 2018
1 parent b0382bf commit 00361b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/host/services/NMEA2000Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ void NMEA2000Service::publishN2kMessage(const tN2kMsg& msg) {
if (_config.rxEnabled) {
KBoxMetrics.event(KBoxEventNMEA2000MessageReceived);

DEBUG("Received N2K Message with pgn: %i", msg.PGN);

for (auto it = _sentenceRepeaters.begin(); it != _sentenceRepeaters.end(); it++) {
(*it)->write(msg);
}

DEBUG("Received N2K Message with pgn: %i", msg.PGN);
NMEA2000Message m(msg, now());
sendMessage(m);

SKNMEA2000Parser p;
//FIXME: Get the time properly here!
const SKUpdate &update = p.parse(SKSourceInputNMEA2000, msg, SKTime(0));
uint32_t ts = millis();
const SKUpdate &update = p.parse(SKSourceInputNMEA2000, msg, SKTime(ts / 1000, ts % 1000));
if (update.getSize() > 0) {
_hub.publish(update);
}
Expand Down
2 changes: 1 addition & 1 deletion src/host/services/SerialService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void SerialService::loop() {
}
}
else {
DEBUG("Invalid NMEA sentence: %s", (*it).getSentence().c_str());
DEBUG("Invalid NMEA sentence: %s", (*it).c_str());
KBoxMetrics.event(_rxErrorEvent);
}
}
Expand Down

0 comments on commit 00361b2

Please sign in to comment.