Message ID | 80fb0196727ff8ea422b0e003be028a99844da70.1676112710.git.pav@iki.fi (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [BlueZ,v2,1/9] doc: remove unimplemented Quality Report from MGMT settings | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | fail | WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 1: T1 Title exceeds max length (81>80): "[BlueZ,v2,9/9] bap: handle adapters that are not CIS Central / Peripheral capable" 16: B2 Line has trailing whitespace: " " 22: B2 Line has trailing whitespace: " " 27: B2 Line has trailing whitespace: " " 30: B2 Line has trailing whitespace: " " 32: B2 Line has trailing whitespace: " " 34: B2 Line has trailing whitespace: " " 51: B3 Line contains hard tab characters (\t): " Name: xxx" 52: B3 Line contains hard tab characters (\t): " Alias: xxx" 53: B3 Line contains hard tab characters (\t): " Class: 0x00000000" 54: B3 Line contains hard tab characters (\t): " Powered: yes" 55: B3 Line contains hard tab characters (\t): " PowerState: on" 56: B3 Line contains hard tab characters (\t): " Discoverable: no" 57: B3 Line contains hard tab characters (\t): " DiscoverableTimeout: 0x000000b4" 58: B3 Line contains hard tab characters (\t): " Pairable: no" 59: B3 Line contains hard tab characters (\t): " UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)" 60: B3 Line contains hard tab characters (\t): " UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)" 61: B3 Line contains hard tab characters (\t): " UUID: Volume Control (00001844-0000-1000-8000-00805f9b34fb)" 62: B3 Line contains hard tab characters (\t): " UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)" 63: B3 Line contains hard tab characters (\t): " UUID: Audio Stream Control (0000184e-0000-1000-8000-00805f9b34fb)" 64: B3 Line contains hard tab characters (\t): " UUID: Published Audio Capabil.. (00001850-0000-1000-8000-00805f9b34fb)" 65: B3 Line contains hard tab characters (\t): " Modalias: usb:v1D6Bp0246d0542" 66: B3 Line contains hard tab characters (\t): " Discovering: no" 67: B3 Line contains hard tab characters (\t): " Roles: central" 68: B3 Line contains hard tab characters (\t): " Roles: peripheral" 69: B1 Line exceeds max length (91>80): " ExperimentalFeatures: BlueZ Experimental LL p.. (15c0a148-c273-11ea-b3de-0242ac130004)" 69: B3 Line contains hard tab characters (\t): " ExperimentalFeatures: BlueZ Experimental LL p.. (15c0a148-c273-11ea-b3de-0242ac130004)" 70: B1 Line exceeds max length (91>80): " ExperimentalFeatures: BlueZ Experimental Blue.. (330859bc-7506-492d-9370-9a6f0614037f)" 70: B3 Line contains hard tab characters (\t): " ExperimentalFeatures: BlueZ Experimental Blue.. (330859bc-7506-492d-9370-9a6f0614037f)" 71: B1 Line exceeds max length (91>80): " ExperimentalFeatures: BlueZ Experimental ISO... (6fbaf188-05e0-496a-9885-d6ddfdb4e03e)" 71: B3 Line contains hard tab characters (\t): " ExperimentalFeatures: BlueZ Experimental ISO... (6fbaf188-05e0-496a-9885-d6ddfdb4e03e)" 72: B2 Line has trailing whitespace: " " 74: B2 Line has trailing whitespace: " " 99: B1 Line exceeds max length (82>80): " UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)" 100: B1 Line exceeds max length (82>80): " UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)" 101: B1 Line exceeds max length (82>80): " UUID: Volume Control (00001844-0000-1000-8000-00805f9b34fb)" 102: B1 Line exceeds max length (82>80): " UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)" 107: B1 Line exceeds max length (98>80): " ExperimentalFeatures: BlueZ Experimental ISO... (6fbaf188-05e0-496a-9885-d6ddfdb4e03e)" 108: B2 Line has trailing whitespace: " " 110: B2 Line has trailing whitespace: " " 122: B1 Line exceeds max length (90>80): " [server]# transport.acquire /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0/fd12" 124: B1 Line exceeds max length (90>80): " [CHG] Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_sink0/fd13 State: active" 125: B1 Line exceeds max length (92>80): " [CHG] Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0/fd12 State: active" 126: B2 Line has trailing whitespace: " " 128: B2 Line has trailing whitespace: " " 138: B2 Line has trailing whitespace: " " |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index b8c75f195..426aa89aa 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1259,6 +1259,7 @@ static int bap_probe(struct btd_service *service) struct btd_adapter *adapter = device_get_adapter(device); struct btd_gatt_database *database = btd_adapter_get_database(adapter); struct bap_data *data = btd_service_get_user_data(service); + struct gatt_db *adapter_db, *device_db; char addr[18]; ba2str(device_get_address(device), addr); @@ -1269,17 +1270,32 @@ static int bap_probe(struct btd_service *service) return -ENOTSUP; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL) && + !btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) { + DBG("BAP requires CIS features, unsupported by adapter"); + return -ENOTSUP; + } + /* Ignore, if we were probed for this device already */ if (data) { error("Profile probed twice for the same device!"); return -EINVAL; } + adapter_db = btd_gatt_database_get_db(database); + + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) + bt_bap_set_client_only(adapter_db); + + if (btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL)) + device_db = btd_device_get_gatt_db(device); + else + device_db = NULL; + data = bap_data_new(device); data->service = service; - data->bap = bt_bap_new(btd_gatt_database_get_db(database), - btd_device_get_gatt_db(device)); + data->bap = bt_bap_new(adapter_db, device_db); if (!data->bap) { error("Unable to create BAP instance"); free(data); @@ -1303,6 +1319,7 @@ static int bap_probe(struct btd_service *service) static int bap_accept(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); + struct btd_adapter *adapter = device_get_adapter(device); struct bt_gatt_client *client = btd_device_get_gatt_client(device); struct bap_data *data = btd_service_get_user_data(service); char addr[18]; @@ -1315,6 +1332,11 @@ static int bap_accept(struct btd_service *service) return -EINVAL; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL)) { + btd_service_connecting_complete(service, 0); + return 0; + } + if (!bt_bap_attach(data->bap, client)) { error("BAP unable to attach"); return -EINVAL; diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 0e0c40dc7..d9e133007 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1110,6 +1110,7 @@ static void bap_debug(const char *str, void *user_data) static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, int *err) { + struct btd_adapter *adapter = endpoint->adapter->btd_adapter; struct btd_gatt_database *database; struct gatt_db *db; struct iovec data; @@ -1122,7 +1123,7 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, return false; } - database = btd_adapter_get_database(endpoint->adapter->btd_adapter); + database = btd_adapter_get_database(adapter); if (!database) { error("Adapter database not found"); return false; @@ -1158,6 +1159,9 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, metadata->iov_len = endpoint->metadata_size; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) + bt_bap_set_client_only(db); + endpoint->pac = bt_bap_add_vendor_pac(db, name, type, endpoint->codec, endpoint->cid, endpoint->vid, &endpoint->qos, &data, metadata);