A promise resolving to the current availability status.
Clear device to enable chooseDevice.
Connects to a currently paired device or requests pairing.
Optionaloptions: ConnectOptionsOptional connection options including progress callback and abort signal.
Disconnect from the device.
Removes all listeners.
OptionalflashFlash the micro:bit.
Not all connection types support flashing. For example, radio bridge connections do not support flashing, and Bluetooth connections only support flashing on native platforms (not Web).
Post-flash connection state differs by transport:
USB: The connection remains in ConnectionStatus.Connected state. USB connects to the micro:bit's interface chip (running DAPLink firmware), which is not affected by flashing the application processor, so the connection persists and serial communication is automatically reinitialised.
Bluetooth: The connection is always left in ConnectionStatus.Disconnected state. Bluetooth connects to the application processor directly, which reboots after flashing, so the connection is necessarily lost. Callers must call connect again after flashing.
The data to use.
Flash options and progress callback.
Get the board version.
Cached after the first successful connection until clearDevice is called, so remains available after disconnection.
the board version.
Initializes the device.
Checks if this connection type is currently available.
Use this for pre-flight UX decisions (e.g., showing "enable Bluetooth" dialog). Note: Even if this returns "available", connect() can still fail.