OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
655 stars 110 forks source link

Need an code example that advertises bluetooth services #262

Open IHNEL opened 10 months ago

IHNEL commented 10 months ago

Hello, I have searched around but couldn't find any example with SimpleBLE or SimpleBluez that demonstrates how to advertise new Bluetooth services that other bluetooth devices (like iphone) can scan and connect to.

My purpose is that implementing an application runs on Linux that provide some interesting features. Once the app's running, other mobile phone can connect to the app via Bluetooth and communicate to send data. I can make the same application on Android with Android Bluetooth APIs. On Linux, the bluetooth API is very complicated to use in C/C++ so I hope I can find an easier way using SimpleBLE.

Thanks in advance.

eriklins commented 10 months ago

SimpleBLE does not support BLE peripheral role and hence there is no support for BLE advertising or accepting connections from other devices. Not sure if it is planned to add support for this.

ibokou commented 10 months ago

You can try and look into mynewt-nimble. But I had no success with it. The linux example out of the box (which includes advertising) didn't work and I couldn't get it to work so far. The code runs but I see no device being advertised.

It is the same library that has been ported to the esp platform.

kdewald commented 1 month ago

This feature is currently in the works, although there's no clear timeline yet.