toitware / public

Issue tracking for the Toit IoT platform, the Toit language, and the Toit APIs.
8 stars 0 forks source link

Add BLE support #9

Closed juergenspecht closed 2 years ago

juergenspecht commented 3 years ago

Is your feature request related to a problem? Please describe. I am using ESP32's as kinda a gateway between "local" (as in: physically close to the ESP32) Bluetooth devices and the Internet, which allows me to gather data from local sensors and make them available for example on a Website or within a Home-IOT System. If Toit had Bluetooth functionality, it would be quite simple to build Bluetooth/Web interfaces (especially since the integrated Pub/Sub functionality is already there).

Describe the solution you'd like Currently I mostly use NimBLE, because it does all I need and uses less memory than other solutions. However, I would not describe it as "elegant" or "straightforward". So I would like to know less about the inner workings of Bluetooth and just use a simple abstraction within Toit, the language.

Additional context Since mostly I scan "passive" to save on battery power on the Bluetooth devices and some of the devices (for example the Xiaomi Mijia Bluetooth Temperature Humidity Sensor comes to mind) are quite chatty even in passive mode, I could live with a staggered release of this feature. For example release "scan and read" functionality first and the more advanced features ("pairing, write, etc") later.

john7doe commented 3 years ago

I would also love to see Bluetooth (Actually just BLE) support within Toit. My use-case requires the device to be a GAP Peripheral/GATT server exposing HID, Battery and Device Information Service. (HID over GATT Profile)

kasperl commented 2 years ago

Fixed in v1.4.0 :)

See https://docs.toit.io/platform/tutorials/ble/advertising as an example.