Writing gdbus client for Bluez BLE (verison 5.48)
Using gdbus-codegen tool to generate proxy and skeleton. XML Content has below details.
<interface name="org.bluez.LEAdvertisement1">
<method name="Release">
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
<annotation name="org.freedesktop.DBus.Properties.PropertiesChanged" value="const"/>
<property name="Type" type="s" access="read"/>
<property name="ServiceUUIDs" type="as" access="read"/>
<property name="ManufacturerData" type="a{qv}" access="read"/>
<property name="SolicitUUIDs" type="as" access="read"/>
<property name="Includes" type="as" access="read"/>
<property name="ServiceData" type="a{sv}" access="read"/>
<property name="IncludeTxPower" type="b" access="read"/>
<property name="LocalName" type="s" access="read"/>
<property name="Appearance" type="q" access="read"/>
<property name="Duration" type="q" access="read"/>
<property name="Timeout" type="q" access="read"/>
</interface>
All above properties are getting assigned to default values from my client. As i introspect using d-feet.
But bluetoothctl these values are not assigned to default.
I debugged
bluez/src/Advertising.c function client_proxy_added()->parse_advertisement()
g_dbus_proxy_get_property returns TRUE for properties set by bluetoothctl, others it returns FALSE.
But with auto generated code, eventhough none of properties set. g_dbus_proxy_get_property is able to get all properties and default values its parsing. Due to the above facing below issues while starting Advertising. 1) Timeout default value is zero, it immediately timeout. 2) When include property is set, name property parsed eventhough not set. bluez throws error "Local name already included".
How we can make same behavior as bluetoothctl with gdbus autogenerated code?