mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
test: cover the roam threshold and who gets memStatus
Move the roam check into worthRoaming() and the memStatus routing into heapEmitTarget() in Utils so the native tests reach them. worthRoaming() roams for a gain of at least ROAM_MIN_GAIN_DB, as the comment and the 6 dB commit said. The old check needed one dB more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3a2702af6c
commit
293e013aa2
5 changed files with 72 additions and 22 deletions
|
|
@ -144,3 +144,11 @@ void RssiBroadcast::sent(bool broadcast, int rssi, int channel, uint32_t now) {
|
|||
this->channel = channel;
|
||||
this->at = now;
|
||||
}
|
||||
bool worthRoaming(bool connected, int currentRssi, int apRssi, int minGain) {
|
||||
return !connected || apRssi >= currentRssi + minGain;
|
||||
}
|
||||
heap_emit_t heapEmitTarget(uint8_t num, uint32_t sinceLastMs, uint32_t intervalMs, bool roomHasClients) {
|
||||
if(num != 255) return heap_emit_t::client;
|
||||
if(sinceLastMs >= intervalMs) return heap_emit_t::broadcast;
|
||||
return roomHasClients ? heap_emit_t::room : heap_emit_t::none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue