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

[WIP] feature: 314 Linux BLE #537

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

[WIP] feature: 314 Linux BLE #537

wants to merge 4 commits into from

Conversation

6d7a
Copy link
Member

@6d7a 6d7a commented Mar 9, 2023

Description

Finally got around to do some work on #314
I created a bluetooth service that implements the functionality of the respective RPC protocol. I modeled the service after the Android example, let me know if I missed some feature.
As I mentioned in #314, I'm still uncertain about the when and where the channels between UI and BLE are set up. Could you give me a push in the right direction?

Thanks

6d7a and others added 4 commits March 9, 2023 18:30
* chore(ble): init rust ble module

* build(ble-rs): add prost and bytes

* chore: recompile proto

* feat(log): init logging

* feat(log): set up ble logger

* feat(rpc): init rpc channels

* feat(rpc): set up channels

* fix(proto): add local copy of qaul.sys.ble

* feat: run tokio select loop

* refactor(rpc): use async traits for easier testing

* refactor(rpc): remove unused rpcerrors

* refactor: run main loop in own module

* build(bluer): import bluer features

* feat(ble): add BLE UUIDs

* style: remove unused imports

* feat(ble): define BleManager trait

* feat(ble): advertise services

* feat(ble): add handles for main and msg chara

* refactor(ble): rename trait to QaulBleManager

* refactor(uuid): rename to main UUID

* build(ble): add futures

* feat(ble): add services

* feat(ble_module): scan

* feat(ble): filter devices by blocklist

* feat(ble): add close method

* refactor(ble): qaul ble trait to fit ble sys msgs

* refactor(rpc): give publiuc access to proto mod

* refactor(rpc loop): listen to sys msgs

* feat(loop): forward sys msgs to ble impl

* refactor(naming): improve naming

* feat(ble): get device info

* feat(start_ble): return when ble already started

* feat(ble): advertise

* feat(ble_utils): pretty print address

* refactor(ble): remove redundant close method

* feat(ble): break ble loop with mpsc

* feat(ble): connect to device

* feat(ble): set up notification and send device found

* feat(ble): report chara writes

* refactor(streams): WIP

* fix(ble): breaking stop stream

* refactor(ble): use merged streams

* feat(ble): implement direct send

* feat(ble): implement stop

* style: lint

* refactor(ble): remove unused handle types
@MathJud
Copy link
Member

MathJud commented Mar 10, 2023

Thanks a lot! It looks great!
I will have a further look and give more detailed feedback.
I will also answer your questions in #314

@MathJud
Copy link
Member

MathJud commented Mar 19, 2023

@kevin

Thanks again for this helpful module!

The interconnection between libqaul's BLE connectivity-module and the Android BLE module is done in the branch ble-startup-fixing-rebased-06022023 and will be merged to main as soon as all remaining small problems are ironed out.

It is referenced to this PR #533

I rebased your branch on the ble-startup-fixing-rebased-06022023 branch and called it linux_ble pushed it to the qaul repo:
https://github.com/qaul/qaul.net/tree/linux_ble

And created the following PR from it: #539


I change the following things:

TODO:

The BLE module should send it's messages to libqaul.

Please don't hesitate to interact on it!

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

2 participants