Description
Describe the bug
It looks like the Bluetooth settings are not being set correctly for the hex compilation. For example, choosing passkey pairing does not result in a passkey being required.
Failure to require a passkey was not the original reported issue, but was one I could repeat. The original report was that a passkey was required even though just works was selected, and that micro:bit appeared not to be using a secure connection. Further details: lancaster-university/microbit-dal#481
Everything seems to behave as expected using https://makecode.microbit.org/v2.
To Reproduce
Steps to reproduce the behavior:
- Go to 'https://makecode.microbit.org/'
- Click on 'New project' and give it a name
- Add the Bluetooth extension
- Enter code below
- Go to Settings and choose "passkey pairing"
- Download using a full flash by saving to the MICROBIT drive
- Enter pairing mode and bond with nRF Connect (for example)
- See error - no passkey required
bluetooth.onBluetoothConnected(function () {
basic.showString("C")
})
bluetooth.onBluetoothDisconnected(function () {
basic.showString("D")
basic.pause(5000)
basic.clearScreen()
})
bluetooth.startAccelerometerService()
Expected behavior
The Settings should affect the compiled hex.
Screenshots
Add screenshots to help explain your problem. You can copy paste the screenshot in the github report. The .gif screen recording is very useful as well.
micro:bit version (please complete the following information):
micro:bit V1.5. Repeated some aspects with a micro:bit V2.
Desktop (please complete the following information):
- OS: [e.g. iOS] Windows, iOS, Android
- Browser [e.g. chrome, safari] Windows Chrome
- Version [e.g. 22] NA
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] iPad Air 2, Samsung SMT-580
- OS: [e.g. iOS8.1] iOS 14.8, Android 8.1
- Browser [e.g. stock browser, safari] NA
- Version [e.g. 22] NA
Additional context
Add any other context about the problem here.