Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

aioble/server: Fix _init_capture() guard to match _server_shutdown().#1082

Open
andrewleech wants to merge 1 commit intomicropython:master from
andrewleech:aioble-fix-init-capture-guard-mismatch
Open

aioble/server: Fix _init_capture() guard to match _server_shutdown(). #1082
andrewleech wants to merge 1 commit intomicropython:master from
andrewleech:aioble-fix-init-capture-guard-mismatch

Conversation

@andrewleech
Copy link
Contributor

@andrewleech andrewleech commented Feb 18, 2026

Summary

In aioble, bluetooth devices that use capture-mode characteristics can silently stop receiving writes after a partial BLE shutdown — written() blocks indefinitely because the capture task was never recreated.

This happens because _init_capture() guards on _capture_queue while _server_shutdown() guards on _capture_task. If the task gets deleted but the queue persists (partial teardown), _init_capture() sees the queue and returns early. The fix aligns both functions to guard on _capture_task and cleans up any orphaned attributes before reinitializing.

Found while implementing BLE stop/start cycles on STM32WB55 where characteristics are singletons across radio restarts, requiring explicit _init_capture() calls rather than relying on Characteristic.__init__().

Testing

Tested on unix port exercising full shutdown → reinit → write cycles. Also tested on STM32WB55 hardware with repeated BLE restart cycles under the same singleton characteristic pattern.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
@andrewleech andrewleech force-pushed the aioble-fix-init-capture-guard-mismatch branch from 6b70880 to 6cafc0e Compare February 18, 2026 02:24
@andrewleech andrewleech changed the title (削除) aioble/server: Fix _init_capture() guard to match _server_shutdown() (削除ここまで) (追記) aioble/server: Fix _init_capture() guard to match _server_shutdown(). (追記ここまで) Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /