@@ -1641,12 +1641,47 @@ static gboolean get_supported_secondary(const GDBusPropertyTable *property,
return TRUE;
}
+static gboolean get_supported_cap(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct btd_adv_manager *manager = data;
+ DBusMessageIter dict;
+ int16_t min_tx_power = manager->min_tx_power;
+ int16_t max_tx_power = manager->max_tx_power;
+
+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+ DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
+ &dict);
+
+ if (min_tx_power != ADV_TX_POWER_NO_PREFERENCE)
+ dict_append_entry(&dict, "MinTxPower", DBUS_TYPE_INT16,
+ &min_tx_power);
+
+ if (max_tx_power != ADV_TX_POWER_NO_PREFERENCE)
+ dict_append_entry(&dict, "MaxTxPower", DBUS_TYPE_INT16,
+ &max_tx_power);
+
+ dict_append_entry(&dict, "MaxAdvLen", DBUS_TYPE_BYTE,
+ &manager->max_adv_len);
+ dict_append_entry(&dict, "MaxScnRspLen", DBUS_TYPE_BYTE,
+ &manager->max_scan_rsp_len);
+
+ dbus_message_iter_close_container(iter, &dict);
+
+ return TRUE;
+}
+
static const GDBusPropertyTable properties[] = {
{ "ActiveInstances", "y", get_active_instances, NULL, NULL },
{ "SupportedInstances", "y", get_instances, NULL, NULL },
{ "SupportedIncludes", "as", get_supported_includes, NULL, NULL },
{ "SupportedSecondaryChannels", "as", get_supported_secondary, NULL,
secondary_exits },
+ { "SupportedCapabilities", "a{sv}", get_supported_cap, NULL, NULL,
+ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL},
{ }
};