I’m trying to create BLE GATT services on my Raspberry Pi 4 using C++. Have searched for a while but wasn’t able to find useful hints/examples.
More details:
I’m able to create GATT services and characteristics using commands:
#bluetoothctl
[bluetoothctl] menu gatt
[bluetoothctl] register-service 0xFFFF #
[bluetoothctl] register-characteristic 0xAAAA read,write #
[bluetoothctl] register-application #
and I want to achieve the same using C++ codes.
I have found the definition for void RegisterApplication(object application, dict options)
in https://github.com/Vudentz/BlueZ/blob/master/doc/gatt-api.txt, but it doesn’t provide many details. My question is:
For this RegisterApplication function, what should I put for the ‘object application’ and ‘dic options’? Is there any example in the format of
g_dbus_proxy_call(
Proxy,
"RegisterApplication",
Params,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
NULL,
NULL);
showing how the “params” should be constructed for my service and characteristic (registered using commands) above?
Lalavender is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.