@@ -7029,6 +7029,45 @@ static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data,
return got_match;
}
+static int find_baas(gconstpointer a, gconstpointer b)
+{
+ const struct eir_sd *sd = a;
+ const char *baas_uuid = b;
+
+ return strcmp(sd->uuid, baas_uuid);
+}
+
+static bool accept_bcast_adv(struct btd_adapter *adapter)
+{
+ if ((btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER)))
+ return true;
+
+ return false;
+}
+
+static bool is_bcast_source(struct eir_data *eir_data)
+{
+ if (!(eir_data->flags & (EIR_LIM_DISC | EIR_GEN_DISC))
+ && (g_slist_find_custom(eir_data->sd_list,
+ BCAA_SERVICE_UUID, find_baas))) {
+ return true;
+ }
+
+ return false;
+}
+static void bcast_new_source(struct btd_adapter *adapter,
+ struct btd_device *device)
+{
+ GSList *l;
+
+ for (l = adapter->drivers; l; l = g_slist_next(l)) {
+ struct btd_adapter_driver *driver = l->data;
+
+ if (!strcmp(driver->name, "bcast"))
+ driver->device_discovered(adapter, device);
+ }
+}
+
static void filter_duplicate_data(void *data, void *user_data)
{
struct discovery_client *client = data;
@@ -7152,12 +7191,21 @@ void btd_adapter_device_found(struct btd_adapter *adapter,
return;
}
+ if (accept_bcast_adv(adapter) && is_bcast_source(&eir_data))
+ monitoring = true;
+
if (!discoverable && !monitoring && !eir_data.rsi) {
eir_data_free(&eir_data);
return;
}
dev = adapter_create_device(adapter, bdaddr, bdaddr_type);
+
+ if (dev && is_bcast_source(&eir_data)) {
+ bcast_new_source(adapter, dev);
+ btd_device_set_temporary(dev, false);
+ }
+
}
if (!dev) {
@@ -125,6 +125,8 @@ struct btd_adapter_driver {
struct btd_device *device);
void (*device_resolved)(struct btd_adapter *adapter,
struct btd_device *device);
+ void (*device_discovered)(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).