-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does bluetooth need to know if the board is a V2.0 or V2.2? #208
Comments
@microbit-carlos The version is used only for a suffix on the model name in the device information service, for the benefit of clients of the BLE services. The question is whether BLE clients need to distinguish V2.0/V2.2, or V2/V3. The model name currently differentiates V2.0 from newer versions. See the question about future versions in #77. The idea was also discussed in https://github.com/microbit-foundation/codal-microbit/issues/67 (private), and in lancaster-university/microbit-dal#373. If power,GetVersion() returned something invalid, say zero, it would be V2.X. I don't know if this string is being used anywhere. The iOS micro:bit app guesses V1/V2 based on the different DFU services, which is what gave rise to the question about how a BLE app should distinguish V1 and V2. It hasn't been changed to use the model string. |
Thanks Martin, that's really useful to know! From the top of my head I can't think of a reason why a BLE client would need to differentiate between a V2.00 and a V2.2x. So that could be hardcoded to |
It could be hard coded by reverting #114. I can't remember why the model string was chosen. I don't know if you could do the I2C comms inside a BLE event handler. |
We are happy for this to be hardcoded in CODAL to indicate V2 only. |
Before PR lancaster-university#114 the string was "BBC micro:bit V2.0", with that PR it was updated to indicate "BBC micro:bit V2.0" for board ID 0x9904 and "V2.X" to any unknown board ID (currently V2.2 boards would still appear as "V2.X"). lancaster-university#114 There is no need for BLE apps or devices to distinguish between different V2 versions, just as we currently don't differentiate between V1.3 and V1.5. Hardcoding this in CODAL to be "BBC micro:bit V2" also removes an I2C call to the interface chip on uBit.init(), which help us better support unofficial interface chip firmwares, like Segger's J-Link. Fixes lancaster-university#208 Related to lancaster-university#137
Board ID for BLE added in PR #114
Actually at this point in time CODAL it's not recognising V2.2 on BLE init, only V2.0:
codal-microbit-v2/source/bluetooth/MicroBitBLEManager.cpp
Lines 440 to 450 in b587d9c
I don't know exactly how this string is used, but it's all processed in the
MicroBitBLEManager::init()
method. Is it necessary for this BLE string to distinguish between V2.0 and V2.2? Should we just hardcode aV2
string?Without knowing much about how the BLE stuff is set up, is this information provided as a specific "info" service with a characteristic that provides board info (in which case it might be useful to provide more detailed information)?
Or is it part of a string that is broadcasted in some other way? (in which case it's less important, we might care to connecto a "BBC micro:bit V2" device, doesn't need to say "BBC micro:bit V2.0")
Does this string need to be set up in
MicroBitBLEManager::init()
? Or is there a different function that could provide this values? (for example, if it's a characteristic that is read, the DAPLink I2C version check can be done on demand)The reason this is worth considering is that it might be beneficial to avoid having this DAPLink I2C transaction on uBit object init:
codal-microbit-v2/model/MicroBit.cpp
Lines 219 to 221 in b587d9c
We are considering to panic when the DAPLink I2C comms fails in ticket #137, and for example, if the board is in MAINTENANCE mode and the programme running doesn't use BLE or datalogging, it's better to just run as normal instead of panicking.
The text was updated successfully, but these errors were encountered: