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.
Flash 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.
Gets micro:bit device.
the USB device or undefined if there is no connection.
Gets micro:bit deviceId.
Cached after the first successful connection until clearDevice is called, so remains available after disconnection.
the device id.
Initializes the device.
Sets device request exclusion filters.
Resets the micro:bit in software.
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.