问题
Is there a sample app that allows advertising custom UUID and characteristics and with specific ADV data? Bluez has less documentation. Any help is appreciated.
回答1:
Which version of BlueZ do you have? With newer versions of BlueZ (e.g. 5.50) you can use bluetoothctl from the command line to do this as follows:-
#bluetoothctl
[bluetooth]# menu advertise
[bluetooth]# uuids 0x1800 0x1801 0x1802
[bluetooth]# name MyDevice
[bluetooth]# data 0 01 02 03
[bluetooth]# back
[bluetooth]# advertise on
This allows you to set custom UUID, advertising data, and the advertising device name. You can dig through the BlueZ source to see how this is implemented using C.
I hope this helps.
来源:https://stackoverflow.com/questions/53550852/bluez-ble-peripheral-advertise-custom-characteristic-with-adv-data