diff --git a/src/MeshService.cpp b/src/MeshService.cpp index adec1496..0f568159 100644 --- a/src/MeshService.cpp +++ b/src/MeshService.cpp @@ -202,11 +202,11 @@ void MeshService::handleToRadio(std::string s) if (r.variant.packet.has_payload && r.variant.packet.payload.which_variant == SubPacket_position_tag && r.variant.packet.payload.variant.position.time) { struct timeval tv; - uint32_t msecs = r.variant.packet.payload.variant.position.time; + uint32_t secs = r.variant.packet.payload.variant.position.time; // FIXME, this is a shit not right version of the standard def of unix time!!! - tv.tv_sec = msecs / 1000; - tv.tv_usec = (msecs % 1000) * 1000; // scale only the msecs portion of the timestamp (i.e. remainder after dividing by 1s) + tv.tv_sec = secs; + tv.tv_usec = 0; gps.perhapsSetRTC(&tv); diff --git a/src/NodeDB.cpp b/src/NodeDB.cpp index ccb1a832..c040c0e0 100644 --- a/src/NodeDB.cpp +++ b/src/NodeDB.cpp @@ -228,7 +228,7 @@ void NodeDB::updateFrom(const MeshPacket &mp) if (mp.has_payload) { const SubPacket &p = mp.payload; - DEBUG_MSG("Update DB node 0x%x for variant %d\n", mp.from, p.which_variant); + DEBUG_MSG("Update DB node 0x%x for variant %d, rx_time=%u\n", mp.from, p.which_variant, mp.rx_time); int oldNumNodes = *numNodes; NodeInfo *info = getOrCreateNode(mp.from);