Added sinceLastSeen check to pings generated by node UI

1.2-legacy
Professr 2020-07-05 19:56:57 -07:00
rodzic 6f7f540c79
commit ccadb6a43d
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -444,10 +444,13 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
nodeIndex = (nodeIndex + 1) % nodeDB.getNumNodes();
n = nodeDB.getNodeByIndex(nodeIndex);
}
// We just changed to a new node screen, ask that node for updated state
displayedNodeNum = n->num;
service.sendNetworkPing(displayedNodeNum, true);
// We just changed to a new node screen, ask that node for updated state if it's older than 2 minutes
if(sinceLastSeen(n) > 120)
{
service.sendNetworkPing(displayedNodeNum, true);
}
}
NodeInfo *node = nodeDB.getNodeByIndex(nodeIndex);