From 9825ddb287deb4920776319a1a487f5e4a908340 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 3 Apr 2026 03:48:03 -0700 Subject: [PATCH] add client_remove_by_index for reaper --- main/wifi_transport.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/wifi_transport.c b/main/wifi_transport.c index 9e2df73..47c9d04 100644 --- a/main/wifi_transport.c +++ b/main/wifi_transport.c @@ -86,6 +86,14 @@ static void client_remove_by_mac(const uint8_t *mac) xSemaphoreGive(client_mutex); } +/* caller must hold client_mutex */ +static void client_remove_by_index(int idx) +{ + if (idx < 0 || idx >= client_count) return; + printf("REAP: removing client %d\n", idx); + clients[idx] = clients[--client_count]; +} + static void parse_udp_sysex(const uint8_t *data, uint16_t len) { if (len < 3 || data[0] != 0xF0 || data[1] != 0x7D)