Skip to content
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

Use S140 driver on demand #279

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jnthbdn
Copy link

@jnthbdn jnthbdn commented Feb 24, 2023

Hi there,

For our project we need to put the microbit in Central mode (BLE). As it is not possible to do this via the current drivers (S113) we would need to use the S140 drivers instead.

According to what we found on the different microbit repos (issue, pull-request, ...), it is difficult (impossible ?) to change the BLE drivers without modifying the whole compilation chain and impacting everyone.

To solve the problem we simply isolated the different use cases (S113 driver, S140 driver or no driver), in specific folders. Then the selection is done via the CMakeList.

Finally, to use the S140 drivers, you just need to add the line "S140": 1 in the pxt.json of a microbit extension, otherwise the S113 driver will be used.

Example of our "yotta part" in pxt.json file for the extension we are developing:

"yotta": {
    "config": {
        "microbit-dal": {
            "bluetooth": {
                "open": 0,
                "whitelist": 0,
                "security_level": null
            }
        },
        "S140": 1
    }
}

For this change to be effective you must also accept PR of codal-microbit-nrf5sdk microbit-foundation/codal-microbit-nrf5sdk#15 .

Some microbit users would like to have access to this feature (#212).

This solution has the advantage of not impacting current microbit users, as the operation remains the same, but offers the possibility of using the S140 drivers for more BLE functionality.

I hope I have made myself clear,

Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant