Open sascha1337 opened 3 years ago
Looking at this repo, it is not usable as is, but i like the abstraction of a generic interface, so the high-level code does not need to care about the underlaying implementation. Thinking further, looking at the core lib for streams, we could also create some core library abstracted, to have one unified BLE lib working crossplatform.
Here you are using blurz, inside dependencies, which has the dependency of dbus-1, not being included in Mac OS ( 10.14.6 )
https://github.com/iot2tangle/Streams-ble-gateway/blob/4169b54adf320206ad5d1b974dffd553b5f55607/Cargo.lock#L217 https://github.com/iot2tangle/Streams-ble-gateway/blob/4169b54adf320206ad5d1b974dffd553b5f55607/Cargo.toml#L20
"Fix" of that issue was just running
brew install dbus
followed bybrew services start dbus
to avoid following error:And even after that, there were further errors running the GW on mac - as i had predicted. Makes sense, because dbus and especially bluez for bluetooth connections is for Linux kernel BLE communication only. See here:
https://stackoverflow.com/a/63136987
To scale and being able to run the Gateway crossplatform, we have multiple options.
Checking the crates for CoreBluetooth https://crates.io/keywords/CoreBluetooth gives us 3 options, with one being very active in development, worth a look at: https://crates.io/crates/btleplug
Quote:
That btleplug library seems promising, having support for windows, android, mac os, linux, even iOS but has some limitations for each platforms especially async:![image](https://user-images.githubusercontent.com/12372821/108249015-83c63880-718f-11eb-8517-449db23abc6e.png)
Another options would by some python wrapper accessiong Mac OS BLE, parsing output of blueutil for mac os (https://github.com/toy/blueutil) or like noble library for node.js solved, connecting via XpcConnection to the native Mac OS bluetoothd daemon service.
https://github.com/noble/noble/blob/master/lib/mac/highsierra.js#L18
--- or creating platform specific repos / build configs ála make and ./configure.
Just giving some feedback and ideas to solve those issues, to be more flexible to more endusers. Maybe someone knows right away, which BLE functions are essential, and check that embedded image, if it would be an option trying to replace blurz with btleplug in some development branch.