@@ -7447,6 +7447,12 @@ static void adapter_stop(struct btd_adapter *adapter)
int btd_register_adapter_driver(struct btd_adapter_driver *driver)
{
+ if (driver->experimental && !(g_dbus_get_flags() &
+ G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
+ DBG("D-Bus experimental not enabled");
+ return -ENOTSUP;
+ }
+
adapter_drivers = g_slist_append(adapter_drivers, driver);
if (driver->probe == NULL)
@@ -127,6 +127,11 @@ struct btd_adapter_driver {
struct btd_device *device);
void (*device_resolved)(struct btd_adapter *adapter,
struct btd_device *device);
+
+ /* Indicates the driver is experimental and shall only be registered
+ * when experimental has been enabled (see: main.conf:Experimental).
+ */
+ bool experimental;
};
void device_resolved_drivers(struct btd_adapter *adapter,
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> This adds experimental field to btd_adapter_driver so the plugin can indicate drivers that depends on experimental to be enabled. --- src/adapter.c | 6 ++++++ src/adapter.h | 5 +++++ 2 files changed, 11 insertions(+)