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

ble: profile rework #3272

Merged
merged 64 commits into from
Feb 16, 2024
Merged

ble: profile rework #3272

merged 64 commits into from
Feb 16, 2024

Conversation

hedger
Copy link
Member

@hedger hedger commented Dec 6, 2023

What's new

General BLE:

  • ble: reworked profile subsystem
  • now applications can define custom BLE profiles
  • profiles define BLE advertising parameters and own service set

BLE internals:

  • combined SHCI & HCI event processing threads
  • reworked event dispatching to services to support new way of defining profiles and overcome fixed wpan handler count limit
  • battery service (&others): now supports multiple instances
  • bt service: now only init BLE pairing dialog when needed to save memory
  • moved BLE HID profile from furi_hal to lib/ble_profile as an example (custom profiles can also be defined in app's private libs)

Extra beacon:

  • added API for controlling additional, non-connectable BLE advertisements (BLE beacon)
  • that beacon works in background, independently from main BLE subsystem
  • extra beacon has status indication on desktop
  • added example app for configuring and testing extra beacon feature

Misc:

  • Moved example_custom_font app from debug to examples
  • Improved "ps" CLI command output: added thread priorities
  • Added FURI_PACKED macro for packed structures
  • hid_app: cleaner code split for USB/BLE transports
  • fbt: better handling of malformed target.json files

Verification

  • test that update from older versions and downgrade do not break BLE pairing
  • run BLE remote app, check that old pairings work & app itself works
  • run BLE stress test from companion apps
  • run BLE Beacon app in various combinations with BLE on/off, RPC active/not
  • check out cool "ps"
  • idk

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link

github-actions bot commented Dec 6, 2023

Compiled f7 firmware for commit 4e417796:

@flipperdevices flipperdevices deleted a comment from github-actions bot Dec 6, 2023
@flipperdevices flipperdevices deleted a comment from github-actions bot Dec 8, 2023
@hedger hedger added New Feature Contains an IMPLEMENTATION of a new feature Core+Services HAL, furi & core system services Bluetooth labels Dec 12, 2023
@thejudge156
Copy link

@hedger Would you be open to a PR to your branch that adds a OpenHaystack profile?

@hedger hedger marked this pull request as ready for review February 2, 2024 10:26
@hedger hedger requested a review from gsurkov as a code owner February 2, 2024 10:26
@hedger
Copy link
Member Author

hedger commented Feb 2, 2024

@thejudge156 you can bring that profile along with your custom app. Just implement the profile interface.

Or, even better, use the BLE beacon API - then it will properly work in the background. It won't rotate the keys on time, though, until the app is re-launched.

@thejudge156
Copy link

Thanks for the pointer, I will work on that.

@skotopes skotopes merged commit 60a9d7e into dev Feb 16, 2024
9 checks passed
@skotopes skotopes deleted the hedger/bt_rework branch February 16, 2024 07:20
tpimh pushed a commit to tpimh/flipper-jackbox-remote that referenced this pull request Mar 5, 2024
* ble: profile rework, initial
* apps: hid: fix for pairing cleanup
* app: hid: select transport based on #define
* fixing PVS warnings
* ble: serial service: fixed uid naming
* bt service: on-demand dialog init; ble profiles: docs; battery svc: proper update
* Added shci_cmd_resp_wait/shci_cmd_resp_release impl with semaphore
* app: hid: separated transport code
* ble: fixed service init order for serial svc; moved hardfault check to ble_glue
* cli: ps: added thread prio to output, fixed heap display
* ble_glue: naming changes; separate thread for event processing;
* furi: added runtime stats; cli: added cpu% to `ps`
* cli: fixed thread time calculation
* furi: added getter for thread priority
* fixing pvs warnings
* hid profile: fixed naming
* more naming fixes
* hal: ble init small cleanup
* cleanup & draft beacon api
* f18: api sync
* apps: moved example_custom_font from debug to examples
* BLE extra beacon demo app
* naming fix
* UI fixes for demo app (wip)
* desktop, ble svc: added statusbar icon for beacon
* minor cleanup
* Minor cleanup & naming fixes
* api sync
* Removed stale header
* hal: added FURI_BLE_EXTRA_LOG for extra logging; comments & code cleanup
* naming & macro fixes
* quick fixes from review
* Eliminated stock svc_ctl
* cli: ps: removed runtime stats
* minor include fixes
* (void)
* naming fixes
* More naming fixes
* fbt: always build all libs
* fbt: explicitly globbing libs; dist: logging SDK path
* scripts: fixed lib path precedence
* hal: bt: profiles: naming changes, support for passing params to a profile; include cleanup
* ble: hid: added parameter processing for profile template
* api sync
* BLE HID: long name trim
* Removed unused check
* desktop: updated beacon status icon; ble: hid: cleaner device name management
* desktop: updated status icon

Co-authored-by: あく <[email protected]>
Co-authored-by: nminaylov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bluetooth Core+Services HAL, furi & core system services New Feature Contains an IMPLEMENTATION of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants