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

Linux ble module #641

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

Linux ble module #641

wants to merge 34 commits into from

Conversation

sukhman-sukh
Copy link

@sukhman-sukh sukhman-sukh commented Jul 1, 2024

This PR establishes Bluetooth low-energy connection for linux, interoperable between Android,iOS and linux devices.
You can refer to the blog for a detailed overview of the architecture of the ble module for android and Linux.

6d7a and others added 20 commits May 9, 2024 21:43
* 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
# Conflicts:
#	rust/libqaul/src/rpc/protobuf_generated/rust/qaul.net.messaging.rs
#	rust/libqaul/src/services/messaging/qaul.net.messaging.rs
SYS communication from BLE connectivity module shall be called directly via callback from outside.
Libqaul calls the BLE module directly. There is no libqaul -> BLE_module channel needed anymore.

fixed qaul_id compile warning

Removed unused function from API
1. Linux is able to detect other devices
2. Other devices can detect Linux BLE advertisements
3. Linux device is able to recieve messages from other qaul devices
	modified:   ble_module/src/ble/ble_service.rs
	modified:   ble_module/src/ble/utils.rs
	modified:   ble_module/src/lib.rs
	modified:   ble_module/src/rpc/msg_loop.rs
	modified:   libqaul/src/connections/ble/mod.rs
	modified:   libqaul/src/router/neighbours.rs
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.

3 participants