After #18 (MAX_CONNECTIONS=2), onConnect sets need_advertise=true to fill the second slot. start_advertising() then unconditionally overwrote state to ADVERTISING, so with a single connected client the UI flipped CONNECTED -> ADVERTISING on the next tick and stayed there until a second central attached. Only flip the state to ADVERTISING when no clients are connected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>