Skip to content

ble://: use a paired link - #48

Merged
bdbarnett merged 4 commits into
mainfrom
ble-pairing
Sep 25, 2026
Merged

bdbarnett merged 4 commits into
mainfrom
ble-pairing

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

ble:// over a paired link, for boards running bledev with pairing= (PyDevices/pydevices#88). Stacked on #47 (ble-transport); merge that first.

  • The password is optional: a board that pairing unlocks opens on the first line.
  • The first write goes with a response. A write without one to a characteristic the board protects is dropped silently, so an unpaired computer used to wait for a prompt that never came.
  • When the board refuses an unpaired computer (ATT 0x05/0x0F), mpftp pairs "just works" by itself. If that isn't enough (the board wants a passkey), it unpairs again rather than leave a useless pairing behind, and says to pair once with python -m bledev.bleak pair NAME or Windows Settings.
  • A link that drops at the first write on a computer paired with the board is explained as a lost bond, with the unpair step.

Checked on the LCD-7 from Windows: with the bond from a passkey pairing and no password set, exec and a 20 KB put/get, byte for byte. Against a just-works board with a password: mpftp paired by itself and logged in; a wrong password was still refused. Against a passkey board with the computer unpaired: the message, and Windows held no pairing afterwards. Unit tests cover each path, and disabling the pairing call turns three of them red.

A board started with bledev pairing refuses an unpaired computer's first
write (ATT 0x05). The transport now pairs just works when that happens,
which covers a board without a display, and says how to pair once when the
board wants a passkey (python -m bledev.bleak pair NAME, or Windows
Settings). The password is optional: a board that pairing unlocks opens on
the first line without asking. A link that falls at the first write on a
computer paired with the board is explained as a lost bond, with the
unpair step.
A write without response to a characteristic the board protects is dropped
silently, so the unpaired case never surfaced. When just works isn't enough
(the board wants a passkey), unpair again rather than leave a pairing that
only gets in the way, and say how to pair once.
Base automatically changed from ble-transport to main September 25, 2026 05:42
@bdbarnett
bdbarnett changed the base branch from ble-transport to main September 25, 2026 05:42
@bdbarnett
bdbarnett merged commit efbb223 into main Sep 25, 2026
3 checks passed
@bdbarnett
bdbarnett deleted the ble-pairing branch September 25, 2026 05:42
bdbarnett added a commit that referenced this pull request Sep 25, 2026
…eading

Nine version sites now say 0.0.8 and check_versions.py passes. The curated
Unreleased notes become the v0.0.8 section, with a line for BLE pairing
(#48), and the bot's commit list is dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant