Hello Everyone,
I am new to working with BlueZ and I am trying to get a handle on how to create a BLE service and add characteristics. Looking around the web I can find quite a bit of information about using BlueZ as a BLE client for connecting to other BLE devices to read/write attributes, but I am struggling to find anything which helps explain creating a BLE service and dealing with advertising. Can anyone point me to a resource for learning to work with the BlueZ C api for creating/starting/stopping services, adding/modifying characteristics, starting/stopping/modifying advertisments? Thanks in advance for any help you can offer.
Best,
-Matthew Stanbro
> On Jan 5, 2016, at 10:36 AM, Stanbro, Matthew A. <[email protected]> wrote:
>
> Hello Everyone,
>
> I am new to working with BlueZ and I am trying to get a handle on how to create a BLE service and add characteristics. Looking around the web I can find quite a bit of information about using BlueZ as a BLE client for connecting to other BLE devices to read/write attributes, but I am struggling to find anything which helps explain creating a BLE service and dealing with advertising. Can anyone point me to a resource for learning to work with the BlueZ C api for creating/starting/stopping services, adding/modifying characteristics, starting/stopping/modifying advertisments? Thanks in advance for any help you can offer.
Matthew,
Are you wanting to use a C program to do your BLE stuff? Or are open to writing a python one? I’m currently trying to work through the same issues, but using python as the glue to configure/manage the service/characteristic.
Hi Matthew,
On Tue, Jan 5, 2016 at 3:36 PM, Stanbro, Matthew A.
<[email protected]> wrote:
> Hello Everyone,
>
> I am new to working with BlueZ and I am trying to get a handle on how to create a BLE service and add characteristics. Looking around the web I can find quite a bit of information about using BlueZ as a BLE client for connecting to other BLE devices to read/write attributes, but I am struggling to find anything which helps explain creating a BLE service and dealing with advertising. Can anyone point me to a resource for learning to work with the BlueZ C api for creating/starting/stopping services, adding/modifying characteristics, starting/stopping/modifying advertisments? Thanks in advance for any help you can offer.
Currently there is no sample in C but the plan is to add some support
to bluetoothctl to do that, in the meantime you can check the examples
in python under test/example-gatt-server and test/example-advertising.
Alternatively you can create a plugin and link it directly with the
daemon so that you can use BlueZ C API, but this is only recommended
if you need low level access or there is security implication/special
access necessary for the services you want to add.
--
Luiz Augusto von Dentz