rust icon indicating copy to clipboard operation
rust copied to clipboard

Introduce the BleHandler struct

Open lukipuki opened this issue 2 years ago • 2 comments

It handles the low-level meshtastic BLE protocol, including the 3 characteristics used to read from and write to the radio. It also converts BLE errors into internal errors.

The high-level protocol remains to be added, especially the sequence mentioned in https://meshtastic.org/docs/development/device/client-api

lukipuki avatar Jan 23 '24 17:01 lukipuki

Would the pattern of the BLE connection match the pattern for using the other two connection methods? My ideal world would be that the pattern of all three match, even if we have to change the other two a bit

ajmcquilkin avatar Jan 29 '24 19:01 ajmcquilkin

I'm not sure I understand your concern. BleHandler is an internal utility, its equivalent for e.g. TCP is hidden deep inside tokio or the Linux kernel, so there is no equivalent pattern inside this library.

The final user-facing API will be the same though, here's a snippet from my WIP code returning a StreamHandle, just like the other two connection types: https://github.com/lukipuki/rust/commit/bf62d6f5579fc36bba4f0193e5c8356af21d353b#diff-56b28e06d43da250d6266d02c8008187338880c638671064e312eab6aef1e2e8R270-R273

But that's not part of this PR, it will come in later ones.

lukipuki avatar Jan 29 '24 21:01 lukipuki