mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 01:42:15 +00:00
Return queue status on rate limit throttling (#4901)
This commit is contained in:
parent
2e935fd943
commit
dcb2707d94
@ -605,10 +605,14 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
|||||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], THIRTY_SECONDS_MS)) {
|
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], THIRTY_SECONDS_MS)) {
|
||||||
LOG_WARN("Rate limiting portnum %d\n", p.decoded.portnum);
|
LOG_WARN("Rate limiting portnum %d\n", p.decoded.portnum);
|
||||||
sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "TraceRoute can only be sent once every 30 seconds");
|
sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "TraceRoute can only be sent once every 30 seconds");
|
||||||
|
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||||
|
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||||
return false;
|
return false;
|
||||||
} else if (p.decoded.portnum == meshtastic_PortNum_POSITION_APP && lastPortNumToRadio[p.decoded.portnum] &&
|
} else if (p.decoded.portnum == meshtastic_PortNum_POSITION_APP && lastPortNumToRadio[p.decoded.portnum] &&
|
||||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], FIVE_SECONDS_MS)) {
|
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], FIVE_SECONDS_MS)) {
|
||||||
LOG_WARN("Rate limiting portnum %d\n", p.decoded.portnum);
|
LOG_WARN("Rate limiting portnum %d\n", p.decoded.portnum);
|
||||||
|
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||||
|
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||||
// FIXME: Figure out why this continues to happen
|
// FIXME: Figure out why this continues to happen
|
||||||
// sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Position can only be sent once every 5 seconds");
|
// sendNotification(meshtastic_LogRecord_Level_WARNING, p.id, "Position can only be sent once every 5 seconds");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user