project-chip / rs-matter

Rust implementation of the Matter protocol. Status: Experimental
Apache License 2.0
323 stars 45 forks source link

Support for BLE and BTP #155

Closed ivmarkov closed 3 months ago

ivmarkov commented 5 months ago

Currently runs on Linux/BlueZ only, but adding support for another BLE stack should be easy (user needs to implement the GattPeripheral trait - and - we might add out of the box BLE/GATT box implementations to rs-matter over time, as we did for mDNS).

Keeping as Draft for now, as the code needs to be tested on MCUs (doing this just now with ESP-IDF + Bluedroid) and needs unit tests.

ivmarkov commented 3 months ago

@kedars @andreilitvin I think this PR is ready for review.

Overall, I've been using this BTP implementation as my daily driver: primarily with Espressif's Bluedroid stack adaptation, but also with the Linux BlueZ stack which has wrappers as part of this PR.

The code has unit tests now. While I don't think these are anywhere near complete, I hope the foundation is solid, as with their framework in-place, we should be able to test most aspects of the BTP stack.

There's also a new demo - onoff_light_bt that does commissioning over BT (and a TODO to start merging "common" code between this new, and the pre-existing Ethernet examples).

In terms of issues, only two, hopefully neither of those a problem for merging (and both BlueZ-specific and non-existant with Bluedropid):

ivmarkov commented 3 months ago

Forgot to say: this code is all new in that it does not touch/change pre-existing metaphors. Everything necessary to implement pluggable protocols (today - BTP, tomorrow - TCP) had been merged already.

ivmarkov commented 3 months ago

@andreilitvin Many thanks for the code review so far!

ivmarkov commented 3 months ago

Oh - I also pushed-back on our favorite "Copyright headers" topic from before (and did mark it as "Resolved"), but really - let's first agree on what to do, and then do a one-pass regexp on all of it. Until then, I keep all headers the same, so the regexp has an easier time operating.

ivmarkov commented 3 months ago

@andy31415 What do you think we might still need to do for this PR to land?

There are a few open items (primarily w.r.t. naming) that I feel we should not really address, but please push back if you feel otherwise. Anything else outstanding? No rush, take your time, but just wondering where we are.

andy31415 commented 3 months ago

CSA member meeting caused a bit of a delay. I expect to get some time for one more pass tomorrow, expect it to check mark it then. Sorry for the delay.