Refresh node info to ensure our information is current for smart position. #934

1.2-legacy
Jm Casler 2021-12-01 17:56:47 -08:00
rodzic 4f10ab8d04
commit f4d348173c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -145,7 +145,7 @@ int32_t PositionPlugin::runOnce()
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);
sendOurPosition(NODENUM_BROADCAST, requestReplies);
} else if (radioConfig.preferences.position_broadcast_smart == true) {
// NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position
NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position
if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0)) {
float distance = GeoCoord::latLongToMeter(lastGpsLatitude * 1e-7, lastGpsLongitude * 1e-7,