Don't reply with null island (#1605)

raytac-diy
Ben Meadors 2022-08-07 15:08:46 -05:00 zatwierdzone przez GitHub
rodzic 7e6c22f542
commit de47cc55a0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -168,7 +168,7 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies)
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
assert(node);
if (node->has_position) {
if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0)) {
if (positionModule) {
DEBUG_MSG("Sending position ping to 0x%x, wantReplies=%d\n", dest, wantReplies);
positionModule->sendOurPosition(dest, wantReplies);

Wyświetl plik

@ -103,6 +103,8 @@ MeshPacket *PositionModule::allocReply()
} else
DEBUG_MSG("Providing time to mesh %u\n", p.time);
DEBUG_MSG("Position reply: time=%i, latI=%i, lonI=-%i\n", p.time, p.latitude_i, p.longitude_i);
return allocDataProtobuf(p);
}
@ -144,7 +146,6 @@ int32_t PositionModule::runOnce()
currentGeneration = radioGeneration;
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);
sendOurPosition(NODENUM_BROADCAST, requestReplies);
}
} else {