From patchwork Wed Aug 16 16:44:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EC1CC41513 for ; Wed, 16 Aug 2023 16:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344879AbjHPQqa (ORCPT ); Wed, 16 Aug 2023 12:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344934AbjHPQqS (ORCPT ); Wed, 16 Aug 2023 12:46:18 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A66B2D79 for ; Wed, 16 Aug 2023 09:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2+fs6q2J9JGV/Baxsw8UzR03ZAvVb8AMKKkesv/aPWPLIGlzMZr/af7VcIO4v7ECWTufpbnhQW+r4KFdUipPElWkr651e30e0hud7Ofc5FGWb0ugW0OQySh2o40MbLMTuvzWbmj312NUsx/T4MGT7LrMmd9S5BhMxXa2/Mm/pqiq1ldfrhC+qqbHy2DjHIGA3+yMiu9dXlmOPMtR2ImE9nQ1QOLI/TdwoYSGdTcEsQIb03Au6Ryg40ST0IpBkvddpP2WPyJR1f9b1kqNsuo67pvRI8ixL+YAdEqhYU+Pj7MIulbHB13mFQFpndJddT0XaUo8PbPeGYFmPgEEy1DNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bkF/yPAn8I1Vsryzb5t1nXIkobO9YYLDkcsYstmbVws=; b=B1F2pQS3V+3wI/i4p5JuVQOzs4Wt+ZUFwYcv37NSl4oc4V1oxH36dJSYYbcjUe/FUS/hCjwaFq+h2VorqYKl9LPY2XKckuZTPoS38Mwvs4VYj++Z05lj3cJllC2wjkcLJRbDWNS/+FdXPLgH6Azvl6SY5kYP7Vzb1pHu08OLzcXQleW8Lb0JUoS/+EbO4q1YMc4oPPiHu58DIaGPt98W9AuQtaNFSJ6U2RYD2hG10GSHOYxHXD7qcIgR3By+lniUF0gDoKZLxiR/dY4r7vKtHrqj8MyJMbLlIRo/mzZ4wmtyGI10MVTp3mlAY+x8huvq9NU0bKDFMXYVdg3hst0Qmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bkF/yPAn8I1Vsryzb5t1nXIkobO9YYLDkcsYstmbVws=; b=h0Lm0vof/YHYbbocd74bNcHA8ccW0vm+TrDST5SPwKQ+MRUzKipPbkx6rMXe1+2gZVHTowzAzLerQGnxXKvtjdxOiHN3RuqfrrwkWg6ywEujNKAzINCpqh+FwZzy0bUcn9BGQSgXGkjB/VyaTXOVx/2Yuagm1OmKQJqL5vg+VxI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM7PR04MB6997.eurprd04.prod.outlook.com (2603:10a6:20b:10d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:11 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:10 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 1/7] shared/bap: Add support for BAP broadcast sink Date: Wed, 16 Aug 2023 19:44:29 +0300 Message-Id: <20230816164435.5149-2-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM7PR04MB6997:EE_ X-MS-Office365-Filtering-Correlation-Id: 066074b9-63f5-4988-011d-08db9e7827eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rdBvPi561R1pCNQqKPvN8qYUr8+Jy+jmdwCDwuzigXv7jViJw/0ospKKq3BOaT0RlL+Sqf47meQqsCYqf0WlhEAkDx3kblHyTiIRUTg/4cT063Tv1BlL07puDJw4q0c6zcRpZlkZk9eDG4JNN/aVvBJFX6b2fmR1b+pIVr7yC5mCq0WNQqXALZpPMLs4XI5Y13DgHanIXrTVd7lQcwa1N81sizX0X7+3ZkTOaYJQv/dFrNKlztZAa4Es6WZCNqJjB8EVMyErpEHyVxKsYPiwv+skQYr6OhZ1Qayde4GfUR5fQj6znFi9vuqgy2VqsEtrB/J+GFmXQqbTqsiTnL98XGZuZfjayESn9LmVvmTjKP72ceH5EXb+UoVvHMoZcSoQH4xp0i4SQpt4m0qKQhKz9SKezIpvSapOT/NNDjCaCHZFq6Oujg66Ak4kZSM24LGIeO7h1HL+cNs/UXF1o9gf74fEGpXUf1jAbmiitb5hfMxUX8Lbb/kJHJoW9qd6jZqLlPScaoYhn2bemhoqdvzVPtdYWazE40IER9seeXQ6CfUp4azRPjGQkDCwEMwH3/fthl3Hu702WAF0TQz41VnY/FA10cMuJhbgIIdEgK7bwDJ9zbfH8gXxjyTmF0E2dnwH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(30864003)(2906002)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dSxEdROy4HmdnGdc9eEM1XCNcg24iJQRzABlJzDi7gfGVSO8QPBCT3o4S24lNm0w4xFi2rWXBm4mwpu1MMLzfGiePmvTzCIBcs95GaDKoiVoSrUBGASSTTfOYcx+N3L3FiBNuX2phu7zb8vIAxf4m3dMJA/nBMzNkOr5hrJpyUn0gXVMCPDRfHP797Vun2njpLELlvdGL/63BNnZkHo7MB+7e3aw434hllyhXX0HGbpbpQ8Wv0gMrLN6qb3g3Kj9pJNXPimif70U871cL+kFtrs4/JHDzSh0Wqkb+pHWyYaSTCCUqVCYSUwofDoiFsN07LFJdaHlPwAAanZ6I+JcfzTjtlM6OEmbwIzb9pjW9uSnliWQoVDzyiAR0LTCM+OJwBc49jGIVI0CHbzfBM8ciTFNqYjBwU5IIaJMFTZ2HPOHaFCRsmrMO4jRKyRF+NR60KHEC4F9Tf6detj+bBoWq7RFqQbhUUpJND1V4Km66q2kYq/bIi32pUgO8j0GTjzvaLYoJISxMAF6t1ytwimPxFVvLq9byrX+291TsBjioy+NfLC+RJZgyASmZEh8KxBcs7PbYytzGWUeWb1Ftw2p0ZX70fT5BrkY0qLjSnWA+LB52YMkf4oSvhk/orNZ+mAMmYPfat0oXm7t/3Z0hPTbuIj2FJa+gQPd9vtz9KAuZ/7IWQdvlAHmBMx/5JmpPVonAd3i4e1VX6wZkx3eyHiV3aSAbmiGthoSuu9optfy3Kyavs9YtNOY3xcJfT09QinZYo578f1evDy/g9TIm9ZR2FSAwW3CXZ9F5N0UmZA+1Lh+Iv0Nt2EyaU/IoRz0xj5/hlESKTc0af6Pu2X4pRk4QPS3xKcEka2NxDO6n2PzIHehxw9U4+uN19jPhswitcUveanayfvwQVX6O3zIZPgp/dAXNfaPeFvhk5gart/YfaMbI+1pxrliSOVB5gehYH+OoUfUCWOu5Os2XE4iEVx7VWKG3oC+jupf3BhREBHyDh62fCABRfvfQy3vp6b6SN6j4d5UpfQ7mWBqcDTAxBLD9isFMqb2Fra6q4oVyMQ8wOYBAt6fGd1a96kf9gzxkKVz/+ivO3SFLmQfWRIsHOGtHRIvyoYgjm57/8EpRcEHr0vSZ94TgDC5S5Nu1BIITFYVxq52mVXIcA4W/Sz92SWpTvm+sJXU8BkLpvW8as7XDxM2KGRXe9xONTZ5zOsexvpcnhfQAsOqVW8+qTqx+C/2RjADnyHu7vsYkl0ISq5+fk8sezwZ+YFdAxfrUPR0tkCMhiSiuzT/sWoGtDR72U5A4hndMaFwCg8f3xAWAYYlftoihZeS2Hmrlf5++hJQ/AC1sxqvc67RvauE0ZiA0FX8fLSNm0/h/nCGFKSamQYh+xVdna6UK1mJbROZb2Zd99IRQiYyP8xn6vz65s4JtmZa5eQHKiXKCDelO5XCy7gNwg/kLrisoZbAEE+//KCOPjgDlkHaASIDoVvuPOQXxZQnngQZwb4GS6UN7kZmvQYeMgJTEONV4Fge82DUdwAN3v02XlzmZ/50cf7Uoktzhyp3aHnAeNc5uStfN6xDrYtwIIjsu756wcWbZPMboHSA7ncS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 066074b9-63f5-4988-011d-08db9e7827eb X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:10.8826 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SkvbUsLsFtbqDOqIlrh1d5T6Mw1wEQvFkUr9vQIH5pCkpOBRIIWg/L0nlp/P7O7h4mzapp2so78YaQwKdtjkVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6997 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds support for BAP broadcast sink, creates a remote endpoint when a broadcast source is discovered and synchronizes with the source upon endpoint configuration. This feature was tested using bluetoothctl with the following commands: [bluetooth]# endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06 [bluetooth]# scan on [NEW] Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0 [bluetooth]# endpoint.config /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0 /local/endpoint/ep0 16_2_1 --- src/shared/bap.c | 261 ++++++++++++++++++++++++++++++++++++++++++----- src/shared/bap.h | 13 ++- 2 files changed, 246 insertions(+), 28 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 72ce67c08..c943f2e71 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -633,14 +633,18 @@ static struct bt_bap_endpoint *bap_endpoint_new(struct bt_bap_db *bdb, return ep; } -static struct bt_bap_endpoint *bap_endpoint_new_broacast(struct bt_bap_db *bdb) +static struct bt_bap_endpoint *bap_endpoint_new_broadcast(struct bt_bap_db *bdb, + uint8_t type) { struct bt_bap_endpoint *ep; ep = new0(struct bt_bap_endpoint, 1); ep->bdb = bdb; ep->attr = NULL; - ep->dir = BT_BAP_BCAST_SOURCE; + if (type == BT_BAP_BCAST_SINK) + ep->dir = BT_BAP_BCAST_SOURCE; + else + ep->dir = BT_BAP_BCAST_SINK; return ep; } @@ -667,22 +671,27 @@ static struct bt_bap_endpoint *bap_get_endpoint(struct queue *endpoints, return ep; } +static bool match_ep_type(const void *data, const void *match_data) +{ + const struct bt_bap_endpoint *ep = data; + const uint8_t type = PTR_TO_INT(match_data); + + return (ep->dir == type); +} + static struct bt_bap_endpoint *bap_get_endpoint_bcast(struct queue *endpoints, - struct bt_bap_db *db) + struct bt_bap_db *db, uint8_t type) { struct bt_bap_endpoint *ep; if (!db) return NULL; - /* - * We have support for only one stream so we will have - * only one endpoint. - * TO DO add support for more then one stream - */ - if (queue_length(endpoints) > 0) - return queue_peek_head(endpoints); - ep = bap_endpoint_new_broacast(db); + ep = queue_find(endpoints, match_ep_type, INT_TO_PTR(type)); + if (ep) + return ep; + + ep = bap_endpoint_new_broadcast(db, type); if (!ep) return NULL; @@ -1317,6 +1326,8 @@ static void stream_set_state_broadcast(struct bt_bap_stream *stream, struct bt_bap *bap = stream->bap; const struct queue_entry *entry; + if (ep->old_state == state) + return; ep->old_state = ep->state; ep->state = state; @@ -1348,6 +1359,9 @@ static void stream_set_state(struct bt_bap_stream *stream, uint8_t state) ep->old_state = ep->state; ep->state = state; + if (stream->lpac->type == BT_BAP_BCAST_SINK) + goto done; + if (stream->client) goto done; @@ -2379,6 +2393,10 @@ static struct bt_bap_pac *bap_pac_find(struct bt_bap_db *bdb, uint8_t type, return queue_find(bdb->sources, match_codec, codec); case BT_BAP_SINK: return queue_find(bdb->sinks, match_codec, codec); + case BT_BAP_BCAST_SOURCE: + return queue_find(bdb->broadcast_sources, match_codec, codec); + case BT_BAP_BCAST_SINK: + return queue_find(bdb->broadcast_sinks, match_codec, codec); } return NULL; @@ -2428,10 +2446,12 @@ static struct bt_bap_pac *bap_pac_new(struct bt_bap_db *bdb, const char *name, pac->bdb = bdb; pac->name = name ? strdup(name) : NULL; pac->type = type; - pac->codec = *codec; - pac->data = util_iov_dup(data, 1); - pac->metadata = util_iov_dup(metadata, 1); - + if (codec) + pac->codec = *codec; + if (data) + pac->data = util_iov_dup(data, 1); + if (metadata) + pac->metadata = util_iov_dup(metadata, 1); if (qos) pac->qos = *qos; @@ -2518,7 +2538,7 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, struct iovec *metadata) { struct bt_bap_db *bdb; - struct bt_bap_pac *pac, *pac_brodcast_sink; + struct bt_bap_pac *pac, *pac_broadcast_sink; struct bt_bap_codec codec; if (!db) @@ -2545,11 +2565,19 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, bap_add_source(pac); break; case BT_BAP_BCAST_SOURCE: - // For broadcast add local pac and remote pac bap_add_broadcast_source(pac); - pac_brodcast_sink = bap_pac_new(bdb, name, type, &codec, qos, + if (queue_isempty(bdb->broadcast_sinks)) { + /* When adding a local broadcast source, add also a + * local broadcast sink + */ + pac_broadcast_sink = bap_pac_new(bdb, name, + BT_BAP_BCAST_SINK, &codec, qos, data, metadata); - bap_add_broadcast_sink(pac_brodcast_sink); + bap_add_broadcast_sink(pac_broadcast_sink); + } + break; + case BT_BAP_BCAST_SINK: + bap_add_broadcast_sink(pac); break; default: bap_pac_free(pac); @@ -2923,6 +2951,98 @@ bool bap_print_cc(void *data, size_t len, util_debug_func_t func, return bap_print_ltv("CC", data, len, func, user_data); } +bool bap_parse_base(void *data, size_t len, util_debug_func_t func, + uint32_t *presDelay, uint8_t *numSubgroups, uint8_t *numBis, + struct bt_bap_codec *codec, struct iovec **caps, + struct iovec **meta) +{ + struct iovec iov = { + .iov_base = data, + .iov_len = len, + }; + uint8_t type, capsLen, metaLen; + uint16_t uuid; + uint8_t *hexstream; + + util_debug(func, NULL, "BASE Length %ld", len); + if (!util_iov_pull_u8(&iov, &type)) + return false; + util_debug(func, NULL, "ServiceType 0x%2.2x", type); + if (!util_iov_pull_le16(&iov, &uuid)) + return false; + util_debug(func, NULL, "ServiceUUID 0x%4.4x", uuid); + if (!util_iov_pull_le24(&iov, presDelay)) + return false; + util_debug(func, NULL, "PresentationDelay %d", *presDelay); + if (!util_iov_pull_u8(&iov, numSubgroups)) + return false; + util_debug(func, NULL, "NumSubgroups %d", *numSubgroups); + if (!util_iov_pull_u8(&iov, numBis)) + return false; + util_debug(func, NULL, "NumBis %d", *numBis); + codec = util_iov_pull_mem(&iov, sizeof(*codec)); + if (!codec) + return false; + util_debug(func, NULL, "%s: ID %d CID 0x%2.2x VID 0x%2.2x", + "Codec", codec->id, codec->cid, codec->vid); + if (!util_iov_pull_u8(&iov, &capsLen)) + return false; + util_debug(func, NULL, "CC Len %d", capsLen); + + if (!capsLen) + return false; + if (!caps) + return false; + if (!(*caps)) + *caps = new0(struct iovec, 1); + (*caps)->iov_len = capsLen; + (*caps)->iov_base = iov.iov_base; + + for (int i = 0; capsLen > 1; i++) { + struct bt_ltv *ltv = util_iov_pull_mem(&iov, sizeof(*ltv)); + uint8_t *caps; + + if (!ltv) { + util_debug(func, NULL, "Unable to parse %s", + "Capabilities"); + return false; + } + + util_debug(func, NULL, "%s #%u: len %u type %u", + "CC", i, ltv->len, ltv->type); + + caps = util_iov_pull_mem(&iov, ltv->len - 1); + if (!caps) { + util_debug(func, NULL, "Unable to parse %s", + "CC"); + return false; + } + util_hexdump(' ', caps, ltv->len - 1, func, NULL); + + capsLen -= (ltv->len + 1); + } + + if (!util_iov_pull_u8(&iov, &metaLen)) + return false; + util_debug(func, NULL, "Metadata Len %d", metaLen); + + if (!metaLen) + return false; + if (!meta) + return false; + if (!(*meta)) + *meta = new0(struct iovec, 1); + (*meta)->iov_len = metaLen; + (*meta)->iov_base = iov.iov_base; + + hexstream = util_iov_pull_mem(&iov, metaLen); + if (!hexstream) + return false; + util_hexdump(' ', hexstream, metaLen, func, NULL); + + return true; +} + static void bap_parse_pacs(struct bt_bap *bap, uint8_t type, struct queue *queue, const uint8_t *value, @@ -4008,7 +4128,8 @@ bool bt_bap_attach_broadcast(struct bt_bap *bap) queue_push_tail(sessions, bap); - ep = bap_get_endpoint_bcast(bap->remote_eps, bap->ldb); + ep = bap_get_endpoint_bcast(bap->remote_eps, bap->ldb, + BT_BAP_BCAST_SOURCE); if (ep) ep->bap = bap; @@ -4198,7 +4319,11 @@ static void bap_foreach_pac(struct queue *l, struct queue *r, for (er = queue_get_entries(r); er; er = er->next) { struct bt_bap_pac *rpac = er->data; - if (!bap_codec_equal(&lpac->codec, &rpac->codec)) + /* Skip checking codec for bcast source, + * it will be checked when BASE info are received + */ + if ((rpac->type != BT_BAP_BCAST_SOURCE) && + (!bap_codec_equal(&lpac->codec, &rpac->codec))) continue; if (!func(lpac, rpac, user_data)) @@ -4221,9 +4346,19 @@ void bt_bap_foreach_pac(struct bt_bap *bap, uint8_t type, return bap_foreach_pac(bap->ldb->sinks, bap->rdb->sources, func, user_data); case BT_BAP_BCAST_SOURCE: - return bap_foreach_pac(bap->ldb->broadcast_sources, + if (queue_isempty(bap->rdb->broadcast_sources) + && queue_isempty(bap->rdb->broadcast_sinks)) + return bap_foreach_pac(bap->ldb->broadcast_sources, bap->ldb->broadcast_sinks, func, user_data); + + return bap_foreach_pac(bap->ldb->broadcast_sinks, + bap->rdb->broadcast_sources, + func, user_data); + case BT_BAP_BCAST_SINK: + return bap_foreach_pac(bap->ldb->broadcast_sinks, + bap->rdb->broadcast_sources, + func, user_data); } } @@ -4243,10 +4378,10 @@ int bt_bap_pac_get_vendor_codec(struct bt_bap_pac *pac, uint8_t *id, if (vid) *vid = pac->codec.cid; - if (data) + if (data && pac->data) *data = pac->data; - if (metadata) + if (metadata && pac->metadata) *metadata = pac->metadata; return 0; @@ -4382,6 +4517,11 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream, return req->id; case BT_BAP_STREAM_TYPE_BCAST: stream->qos = *qos; + if (stream->lpac->type == BT_BAP_BCAST_SINK) { + if (data) + stream_config(stream, data, NULL); + stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); + } return 1; } @@ -4434,7 +4574,8 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, return NULL; if (lpac && rpac) { - if (!bap_codec_equal(&lpac->codec, &rpac->codec)) + if ((rpac->type != BT_BAP_BCAST_SOURCE) + && (!bap_codec_equal(&lpac->codec, &rpac->codec))) return NULL; } else { uint8_t type; @@ -4446,13 +4587,19 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, if (rpac) type = rpac->type; else if (lpac) { - switch(lpac->type) { + switch (lpac->type) { case BT_BAP_SINK: type = BT_BAP_SOURCE; break; case BT_BAP_SOURCE: type = BT_BAP_SINK; break; + case BT_BAP_BCAST_SOURCE: + type = BT_BAP_BCAST_SINK; + break; + case BT_BAP_BCAST_SINK: + type = BT_BAP_BCAST_SOURCE; + break; default: return NULL; } @@ -4913,6 +5060,13 @@ struct io *bt_bap_stream_get_io(struct bt_bap_stream *stream) return io->io; } +bool bt_bap_match_bcast_sink_stream(const void *data, const void *user_data) +{ + const struct bt_bap_stream *stream = data; + + return stream->lpac->type == BT_BAP_BCAST_SINK; +} + static bool stream_io_disconnected(struct io *io, void *user_data) { struct bt_bap_stream *stream = user_data; @@ -4944,6 +5098,14 @@ static bool match_req_id(const void *data, const void *match_data) return (req->id == id); } +static bool match_name(const void *data, const void *match_data) +{ + const struct bt_bap_pac *pac = data; + const char *name = match_data; + + return (!strcmp(pac->name, name)); +} + int bt_bap_stream_cancel(struct bt_bap_stream *stream, unsigned int id) { struct bt_bap_req *req; @@ -5132,3 +5294,50 @@ bool bt_bap_stream_io_is_connecting(struct bt_bap_stream *stream, int *fd) return io->connecting; } + +bool bt_bap_new_bcast_source(struct bt_bap *bap, const char *name) +{ + struct bt_bap_endpoint *ep; + struct bt_bap_pac *pac_broadcast_source; + + /* Add the remote source only if a local sink endpoint was registered */ + if (queue_isempty(bap->ldb->broadcast_sinks)) + return false; + + /* Add the remote source only if a local sink endpoint was registered */ + if (queue_isempty(bap->ldb->broadcast_sinks)) + return false; + + /* Add remote source endpoint */ + if (!bap->rdb->broadcast_sources) + bap->rdb->broadcast_sources = queue_new(); + + if (queue_find(bap->rdb->broadcast_sources, match_name, name)) + return true; + + pac_broadcast_source = bap_pac_new(bap->rdb, name, BT_BAP_BCAST_SOURCE, + NULL, NULL, NULL, NULL); + queue_push_tail(bap->rdb->broadcast_sources, pac_broadcast_source); + + if (!pac_broadcast_source) + return false; + + queue_foreach(bap->pac_cbs, notify_pac_added, pac_broadcast_source); + + /* Push remote endpoint with direction sink */ + ep = bap_endpoint_new_broadcast(bap->rdb, BT_BAP_BCAST_SINK); + + if (ep) + queue_push_tail(bap->remote_eps, ep); + + return true; +} + +void bt_bap_update_bcast_source(struct bt_bap_pac *pac, + struct bt_bap_codec *codec, + struct iovec *data, + struct iovec *metadata) +{ + bap_pac_merge(pac, data, metadata); + pac->codec = *codec; +} diff --git a/src/shared/bap.h b/src/shared/bap.h index 50b567663..8a8be9495 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -194,7 +194,10 @@ bool bt_bap_set_debug(struct bt_bap *bap, bt_bap_debug_func_t cb, bool bap_print_cc(void *data, size_t len, util_debug_func_t func, void *user_data); - +bool bap_parse_base(void *data, size_t len, util_debug_func_t func, + uint32_t *presDelay, uint8_t *numSubgroups, uint8_t *numBis, + struct bt_bap_codec *codec, struct iovec **caps, + struct iovec **meta); unsigned int bt_bap_pac_register(struct bt_bap *bap, bt_bap_pac_func_t added, bt_bap_pac_func_t removed, void *user_data, bt_bap_destroy_func_t destroy); @@ -289,7 +292,7 @@ struct bt_bap_qos *bt_bap_stream_get_qos(struct bt_bap_stream *stream); struct iovec *bt_bap_stream_get_metadata(struct bt_bap_stream *stream); struct io *bt_bap_stream_get_io(struct bt_bap_stream *stream); - +bool bt_bap_match_bcast_sink_stream(const void *data, const void *user_data); bool bt_bap_stream_set_io(struct bt_bap_stream *stream, int fd); int bt_bap_stream_cancel(struct bt_bap_stream *stream, unsigned int id); @@ -305,3 +308,9 @@ uint8_t bt_bap_stream_io_dir(struct bt_bap_stream *stream); int bt_bap_stream_io_connecting(struct bt_bap_stream *stream, int fd); bool bt_bap_stream_io_is_connecting(struct bt_bap_stream *stream, int *fd); + +bool bt_bap_new_bcast_source(struct bt_bap *bap, const char *name); +void bt_bap_update_bcast_source(struct bt_bap_pac *pac, + struct bt_bap_codec *codec, + struct iovec *data, + struct iovec *metadata); From patchwork Wed Aug 16 16:44:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355494 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F672C04FDF for ; Wed, 16 Aug 2023 16:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344887AbjHPQqa (ORCPT ); Wed, 16 Aug 2023 12:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344954AbjHPQqY (ORCPT ); Wed, 16 Aug 2023 12:46:24 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2048.outbound.protection.outlook.com [40.107.241.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F90730D1 for ; Wed, 16 Aug 2023 09:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSJw/FRXAO+M4N/1prcgV0F0yoy/6JoAEd0fvdWVKXjKAbiRL0SQkyW1mJv3bYYJpoDRrBTYHDsnZf3fO+l3HzDAz5wzPYw76izsfJ7OirOeR7pOHkRneFumZ7lJIx4oNudtGy+nr/j8y9v/Jbn5F/COi6uI5Tq9opz5hFA+hixFTArAMKZqOu6BbPq73Z4CYCGneJcgXTxVAuPxsWH2x95MN0L9J1EvQKms7JHwl3Rq4ifIc/lCs7SmVi3BcKWHlh5cctiGXaq06efpvMCZm80Qthe1p59MpvKAw8xIrk41VHK37+w9guqQVyKmBRW94Ch4Ch2soWtsq5s+HYyN5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l3vel0GjJILZCC8X8CYF3E09fErftPgol2Pbm6Ug+Wg=; b=ZHCsKH827pPMKIDhnItCGr44niC83FXxwjOU/TSadKMUWZJGS84lBm3tWGtyMgLe4F8STqed/e731qgrKOYLRB0k5U72j9H5q8f3XvZyVhgSE+gQ7ClDqXzq2dxTUnsxzNAhF2T9d1gve2yXyTvQO50nNRUOc6mxAGSx20Dqnotf3Asm8tr3QQSN02vqO8JQGZEzp6TxdRZGZKRqWDP8dOAO+aHoLJiNlOooSYSWxStuIbypjWan/rpafK39bGTCDMTDqJsgRHsNox3V8ggHBLNFs2e/iWJjbsvpRO4deI+uiLRoYl7U334G1RUL+mSuu5GkbYIQpSrCDlpAgCmqAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l3vel0GjJILZCC8X8CYF3E09fErftPgol2Pbm6Ug+Wg=; b=YAV8/+d+Tra8+pluk6TbyhgatkEgf7QkO5OLzUPBpsBnGDhoh4ZGCB+B6bKr/LmPYIAPMIvDICIqQncStJ/nURGJUom3jPi5swosjYoDFyMOk9Hj4QYzwk6asRmauzojHKEg/yNBDHeY5TvvTL9vUTjj2Pf/RzJ4Qh0fQHmjjA8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM7PR04MB6997.eurprd04.prod.outlook.com (2603:10a6:20b:10d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:15 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:15 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 2/7] bap: Add support for BAP broadcast sink Date: Wed, 16 Aug 2023 19:44:30 +0300 Message-Id: <20230816164435.5149-3-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM7PR04MB6997:EE_ X-MS-Office365-Filtering-Correlation-Id: 62ec2164-f464-43b7-dbac-08db9e782a4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1SMPCeYQ+blVz0lGy9DNzloYjPgT7Pz0msTWASEA+BoBUFvqmiVC9qpIlMINXL9Gcvt+Sd1TCRGW59mfPi98ZYTNQ2mngheaa/dujZuZnsbuCBSFIv9wzqFJmaZxsCMl2fm8XQ3cGoDL0SMM55X+4+M1vqfS9lASGF8M7tahSpW0JbLi6SDOrpo9Qityd7HsiN269RLDZGC4GLAjP1cNWBBwfE1UUaZwrXIp/X9PxnyQKbVTzLdD2DjRr832+vZpAQFzE38W8JjK+yG+kue1iLNqRqcgjqX86QMWxB661bK60tSJrS82I9vhNPVwNYRUbsjvgkaDvmf/DcHubM9ss/BcxGT5DqtLfpzaRcpcg5aKMXzAF5jNaz/2QHEYfO5csfZ7ShZujTHbVGIhNZ45PqHWYtQn+oTcjUfv/Q6UqYDMyFpZs6Knmv/ogx26h81aVovikMxRqE8bU6aaexKFx9p4Hpj1SJ90hoebYAl+daCt8L68odpB0l7QDxr5WMeHaV83f8lFVFqMxvSuyBBYSrjR5UAbT+z3RnDDA9Oab8oDdQhCRuzWJa+rNzPjMQbmqTclSKxbNvhxj2P/NxWtX3al1iEZOlSyOCCFgwtSGmyDJJVpuHpADTa6FWCn1b5g X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(30864003)(2906002)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zLC0klOy+0oAo00NKd1CPWWQGC9Im7Bj6VD7ZpTiwGeNYXaER6NvUkVh9GmCGk7Uvyua2t/giuSRiKttoNg1GeahSf+d/vaHAb4gyqpqaLCOsxDvkQEdcgyB7rtnH5dr+WFlkNt4QNdqkyddBbAAxY+FEFnrIv+aFI3ljJ5/vXsvz80YSNFBWkhqa9XN0W1xB7ks1kDxED3UcJgolLSqQmeoEglARpK+qDp5ClxPjLJ/QuGejh37PnmqqzGzqmJhXBY0Ibcn1kRNnYQCalh+pSMDZPBZ2c78wKNCm63HdzzBnTW81i/n37jrZJiFDHlEVHkd8XDktSftWA6ZoS6nF30xsvv1bG0c8uRTGnQjh84QeBZ3Q5O6xTxkQxs0lObRWH7W1F/+bayfzHBLpBOaJ8k8t59NWvHIWy1eSZwSQLOl0le3iN6dOz17IU+PWQPpmGknlJIe36HQz3hr7qOf7AyzRGHxlrPvy65LVoTSl5JjyH/QgElhiMjhPjwaLt0lt87OH1necs1ywXm0b/P7x+A+ZwFMp9WRl43p68M5JhEJxoMlm0ek22FHF5/d5NDciIZw3vSG5oWbnaRcWu/kJvNT955BsTBciNtD8t8yRMiHvm0Xg8ywJVsTVN+wGwb9jKKBekzHs631ny8TaImBDSlAv1XZ9z7YA2jUkCpTXzIg6NzboZMkxXaJh58BaAQn19v7AWsphKW2yw67mGQLm1nDNts2T41/U1TmVkX6RJ+0SkE1HvHQVMYX5hpOSoOGPY2uHE+TfnEw4TaEEtgSogmHkqdirOmQ3Tn9flk9ZW24rfxdyIOJkVNlHMFxYzhk7kWhqjbF1lFkFaTPeSeSA6f05H+Xjlzhn759DOSURYGSfqcVRzTjmjeBtZc5jfJbU4S9Y8xNcbdpB6YLNYqmtcL1vxLk9/I4fegmcFPowf+qi9qULDaVhyvlZ4KHjcWZfAjONhWgjrhRlpwhf39eEwV41Wb/grR8T8R6pJX6E1qhigPbbRLCGhehqq+xr1KNruSKIHRMvz/7gSZ5yO00q1j6heMeIXEFy+9bv2aF8GqE0DhYHOYC7yjHaWEJwYeLchhd1sXcRlU/4XbWMv0lE9xXUYahdTvEC65cmZGjPs8YcRtJw6v9Uyw0sR7jNQ7bYibBEkil3oSvaFi+Sr+4d5VQf3UxacQQRP5TUnImKHpITxPZjYGQYuWB1SW0ttW3RE2aYiafHCM08JZKpd4AGPpwqQKgrKagTimfH8KhLD+PrOAV5av3mGBhIMj0E6MfMQ5Moc0rglYZbotBolBJtNKZzxJ2oVEA6fm+RZe4Flcd3ydLWfkSf7/Ull3/gecz9i21/UHoKX9fQuZoHLQvD09EZSVkibNDyAC6fPA1jQNIFFI807YcabW4uxjm7VcIQ/Q2OeKPqK0oivBsgE7xMgviHRA1BxG4RQ6Zzb/XNL++M+zfUOzxJt7WRvPd8KXMTzxlQOYz0jmHkTZt9FtVnaGKgzy5pc8claFOFx+zbBR0MorUvyepTu2AIscdhe0+qBgefvkXaTJba2Iz+I6JMZAaBSS9MjUWKyVdc4oAvy/H7QluD4wzgCkqP+LBU6+r X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62ec2164-f464-43b7-dbac-08db9e782a4a X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:14.9257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QCUusjrmAMxrTPij4jLj2WJgRv3vXTlafmi4AHtGiNZVLBEEnkve8gkKS0mKf9rk6lcVz72gpeTH0WDpGfRo5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6997 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds support for BAP broadcast sink, creates a remote endpoint when a broadcast source is discovered and synchronizes with the source upon endpoint configuration. This feature was tested using bluetoothctl with the following commands: [bluetooth]# endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06 [bluetooth]# scan on [NEW] Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0 [bluetooth]# endpoint.config /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_bcast0 /local/endpoint/ep0 16_2_1 --- profiles/audio/bap.c | 313 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 287 insertions(+), 26 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 8cbb238ef..5e84e0c27 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -34,6 +34,7 @@ #include "lib/hci.h" #include "lib/sdp.h" #include "lib/uuid.h" +#include "lib/iso.h" #include "src/btd.h" #include "src/dbus-common.h" @@ -57,7 +58,9 @@ #define ISO_SOCKET_UUID "6fbaf188-05e0-496a-9885-d6ddfdb4e03e" #define PACS_UUID_STR "00001850-0000-1000-8000-00805f9b34fb" +#define BCAAS_UUID_STR "00001852-0000-1000-8000-00805f9b34fb" #define MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1" +#define MEDIA_INTERFACE "org.bluez.Media1" struct bap_ep { char *path; @@ -186,6 +189,9 @@ static gboolean get_uuid(const GDBusPropertyTable *property, uuid = PAC_SINK_UUID; else if (queue_find(ep->data->srcs, NULL, ep)) uuid = PAC_SOURCE_UUID; + else if ((queue_find(ep->data->bcast, NULL, ep) + && (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK))) + uuid = BCAA_SERVICE_UUID; else uuid = BAA_SERVICE_UUID; @@ -207,6 +213,19 @@ static gboolean get_codec(const GDBusPropertyTable *property, return TRUE; } +static gboolean has_capabilities(const GDBusPropertyTable *property, void *data) +{ + struct bap_ep *ep = data; + struct iovec *d = NULL; + + bt_bap_pac_get_codec(ep->rpac, NULL, &d, NULL); + + if (d) + return TRUE; + + return FALSE; +} + static gboolean get_capabilities(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -248,7 +267,7 @@ static const GDBusPropertyTable ep_properties[] = { G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Codec", "y", get_codec, NULL, NULL, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Capabilities", "ay", get_capabilities, NULL, NULL, + { "Capabilities", "ay", get_capabilities, NULL, has_capabilities, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Device", "o", get_device, NULL, NULL, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, @@ -556,7 +575,7 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, } if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) { - /* Mark CIG and CIS to be auto assigned */ + /* Mark BIG and BIS to be auto assigned */ ep->qos.bcast.big = BT_ISO_QOS_BIG_UNSET; ep->qos.bcast.bis = BT_ISO_QOS_BIS_UNSET; } else { @@ -597,13 +616,126 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, break; case BT_BAP_STREAM_TYPE_BCAST: /* No message sent over the air for broadcast */ - ep->id = 0; + if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK) + ep->msg = dbus_message_ref(msg); + else + ep->id = 0; + return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } return NULL; } +static void update_bcast_qos(struct bt_iso_qos *qos, + struct bt_bap_qos *bap_qos) +{ + bap_qos->bcast.big = qos->bcast.big; + bap_qos->bcast.bis = qos->bcast.bis; + bap_qos->bcast.sync_interval = qos->bcast.sync_interval; + bap_qos->bcast.packing = qos->bcast.packing; + bap_qos->bcast.framing = qos->bcast.framing; + bap_qos->bcast.encryption = qos->bcast.encryption; + bap_qos->bcast.options = qos->bcast.options; + bap_qos->bcast.skip = qos->bcast.skip; + bap_qos->bcast.sync_timeout = qos->bcast.sync_timeout; + bap_qos->bcast.sync_cte_type = qos->bcast.sync_cte_type; + bap_qos->bcast.mse = qos->bcast.mse; + bap_qos->bcast.timeout = qos->bcast.timeout; + bap_qos->bcast.io_qos.interval = qos->bcast.in.interval; + bap_qos->bcast.io_qos.latency = qos->bcast.in.latency; + bap_qos->bcast.io_qos.phy = qos->bcast.in.phy; + bap_qos->bcast.io_qos.sdu = qos->bcast.in.sdu; + bap_qos->bcast.io_qos.rtn = qos->bcast.in.rtn; + + bap_qos->bcast.bcode = new0(struct iovec, 1); + util_iov_memcpy(bap_qos->bcast.bcode, qos->bcast.bcode, + sizeof(qos->bcast.bcode)); +} + +static bool match_ep_type(const void *data, const void *user_data) +{ + const struct bap_ep *ep = data; + + return (bt_bap_pac_get_type(ep->lpac) == PTR_TO_INT(user_data)); +} + +static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data) +{ + struct bap_data *data = user_data; + struct bt_iso_qos qos; + struct bt_iso_base base; + char address[18]; + struct bap_ep *ep; + int fd; + struct iovec *base_io; + uint32_t presDelay; + uint8_t numSubgroups; + uint8_t numBis; + struct bt_bap_codec codec; + + bt_io_get(io, &err, + BT_IO_OPT_DEST, address, + BT_IO_OPT_QOS, &qos, + BT_IO_OPT_BASE, &base, + BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + goto drop; + } + + g_io_channel_ref(io); + btd_service_connecting_complete(data->service, 0); + DBG("BCAST ISO: sync with %s (BIG 0x%02x BIS 0x%02x)", + address, qos.bcast.big, qos.bcast.bis); + + ep = queue_find(data->bcast, match_ep_type, + INT_TO_PTR(BT_BAP_BCAST_SINK)); + if (!ep) + return; + + update_bcast_qos(&qos, &ep->qos); + + base_io = new0(struct iovec, 1); + util_iov_memcpy(base_io, base.base, base.base_len); + + bap_parse_base(base_io->iov_base, base_io->iov_len, bap_debug, + &presDelay, &numSubgroups, &numBis, + &codec, &ep->caps, &ep->metadata); + + /* Update pac with BASE information */ + bt_bap_update_bcast_source(ep->rpac, &codec, ep->caps, ep->metadata); + ep->id = bt_bap_stream_config(ep->stream, &ep->qos, + ep->caps, NULL, NULL); + data->listen_io = io; + + bt_bap_stream_set_user_data(ep->stream, ep->path); + + fd = g_io_channel_unix_get_fd(io); + + if (bt_bap_stream_set_io(ep->stream, fd)) { + bt_bap_stream_enable(ep->stream, true, NULL, NULL, NULL); + g_io_channel_set_close_on_unref(io, FALSE); + return; + } + + + return; + +drop: + g_io_channel_shutdown(io, TRUE, NULL); + +} + +static bool match_data_bap_data(const void *data, const void *match_data) +{ + const struct bap_data *bdata = data; + const struct btd_adapter *adapter = match_data; + + return bdata->user_data == adapter; +} + static const GDBusMethodTable ep_methods[] = { { GDBUS_EXPERIMENTAL_ASYNC_METHOD("SetConfiguration", GDBUS_ARGS({ "endpoint", "o" }, @@ -649,15 +781,17 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, struct bt_bap_pac *lpac, struct bt_bap_pac *rpac) { - struct btd_adapter *adapter = data->user_data; + struct btd_adapter *adapter = data->adapter; + struct btd_device *device = data->device; struct bap_ep *ep; struct queue *queue; - int i, err; + int i, err = 0; const char *suffix; struct match_ep match = { lpac, rpac }; switch (bt_bap_pac_get_type(rpac)) { case BT_BAP_BCAST_SOURCE: + case BT_BAP_BCAST_SINK: queue = data->bcast; i = queue_length(data->bcast); suffix = "bcast"; @@ -675,8 +809,20 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, ep->lpac = lpac; ep->rpac = rpac; - err = asprintf(&ep->path, "%s/pac_%s%d", adapter_get_path(adapter), - suffix, i); + if (device) + ep->data->device = device; + + switch (bt_bap_pac_get_type(rpac)) { + case BT_BAP_BCAST_SINK: + err = asprintf(&ep->path, "%s/pac_%s%d", + adapter_get_path(adapter), suffix, i); + break; + case BT_BAP_BCAST_SOURCE: + err = asprintf(&ep->path, "%s/pac_%s%d", + device_get_path(device), suffix, i); + break; + } + if (err < 0) { error("Could not allocate path for remote pac %s/pac%d", adapter_get_path(adapter), i); @@ -685,14 +831,13 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, } if (g_dbus_register_interface(btd_get_dbus_connection(), - ep->path, MEDIA_ENDPOINT_INTERFACE, - ep_methods, NULL, ep_properties, - ep, ep_free) == FALSE) { + ep->path, MEDIA_ENDPOINT_INTERFACE, + ep_methods, NULL, ep_properties, + ep, ep_free) == FALSE) { error("Could not register remote ep %s", ep->path); ep_free(ep); return NULL; } - bt_bap_pac_set_user_data(rpac, ep->path); DBG("ep %p lpac %p rpac %p path %s", ep, ep->lpac, ep->rpac, ep->path); @@ -824,6 +969,7 @@ done: queue_foreach(ep->data->srcs, bap_config, NULL); queue_foreach(ep->data->snks, bap_config, NULL); + queue_foreach(ep->data->bcast, bap_config, NULL); } static bool pac_found(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, @@ -1310,6 +1456,45 @@ static void bap_listen_io(struct bap_data *data, struct bt_bap_stream *stream, data->listen_io = io; } +static void bap_listen_io_broadcast(struct bap_data *data, struct bap_ep *ep, + struct bt_bap_stream *stream, struct bt_iso_qos *qos) +{ + GIOChannel *io; + GError *err = NULL; + struct sockaddr_iso_bc iso_bc_addr; + + iso_bc_addr.bc_bdaddr_type = btd_device_get_bdaddr_type(data->device); + memcpy(&iso_bc_addr.bc_bdaddr, device_get_address(data->device), + sizeof(bdaddr_t)); + iso_bc_addr.bc_bis[0] = 1; + iso_bc_addr.bc_num_bis = 1; + + DBG("stream %p", stream); + + /* If IO already set skip creating it again */ + if (bt_bap_stream_get_io(stream) || data->listen_io) + return; + + io = bt_io_listen(iso_bcast_confirm_cb, NULL, ep->data, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, + btd_adapter_get_address(ep->data->adapter), + BT_IO_OPT_DEST_BDADDR, + device_get_address(data->device), + BT_IO_OPT_DEST_TYPE, + btd_device_get_bdaddr_type(data->device), + BT_IO_OPT_MODE, BT_IO_MODE_ISO, + BT_IO_OPT_QOS, &qos->bcast, + BT_IO_OPT_ISO_BC_NUM_BIS, iso_bc_addr.bc_num_bis, + BT_IO_OPT_ISO_BC_BIS, iso_bc_addr.bc_bis, + BT_IO_OPT_INVALID); + if (!io) { + error("%s", err->message); + g_error_free(err); + } + + ep->data->listen_io = io; + +} static void bap_create_ucast_io(struct bap_data *data, struct bap_ep *ep, struct bt_bap_stream *stream, int defer) { @@ -1364,10 +1549,10 @@ static void bap_create_bcast_io(struct bap_data *data, struct bap_ep *ep, memcpy(&iso_qos.bcast.out, &ep->qos.bcast.io_qos, sizeof(struct bt_iso_io_qos)); done: - if (ep) + if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) bap_connect_io_broadcast(data, ep, stream, &iso_qos); else - bap_listen_io(data, stream, &iso_qos); + bap_listen_io_broadcast(data, ep, stream, &iso_qos); } static void bap_create_io(struct bap_data *data, struct bap_ep *ep, @@ -1417,6 +1602,11 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, break; case BT_BAP_STREAM_STATE_CONFIG: if (ep && !ep->id) { + if + (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK) { + bap_create_bcast_io(data, ep, stream, true); + return; + } bap_create_io(data, ep, stream, true); if (!ep->io) { error("Unable to create io"); @@ -1424,7 +1614,6 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, return; } - if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_UCAST) { /* Wait QoS response to respond */ @@ -1475,12 +1664,12 @@ static void pac_added_broadcast(struct bt_bap_pac *pac, void *user_data) { struct bap_data *data = user_data; - if (bt_bap_pac_get_type(pac) == BT_BAP_BCAST_SOURCE) { - DBG("pac %p", pac); - + if (bt_bap_pac_get_type(pac) == BT_BAP_BCAST_SOURCE) bt_bap_foreach_pac(data->bap, BT_BAP_BCAST_SOURCE, pac_found_bcast, data); - } + else if (bt_bap_pac_get_type(pac) == BT_BAP_BCAST_SINK) + bt_bap_foreach_pac(data->bap, BT_BAP_BCAST_SINK, + pac_found_bcast, data); } static bool ep_match_pac(const void *data, const void *match_data) @@ -1596,14 +1785,6 @@ static bool match_data(const void *data, const void *match_data) return bdata->bap == bap; } -static bool match_data_bap_data(const void *data, const void *match_data) -{ - const struct bap_data *bdata = data; - const struct btd_adapter *adapter = match_data; - - return bdata->user_data == adapter; -} - static bool io_get_qos(GIOChannel *io, struct bt_iso_qos *qos) { GError *err = NULL; @@ -1733,6 +1914,71 @@ static void bap_detached(struct bt_bap *bap, void *user_data) bap_data_remove(data); } +static int bap_bcast_probe(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(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); + char addr[18]; + + ba2str(device_get_address(device), addr); + + if (!btd_adapter_has_exp_feature(adapter, EXP_FEAT_ISO_SOCKET)) { + error("BAP requires ISO Socket which is not enabled"); + return -ENOTSUP; + } + + /* Ignore, if we were probed for this device already */ + if (data) { + error("Profile probed twice for the same device!"); + return -EINVAL; + } + + data = bap_data_new(device); + data->service = service; + data->adapter = adapter; + data->device = device; + + data->bap = bt_bap_new(btd_gatt_database_get_db(database), + btd_gatt_database_get_db(database)); + if (!data->bap) { + error("Unable to create BAP instance"); + free(data); + return -EINVAL; + } + + bap_data_add(data); + + data->ready_id = bt_bap_ready_register(data->bap, bap_ready, service, + NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state, + bap_connecting, data, NULL); + data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, + pac_removed_broadcast, data, NULL); + + bt_bap_set_user_data(data->bap, service); + + bt_bap_new_bcast_source(data->bap, device_get_path(device)); + return 0; +} + +static void bap_bcast_remove(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct bap_data *data; + char addr[18]; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + data = btd_service_get_user_data(service); + if (!data) { + error("BAP service not handled by profile"); + return; + } +} + static int bap_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); @@ -1901,6 +2147,17 @@ static struct btd_profile bap_profile = { .experimental = true, }; +static struct btd_profile bap_bcast_profile = { + .name = "bcaa", + .priority = BTD_PROFILE_PRIORITY_MEDIUM, + .remote_uuid = BCAAS_UUID_STR, + .device_probe = bap_bcast_probe, + .device_remove = bap_bcast_remove, + .auto_connect = false, + .experimental = true, + .probe_on_discover = true, +}; + static unsigned int bap_id = 0; static int bap_init(void) @@ -1911,6 +2168,10 @@ static int bap_init(void) if (err) return err; + err = btd_profile_register(&bap_bcast_profile); + if (err) + return err; + bap_id = bt_bap_register(bap_attached, bap_detached, NULL); return 0; From patchwork Wed Aug 16 16:44:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D5B8C04A6A for ; Wed, 16 Aug 2023 16:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344886AbjHPQrB (ORCPT ); Wed, 16 Aug 2023 12:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344905AbjHPQqg (ORCPT ); Wed, 16 Aug 2023 12:46:36 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7412D5A for ; Wed, 16 Aug 2023 09:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0cfcEeZQ9PrjQ+0s2idUDQHQREWpxgZDZaZ3bPr/0YNwFKUkV7YEvyuHln8kOiign92UMqzhsyyJfV97J4abFBjFFWe9FCk23qDcNMTg2FdxuRjRd5lBKlB+34xlb66yjsd3ST/Vq0VohqyChzgkEYfHNHe9W5Ia18NTezLs7sR7t+YbJstLCPeEa9TBuf32019Fxu5levLUuDCBNuV1pWGY/HWL68XWcjD5ralX0j3ghvr9pHfuqKu90O7R/8fbk+FFnFzaYF2v7LTwpztuvMiLm25YxyVetWKL+UEyPoQ9T93TQHmNtz15DgtPiQ/puddwCbX/NSRLP4W8lA/6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zk51XRdRPoiZL44px+EVPmHqBQQJJ3OpxPpz0oXCnuk=; b=GODxVyfjwIPa8ZEWjuxqGkIMNsdmGkpHUXG9uoTS81+5P8qt82J+znB1H3nPvKr9Bbczm/6ZtVFSzcIsn2nxNFWfN+PwuTVhUTugMAwnHe5XGvG/2YJLLa0ZrEX8BdMutuR4bk/i8KumfzBbZ9zwJ2gFX6S2mJFyNRpq6TTKKbr3w4+JWbyJ+9buywt13d8hGpgtxqACi1jj2rYLpamLW/PXeTw+ouGZ1DIYTDGprNTF/kRFVTyFYkL0uB92V+pwmFHFm5GEPecOshsc3NeXYC/44cB9TyW5C+Z0cORlgh7n90umGC7QroUUU8g28c270xqOa0NT2BTt1KRSRkf3tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zk51XRdRPoiZL44px+EVPmHqBQQJJ3OpxPpz0oXCnuk=; b=WQh5gmNaZb6GvxXXmK4FVrB2gezFLMtGvZ34ouGxa7UmKRdi8Jy6UJkWug+PU92xReenfu2iwKB3E9clp/zFvoo9BJ8JduG7pvLwxt2Sf9LKMa+D/KDQQV8BhJJpeIyDzO6mHCjj/0Dj1tBZvMYw0idVf5+/pqIiU50DlA4inC0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM7PR04MB6997.eurprd04.prod.outlook.com (2603:10a6:20b:10d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:18 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:18 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 3/7] media: Add broadcast sink media endpoint Date: Wed, 16 Aug 2023 19:44:31 +0300 Message-Id: <20230816164435.5149-4-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM7PR04MB6997:EE_ X-MS-Office365-Filtering-Correlation-Id: a9456e09-69d4-4144-865c-08db9e782c33 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k4c6u7Dlbci3mKmy29xlYdQn+wUKbZoOVJSyhOBGEx0ta9+p5y1Z7MkvaWxB5yYa0Tjpmu06I56NA9UhsYIPWqy7YktPhnX7HPAVBnFdtYplVOZFgL+jhweAfZhUdGRa+jsP54t1zUkdItQoOnEI6mCaXK7bYba0Gu/c8tYjTkaOnEuXzDGERZoaXq+XNN6ICc7fZNQVIkaSereiIm531sJ6tmMTyKkTJEnofj29hrtbqQiZmbwdliOnhXIbtjOKTiL8+d7hq5VT0tG49fe5wTgKJgrztj3Nb2/4GacexXxSY6wgEEFV0PRZIyjtUSk/v33amevPjW1I5uFz+EyoJSmw6oCPcFt0foXrlJ8bz8d/Z+Ui/1R3A70uxUTwnr7GoKA54vzYk7OgCbe9FLtCXsSytmEFbNS/8/GX76toDVr9m5rvuxy/4FJLDax+xgiJoCtQFgtzEWucSRV/UjingGMZLYJcRf7pdljgQJYzctqrj5OuVIhwUi8Z6hCxm5O0rfDxORyrEp2GE8dly2qjanTxiF/a5rwI00k/8pl++5u5AREywOjpm/y6ya4UAHOn4YEpjMpKSRsvsog3piIymik5fXyefwMvdfqqp0X/pXfcRYMl/sc4BIjDRV3PXiiA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(2906002)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2Aq758luXeSrM7nS3yp9eBA3U9bj2rRcZZzfu/vLN++rJe1KjOv+fDYIEX9LIz8kumRuK9yR1bjRX2AKrLg43LzU+yBqumDR3XOvn5M1SQotznF/+96pEfzQiazLVMh9DIF1dgwG3eEnuZ1UrQc4kcCODtF9cfrT4DYBhqqKkBanhmo0h2HcS/QDHTDq8z+eP6DRRqHbQQnbW0CmPj86JC6wOt9cbAeLj2dYDZeUY9WdZK8lzMNjYh51rfUQ/cicYPfQn9hBQcugMAgvG7/JLw46TVxHoW9qKHm3MFs77RoYbnYOCq6Nq+FpxFG0LPAUTECDbeu5T+1U68VxSBPGAguh7P6ER+jhV+mo71aWc8rCGGqrQHvahyO85quH0nQexT3OSY107CTqf44A57Fcc001kvNIsJm+eQ5tJR2PBjSDls5+enpZktoRBvW2GGl091ZYpZkYl0v7T9BwQSc3bj1geE+gz0IcG0BXpS5JgFv0XXEaV9ilnKaLmYu091HiN7aUAAU58GJXzwkccCQdqY4f5rlilfiHHpYa8Jm1VER64HH+4+phXtxl7uop/gGaze1Su3eSnTJJ89zIi/qoNgwm+OdSQYHc3+MMlcx/PicaWWfFe2QDhA3KTtFgqxzOUOH0+OdGWbvUesS9FlFMK/Qr6pT1Jf5mwrbj0jw0xRukldd6dDJTZqLeVBiL0ZGYXP7q6QouFus4OxUikOnQq7XnuHfQnEtYhxjpQfM6P2KMY1m6op5thqNO1nLYCr1wXvwMzOGD4S69hJiQ/LPXA6n4kJ6FL1ugoEIsgi64QPNVKQrp/2x3buNy59zAOs0Tq014SlD2cGbDLR6ZcXez5LG/w6F9ZuDilcn1lZM0mlTrs4RWCJFZ8qR3sG/WwkiEOehDY8FvT609L5tfHd0HFnQYq/Nl58ymVaib2dMhFx6hmlDXboRB6q6MO+yozNEgwjLxx+OSCgkGYJW2Jse/f1YsRSKSVijypnL1OZ6l75t9M3VHx4AskgAGCwavUv4C6HPK6VgMbc4468pHB+MWWIzWdeprx3YA10G3g0eZKG7qx2cqTITV13s9HtzDBmj8InJ/e1oxAxPCFUMGOAf7isnAccCBliPhBPy3kCXH9Rxl6TtxpISofZSgPiTMt9DO26C+qmlkE0PrJujXD4Izneo7+4z7ajgxFfbUwGofxewDHHEb/9xnnHcimEEXvBwwmiUBfRNetJaLYw4lFZ4B0JEkiIp/TL4eUo3V2bAQlskwujPz6ffmD1XM9ocsjq2EiY1MxhLQo7KlR8rETEuUTBr04H7s/AEeO7jK6B7hMNbIyaAsompTiVL02t/zfmIeeisLipH++aO69rw1thRCC6M+PhetMKJFazNyAK1G8i9jEzShvPGW3qHDhwW+iAea+ugsrkEpkzl+viPDwFAGlY5SHzM1EiML+1i6OGvU9jz8qYZi0/ReLMZ7t6TIGqMUVxJGJfrTYAZDjaE+sgRiuOHJQO8ljMAt8I0mCotQsSSMKcrTTbh41ZMF5iTJsjkKwJ0cfiRS00s+MfFH3XPCq1oA5rg+A2bbpquZExags6roBLU59SVbOSqoUYny9wpV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9456e09-69d4-4144-865c-08db9e782c33 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:17.9540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n6XlWdYJ3pXoQ68bUfwz3Erq3YNue0KthYDIHwZ5qnfN/f1PAmcQeNgPIEtxVxaMrkX7dZcT/7luv2IX7SV30A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6997 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds the possibility to register a broadcast media endpoint if the controller has support for ISO Sync Receiver. --- profiles/audio/media.c | 42 +++++++++++++++++++++++++++++++++++++----- profiles/audio/media.h | 3 ++- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 15c64c8d6..66f512e00 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1058,17 +1058,21 @@ static struct media_transport *pac_bcast_config(struct bt_bap_stream *stream, struct media_endpoint *endpoint) { struct bt_bap *bap = bt_bap_stream_get_session(stream); - struct btd_adapter *adapter = bt_bap_get_user_data(bap); + struct btd_adapter *adapter = endpoint->adapter->btd_adapter; + struct btd_device *device; const char *path; - if (!adapter) { - error("Unable to find adapter"); + if (!adapter) return NULL; - } + + if (!strcmp(endpoint->uuid, BCAA_SERVICE_UUID)) + device = NULL; + else + device = btd_service_get_device(bt_bap_get_user_data(bap)); path = bt_bap_stream_get_user_data(stream); - return media_transport_create(NULL, path, cfg->iov_base, cfg->iov_len, + return media_transport_create(device, path, cfg->iov_base, cfg->iov_len, endpoint, stream); } @@ -1238,6 +1242,12 @@ static bool endpoint_init_broadcast_source(struct media_endpoint *endpoint, return endpoint_init_pac(endpoint, BT_BAP_BCAST_SOURCE, err); } +static bool endpoint_init_broadcast_sink(struct media_endpoint *endpoint, + int *err) +{ + return endpoint_init_pac(endpoint, BT_BAP_BCAST_SINK, err); +} + static bool endpoint_properties_exists(const char *uuid, struct btd_device *dev, void *user_data) @@ -1351,6 +1361,17 @@ static bool experimental_broadcaster_ep_supported(struct btd_adapter *adapter) return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; } +static bool experimental_bcast_sink_ep_supported(struct btd_adapter *adapter) +{ + if (!btd_adapter_has_exp_feature(adapter, EXP_FEAT_ISO_SOCKET)) + return false; + + if (!btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER)) + return false; + + return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; +} + static struct media_endpoint_init { const char *uuid; bool (*func)(struct media_endpoint *endpoint, int *err); @@ -1366,6 +1387,8 @@ static struct media_endpoint_init { experimental_endpoint_supported }, { BCAA_SERVICE_UUID, endpoint_init_broadcast_source, experimental_broadcaster_ep_supported }, + { BAA_SERVICE_UUID, endpoint_init_broadcast_sink, + experimental_bcast_sink_ep_supported }, }; static struct media_endpoint * @@ -3245,3 +3268,12 @@ struct btd_adapter *media_endpoint_get_btd_adapter( { return endpoint->adapter->btd_adapter; } + +bool media_endpoint_is_broadcast(struct media_endpoint *endpoint) +{ + if (!strcmp(endpoint->uuid, BCAA_SERVICE_UUID) + || !strcmp(endpoint->uuid, BAA_SERVICE_UUID)) + return true; + + return false; +} diff --git a/profiles/audio/media.h b/profiles/audio/media.h index 1de84a8ff..0eeb5746a 100644 --- a/profiles/audio/media.h +++ b/profiles/audio/media.h @@ -22,5 +22,6 @@ const char *media_endpoint_get_uuid(struct media_endpoint *endpoint); uint8_t media_endpoint_get_codec(struct media_endpoint *endpoint); struct btd_adapter *media_endpoint_get_btd_adapter( struct media_endpoint *endpoint); - +bool media_endpoint_is_broadcast( + struct media_endpoint *endpoint); int8_t media_player_get_device_volume(struct btd_device *device); From patchwork Wed Aug 16 16:44:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6D42C04FE1 for ; Wed, 16 Aug 2023 16:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344900AbjHPQrB (ORCPT ); Wed, 16 Aug 2023 12:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344915AbjHPQqi (ORCPT ); Wed, 16 Aug 2023 12:46:38 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2048.outbound.protection.outlook.com [40.107.241.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3151A1BF8 for ; Wed, 16 Aug 2023 09:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X72ItkZXdip3D3FG3nBWxxKq8ooFX1i4/zoe6eC7AqFv5i2JWm2slCAze5BfIf/H9rckkczXrUCPjpUtLWdML4ZzD2rzNdM5ucCz2zV8KHXIZZSYnnvmx6tUAWAHsvFNM7Fp3ct32AFqBZuOssPTMSdA8rg2cxzKyFEzvtiT4dClMxrUPoMy4RGj+OCb5v2taYyTzHgZq3RMkPaCjwoCDavbw+305VfaZBThEos7I7l766bDE6bJxmdE0it8PAICySheQkI1I1tilnU0VMHNHonE3/VukpeS2mS6xVYcjEZQwlgBQwwIphLiBYf97d/JkhdJMMO51ZHoKg5Ee4VVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4lfoXCKm4PEewWvh3Jtf3gJ04VVxfTQiLj25E3S0A/g=; b=DS+oKXvS8USKA3I++jvHGk/BXIDkTkiiPXJwe6soBfg8dBL7Obhqv57wCKGOYkDzQqcWe5DkXH4uRbu7a7kXRLvWxoocs/l1SIYCh7l9xg+UHPI1xinug+4VCBag2K/ZMnWBveDgPMjNn4uxVNJ/nXHShDMAqhHkVRzf5DAn+IkhLdC5EmUxaeIArlNRaGUC/ebfxDc3/IN7cPRbfQroSbkhLEcn87+jWgKNpV5tG0uq5GqKQszm+S+xXBrJb/vQeS4Um1xldlq2HZAoAh7Rv1PESFNDaaxGvCWCSssiNA2/zpyI8bryQ+SEbgZ0chWUW2hJmLxzZNrZjuFYDaHawA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4lfoXCKm4PEewWvh3Jtf3gJ04VVxfTQiLj25E3S0A/g=; b=RIlhXjG5agrGZtUvUkeTE0nM0oPSYC5FU/FHlLf4JmgeWDKXj1rmMpsnX/ZRCC8jBQ/ykYvxS4/j4UOvQZOBvsB3VOk7AoAnkx2CpjqvZewb7axbr0snhpsUCfLKkYXOdzKMeap18jlL36cJtJmvUaSTpKKKD+c5t2fKQLhsOBw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM7PR04MB6997.eurprd04.prod.outlook.com (2603:10a6:20b:10d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:20 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:20 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 4/7] transport: Update transport properties for a broadcast stream Date: Wed, 16 Aug 2023 19:44:32 +0300 Message-Id: <20230816164435.5149-5-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM7PR04MB6997:EE_ X-MS-Office365-Filtering-Correlation-Id: cd2f4c63-0c64-4d89-27e7-08db9e782dac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QuwF9EQEyovqNjMHBqM2jkF0DJEV26mipLATRisdwzDFezkQBOveEYyKz/1ztOpLC97plvb86C9LoJxLmUUyZsiRXLl229Yp71qVXGjTqbZd1sIhhp+kHZroa8ZMPKmWU1uPcd3EWRNsp/Y8bVujhyWoQK/i7V+9Q6M6Sb9Iy32NV4C61CaCf++3SGSV1Ls/yPUnTRCv+LvuGAhWciMUhkEe5ENUDaTR1gWfdTX1/597qri6WzawuE4TWumhFYQzgmToNnpVYwug4a6xvaYSL3+kZmFPMi+fmM9SUgFDryxnTKSadORPxib1R4yov02bTzFjE3PyKtb2EaKrWXANf7H5LOt1ecBz2A3ht/Os29GChGtXrDSp4oUVylfO7845D18TPm/sLphPk6o4ptsW0Tr8WIbwW/6o31bYFoFD6uPRtqXpfUo82YvTADDMvXoJRO4DNpHPraQryHlFg7bmk2MumVCTXGqhfrJfOu8AFknU1mTaJTRYstmv8a9ACunQ9026Gns9M66RfLIiK6GuOQRZ5sg1x0d6gaDPuz8Se/FCI3Ft3E0Z8H8EabD/BKNV3XJYI+vRRvcfeDyDrQDhaYcs2Dk3FQ1J5pwPYpCK8UHpCvx8gfAQUQB9UtPJ4EIM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(30864003)(2906002)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7g/+zZjCKn5+ygmwLZBs22O46ELmmxg72zPEIm/U+W8GIWVvrAjNMyQw97uRl8XBcrcH3myVyEeQG28MnV9YXqL6dRMiAjdqI66GhbijRlzLdE+7gCzVj4H/kGakUgqpvXoDlZ1tbNcJJfOXet1mHYSWSXef8/HV/vsvLr37KKgcmCRVfAkfPsYeV/+htCkdIQlXm2bmqiKEjHoKooVd2jkM/ofB3vuM3wt8d7QZ9aaypJLoTXtsdBpDTVUcNd53dVqjOIdpmKRTkFXQCq/7BkCcPLkazV2DUNCCfzvF8gXD5aMdV6XGEktDV//bIWOTRpT1iCK3p06akmDIg9Lw8X1zYUmRyWH0wwVZ8ebi5E/cPIDq/9ay07KbHqSZ7JgsD+B8YRSznzAIsrmczHtKXHAnYTcuDFdNqDhQNj1y+PvGW0r+HcJmBZ0rnSPed0VjA0fkSM2aYJYPriDsVBGXKbWMUtN1k/HQZ69YvoN5clrCkTgbiAfWx4FivlKOsdl0fVBBuGkXwFF9JrBc/RNdVIPlsu7UGnDuUo+ibgh9DqMvvJnio5P32FH2UpzzPIno+ECmAnWDO9RSyWozkp0JA8OAQoc1qtQK37korb7pb3Oh+k2DcD2fbMpZEb7d7zOr56ggb9/rHmg6oOnI0rLH81t0RqPupqPfA5ZTYXsgLTI6LUNIsafPjiaTyWJhaYTIrkoWISx8Ley5hLPLrRVOn+MmzZXZ2dcvICnlXd37qMhWntu3dIHCUVQZVysX/4CfxcFnT7JQTrauqRkwuw6I5x0dmueGU0tqHHM13kxE5/L1bwH78jC+UGFh4PfieplsQtvtREl3kgVq8apOP/TaZP9wh6b3tY6BCgt+E8OrA8hi+6Bv+4xzx7zkU5gI7hJzzuOJbwYtIRCcW2Ifbvgc0VGMped6ew6Twk7liNUO5Nx3egFOXU+Urc7qmTYXvLKmPJEtecayqQweBKVYsAJ8V+h/OmAD40obPts/ds1A2HuYpKDtRM8FDW83pmm3Drt0JAfBh1i/DEwyzkXX4RHaz/8IDjGTn0Sd0P90S59dHzP4HgLoSQxfJdCL5dYexIEDZE8ou8v3jzcRTWOnxCaH1eFnI1tWQFY7bjUphuXgJh5neXbUE73MnjKmZlHD9ZiD6wEa+hiol+a+RgZYRCwfFsL7mcI8liFXh+zlyuepVK6+YfzctkBNJfSTfSQXAtbyK6+WVpS1OL1o1gpjHPiBtpo5PtBRtB3Qf4qhQT2ulmPOUDlI1gGHaDMZj1J8w0F3UFU8ajWUZUo8qRN/IxO85y0gDRdATsZls5fab/D4Zek6w+8DwXJrS731ThwB2TV49aiZN08DKPfWXq8vz5uq1jwjIgdVwKfsYDb0gdYDWrxgFcJUGQJkz3L03t675t5hHbijK1KUpgBJqzxSqGvKImz1VP6NkXaeW6wuJzS1w9SlVfQ9srT070s8S6bfjLdTSz/VxddnR9aqb/YVEACfPVx77PTSWsoq71Me9Nwzg0M0ma3f+vUzLtgzTLJ5GMTZ2rdw+rkiwq1u/7D0EEdIbOqPGkQGwl1GUeP/tVllHUgzXNgMXz/rHB55+qQNLrNL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd2f4c63-0c64-4d89-27e7-08db9e782dac X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:20.4271 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jpUJchIdnSCnc3D3mJpRog9AvOva6Z0Fu37buWFRfRKtQjmpTiIOusYZXrXzePls0sySpvuThrJ7xw4YfCIxvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6997 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch gets the QOS broadcast stream parameters and passes them to upper layers. --- profiles/audio/transport.c | 251 ++++++++++++++++++++++++++++++++++++- 1 file changed, 249 insertions(+), 2 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index cf5662d1d..f7a29ca83 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -552,6 +552,8 @@ static DBusMessage *acquire(DBusConnection *conn, DBusMessage *msg, owner = media_owner_create(msg); if (!strcmp(media_endpoint_get_uuid(transport->endpoint), + BAA_SERVICE_UUID) + || !strcmp(media_endpoint_get_uuid(transport->endpoint), BCAA_SERVICE_UUID)) { req = media_request_create(msg, 0x00); media_owner_add(owner, req); @@ -853,6 +855,9 @@ static gboolean qos_exists(const GDBusPropertyTable *property, void *data) struct media_transport *transport = data; struct bap_transport *bap = transport->data; + if (media_endpoint_is_broadcast(transport->endpoint)) + return bap->qos.bcast.io_qos.sdu != 0x00; + return bap->qos.ucast.io_qos.phy != 0x00; } @@ -868,6 +873,18 @@ static gboolean get_cig(const GDBusPropertyTable *property, return TRUE; } +static gboolean get_big(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.big); + + return TRUE; +} + static gboolean get_cis(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -880,6 +897,18 @@ static gboolean get_cis(const GDBusPropertyTable *property, return TRUE; } +static gboolean get_bis(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.bis); + + return TRUE; +} + static gboolean get_interval(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -899,6 +928,9 @@ static gboolean get_framing(const GDBusPropertyTable *property, struct bap_transport *bap = transport->data; dbus_bool_t val = bap->qos.ucast.framing; + if (media_endpoint_is_broadcast(transport->endpoint)) + val = bap->qos.bcast.framing; + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); return TRUE; @@ -910,6 +942,12 @@ static gboolean get_phy(const GDBusPropertyTable *property, struct media_transport *transport = data; struct bap_transport *bap = transport->data; + if (media_endpoint_is_broadcast(transport->endpoint)) { + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.io_qos.phy); + return TRUE; + } + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &bap->qos.ucast.io_qos.phy); @@ -922,6 +960,12 @@ static gboolean get_sdu(const GDBusPropertyTable *property, struct media_transport *transport = data; struct bap_transport *bap = transport->data; + if (media_endpoint_is_broadcast(transport->endpoint)) { + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, + &bap->qos.bcast.io_qos.sdu); + return TRUE; + } + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &bap->qos.ucast.io_qos.sdu); @@ -1040,6 +1084,121 @@ static gboolean get_links(const GDBusPropertyTable *property, return TRUE; } +static gboolean get_sync_interval(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.sync_interval); + + return TRUE; +} + +static gboolean get_packing(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.packing); + + return TRUE; +} + +static gboolean get_bcode(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + DBusMessageIter array; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array); + + if (bap->qos.bcast.bcode && bap->qos.bcast.bcode->iov_len) + dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, + &bap->qos.bcast.bcode->iov_base, + bap->qos.bcast.bcode->iov_len); + + dbus_message_iter_close_container(iter, &array); + return TRUE; +} + +static gboolean get_options(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.options); + + return TRUE; +} + +static gboolean get_skip(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, + &bap->qos.bcast.skip); + + return TRUE; +} + +static gboolean get_sync_timeout(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, + &bap->qos.bcast.sync_timeout); + + return TRUE; +} + +static gboolean get_sync_cte_type(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.sync_cte_type); + + return TRUE; +} + +static gboolean get_mse(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, + &bap->qos.bcast.mse); + + return TRUE; +} + +static gboolean get_timeout(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bap_transport *bap = transport->data; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, + &bap->qos.bcast.timeout); + + return TRUE; +} + static const GDBusPropertyTable bap_properties[] = { { "Device", "o", get_device }, { "UUID", "s", get_uuid }, @@ -1059,6 +1218,17 @@ static const GDBusPropertyTable bap_properties[] = { { "Location", "u", get_location }, { "Metadata", "ay", get_metadata }, { "Links", "ao", get_links, NULL, links_exists }, + { "BIG", "y", get_big, NULL, qos_exists }, + { "BIS", "y", get_bis, NULL, qos_exists }, + { "SyncInterval", "y", get_sync_interval, NULL, qos_exists }, + { "Packing", "y", get_packing, NULL, qos_exists }, + { "BCode", "ay", get_bcode, NULL, qos_exists }, + { "Options", "y", get_options, NULL, qos_exists }, + { "Skip", "q", get_skip, NULL, qos_exists }, + { "SyncTimeout", "q", get_sync_timeout, NULL, qos_exists }, + { "SyncCteType", "y", get_sync_cte_type, NULL, qos_exists }, + { "MSE", "y", get_mse, NULL, qos_exists }, + { "Timeout", "q", get_timeout, NULL, qos_exists }, { } }; @@ -1341,6 +1511,77 @@ static gboolean bap_resume_wait_cb(void *data) return FALSE; } +static void bap_update_bcast_qos(const struct media_transport *transport) +{ + struct bap_transport *bap = transport->data; + struct bt_bap_qos *qos; + + qos = bt_bap_stream_get_qos(bap->stream); + + if (!memcmp(qos, &bap->qos, sizeof(struct bt_bap_qos))) + return; + + bap->qos = *qos; + + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "BIG"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "BIS"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "SyncInterval"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Packing"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Framing"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "BCode"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Options"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Skip"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "SyncTimeout"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "SyncCteType"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "MSE"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Timeout"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Interval"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Latency"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "PHY"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "SDU"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "RTN"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Codec"); + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, MEDIA_TRANSPORT_INTERFACE, + "Configuration"); +} + static guint resume_bap(struct media_transport *transport, struct media_owner *owner) { @@ -1493,7 +1734,10 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, if (owner && owner->pending) return; bap_update_links(transport); - bap_update_qos(transport); + if (!media_endpoint_is_broadcast(transport->endpoint)) + bap_update_qos(transport); + else if (bt_bap_stream_io_dir(stream) != BT_BAP_BCAST_SOURCE) + bap_update_bcast_qos(transport); transport_update_playing(transport, FALSE); return; case BT_BAP_STREAM_STATE_DISABLING: @@ -1503,6 +1747,8 @@ static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, return; break; case BT_BAP_STREAM_STATE_STREAMING: + if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SOURCE) + bap_update_bcast_qos(transport); break; } @@ -1631,7 +1877,8 @@ struct media_transport *media_transport_create(struct btd_device *device, properties = a2dp_properties; } else if (!strcasecmp(uuid, PAC_SINK_UUID) || !strcasecmp(uuid, PAC_SOURCE_UUID) || - !strcasecmp(uuid, BCAA_SERVICE_UUID)) { + !strcasecmp(uuid, BCAA_SERVICE_UUID) || + !strcasecmp(uuid, BAA_SERVICE_UUID)) { if (media_transport_init_bap(transport, stream) < 0) goto fail; properties = bap_properties; From patchwork Wed Aug 16 16:44:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF8BCC001B0 for ; Wed, 16 Aug 2023 16:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344867AbjHPQq3 (ORCPT ); Wed, 16 Aug 2023 12:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344894AbjHPQqH (ORCPT ); Wed, 16 Aug 2023 12:46:07 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2046.outbound.protection.outlook.com [40.107.247.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B53273A for ; Wed, 16 Aug 2023 09:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQojW8Xycxgku04tjBfzoDsEJC+0o10UddoTLSQMk+iq6GoEnXJ20pxZRl1l+mBgTlOe4WIs1EpjvOA6Ol8VHBx3ulsv7rDVdXRYCVg+2dc8HFoQD3fA+UY2PC+R4angUiaslZ3DXqmrbdOqtJogEjI9C6w2nxyyZ8zOfExdeg5AGRu9l3Oe4/drGTvMcNCzVJ6KZoYySU1+JxlnVo/wBkleDgIAc5H2EJiWzk/Y1hU3WKKFNaC+1rF10+lGwFGkNhW8U564CQF/3CA0l/RKGaDvWcAfXoP9TaA8/ikZF/zVHdFSyR+P9BXN33ziqOv/+u2D6mRX64I5+ZgUQE9lvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s7uI7w84DbYFZ/J8u/XljhtPStzt14SCiYCB0JcpPZA=; b=a7uOXfDHeM9Rp3etMsUB/q4IMvOWWlimF7PdyjyCtNldatVJfq5F4NQQBM2QEnV+B6Bm5gPj/fOnyRvy00Z5bcndpJCYBaTo4+T7T3wvIVk9iaI8hqdhkuefmqJcmX4K7ifv+iZnHnbUXt/wSZ+jOTqgF0HzoXBToi5sduxvvV7HjNV157gv3CJ3gV31z203lkCGZYr8r6Q2jC9HbuX42E48DbJMod1OYW/08nmndXXqiFbFW6FTW/jbiZUeOsR64LuW6CbHvM8u6d20RTyxDQrbtPyeIyyNs4abHxGELdRKECS7on86h7fcxKDiOGAMisPLFMsLpcbsjtqrJicS0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s7uI7w84DbYFZ/J8u/XljhtPStzt14SCiYCB0JcpPZA=; b=O7ki+nhibT+xnCUzNvFb7k5fSVqBNtAso0mEAKgz3FzJ0wYhGQBmEpMMSJMaegTWDiKTHx67pm/0mft8XXEewWSrWM+pLoYEqrUFGQWS51xQbtN+eU/q0EiKKC3JdKlHZWACbhjeyavwus8kaNlcpBSSoXoY1jCK3gKrzwAweUY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM0PR04MB7107.eurprd04.prod.outlook.com (2603:10a6:208:1a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:23 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:23 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 5/7] client/player: Remove Broadcast parameter Date: Wed, 16 Aug 2023 19:44:33 +0300 Message-Id: <20230816164435.5149-6-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM0PR04MB7107:EE_ X-MS-Office365-Filtering-Correlation-Id: 38aba843-c9ad-4ec9-4082-08db9e782f1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B52VRhdYZOiKw5uQPuG0GChrvYf14fWUHocx1+cOd+Q5equVjecssvymkP8OREXRoXaWkoRdL/bULbQnUcd00MTVbRmkcXF2fLZJiz2tF9GJQSOyrjdWi0GLET9tjQXkXQHFNgx6GrZj4SpfNVFXj/CBiiwH0d41u4QVsZ4m4sUvArcjEa5C1p0yPo2dqoIQUrwzYOZt+qtG8JCEFXMdGo6cVQuOJbNfLsB12am9OaOxm0zFHn/D5r7G1vG980AnGzF3ZAG4NgfpAM2WI8DVUTtEmpXPtGJg7Z1ZCFbzU2YgJuWIaolzLO/bekKPhOKdNBV/KMN31hlnlymgHamSIl5kLNL2tNf7/WLg78wHzkBDdPg1b7Uym0MykonnJWeHPfnKP8ltIvcDrqqZ6iVM4KRZqd8Aj1MDWbNxvhbF+tIPDjTizyTXL8EK5NiM3Gm6CkpfFcfsaNCfM66rfGllUieVtumEwQ7OYYQkK5d5zVZ+q7E/iIwAfUNRRzEorCSXqsDY+VpqG0qDp9OOtLPdLk8N/s4o9QCTekMDUtgGeGqhJCVMKEldKvyMlotGYF+uhN54lh8xyn/PMjTn9qRLmduRbBIx/a7F9Z6ccbtTl4P9/909y/KRssWScw8ATRwa X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(2906002)(4744005)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gnux/Y64kCfMXoFKQ+RUo+Ft2Our28Hush2wai+rlwpienygbglt2b2hT2X3OF9m6RR8U16tX+z+6TLIIGuKR7+NTvU+wsywuKxNFaoM9HJ+DjMANmd5iOc1B29JyfzZ3XxIGNdqAGGh7PM5JfMrf6hoD3X+Ssc7St2TVt+EvjMs0r3udqA6W85BGdxSPMqVY2tRdSCLZ4mG8IOVIQAo2EwmfoP9dgdHeo6zFoYcDc83JQsBQH7dTq2ZZLRARLzQCOa0Epu7rEe6B3XWwa0ErOiPB6d5MvPzbOBY4txECAJtt8wibiQV2M+5P1+tn6J+jkdlU+F/n54JfrMcj6ABSxQecOudBrwcbhriKIVSSSrAE7w2nfb4RApxnvwx8OTLFctdVec79em+3kesgqBkWGodgzdZ+c7IAWc08Z9WyObfaLUIPaBxwPVuw6kV5PYcjw//bjG+s+HmvzJmVt/UgMp9VfZK1eaJLK4dT5CgSW7HjCunma+svvr8pKojuSGYFQh5KIOFkay9GkCokWK/Jopt7z0Dq6e0UM1JzYX2p9MvX9D8IFf/wh+HPaq6bqbmNrVS9T9z3DdmzyUJu2u/rW+D/E8iQWkN2u51g17zDOFSmM4AZ6JAXobV61uo7DqGUOJHwqCn6j1luAszJ9TmxaljZdgwL+8OUoRgqGG3x8oerkhwEqU7Gb/PBVI+jzvLXOCdMMupsB4i169hxEjEeZy+Wp2e0OlUkTwLsbEZbkVv84ZEqmeW1xN9UrOJy7Qu4uHIheyPMCS/Ept7+C+Yj/ghNY1BMZWPM9tD0UpkmF0URkkYGd5wXG1SMmyX1/aKsDJXqbORa0KW6z37aIYb1Q1YTTOjSVjLe1xxm7LTEcqsnaO5DUHviyTXk3ruIfA0PvkQq9UZdAO17n9yAZW1rhHktpNgDwTH8KfJ5t0WrRIDVkI9Sp8LpaCtoFm49P+FP1b36YGDNjXV4Sf7afsZg3FoXoegKqSKSWuwh+WUnXLRcE3cn7NlbN1dPRLXujzzw88no3PAhR9V54mRLEJLaH+ef1jZ/s+RMgC615n146M/URz04WhhRFTUvfr8+6yW3vPfG2dNE6na76NzFqlBGH+9VMLOlNAW9hnjvSIGRB+t4d6ho+/w9WdhoksokLPRjglNbrt5bqOESpPs+0KoGecND5gOaQUvxhFmGJ2k6KSghQEQXUiHUism6cxQb7xFEWSXGm43wx3UoUy087BxU+5/P9FY2l2McDJFGZklrDXu332r8D7mgFN2cg3zcHXhnCqIZQphreakcZuYtypRvnBfQ4kMUZLcyBAX4GuDQ7CzVJS28WzQzSwuXpp3VKt+l0H3noRhhK7YD+n7xTx5LA2qFyvszVzwS2qHU3yKQ1QOz1D2qdvxMxLi1e7C2TLDgtAFDu5NEbQisQGMVb++GBV3UVp5u0ZVERjfBKF3XJSFG2REIUENDYQQ16HGrUZDLPjz1iKBs2wgaUx0jiceSmtYQXBMLcUfNI6z2WgfFQmFM2zx/VradlwskTaUHrFoQy+xY6A5L24a4oG5qRKsnCM08kgBwgMN3aSgZdQqDM8PRwVS6jdlBioJoy3QlpeT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38aba843-c9ad-4ec9-4082-08db9e782f1b X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:22.8865 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: soc2PNWCUaGBvvena/JVEnMBvj298qctN8UiuPXlkkh+5NQYMqQqkWlJJKk0G4Win/2tf40EEuf2pilIA30Pyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7107 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Remove unused gdbus parameter. --- client/player.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/player.c b/client/player.c index 3611a8dfe..38590405d 100644 --- a/client/player.c +++ b/client/player.c @@ -2297,9 +2297,6 @@ static void register_endpoint_setup(DBusMessageIter *iter, void *user_data) bt_shell_hexdump(ep->meta->iov_base, ep->meta->iov_len); } - g_dbus_dict_append_entry(&dict, "Broadcast", DBUS_TYPE_BOOLEAN, - &ep->broadcast); - dbus_message_iter_close_container(iter, &dict); } From patchwork Wed Aug 16 16:44:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F2BEC04A6A for ; Wed, 16 Aug 2023 16:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344893AbjHPQqb (ORCPT ); Wed, 16 Aug 2023 12:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344959AbjHPQq0 (ORCPT ); Wed, 16 Aug 2023 12:46:26 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2054.outbound.protection.outlook.com [40.107.247.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88DCC273B for ; Wed, 16 Aug 2023 09:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bn3Ic6dFS6YeiKlSosKkLPi6Ar/WjK+N1OgBXWaVyBmP/xISRYh4RjHM7A0HzzjyXhV5OoQ6hJX3Ejc09xXyoryvf/7hLynAgvwh2Vj6gx/YTAi5FZ4aO/7LfLZ+1Z2tjnL4uBHuTCChKCgaQ571ST3TLT4ENEJW24Xi8tBoL7/PvAOe/fxfKnCBQOe1ZWMS7OFYdnPs3RdAgoyQYLsu8Hsc09fldtGvNIkiYIYS0cePSBYuabxumY+J2IVH1gxFazY7tv43SSPFY5WXGzhANM6tQyIPnM4VeA/1Sy3Pdx+zOp0l8ZILpGkh4b0PzSiWbfrx71ehxFKdOLusXrd9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G8CflWRguBHrm9ZvGzSA7EQQvh5p3bv3himHSc+dd28=; b=Fe/RjVIp0HdqU5R6G2gZpexR3ItdwgjwMS1NLqfVEqeoDXREodi2Pd28svyJI7DsATZ+xnufk3YswuWy2iFCcUtm6eBhiTl8DIHDKc1X7vjgl0AHwcIIer3y0YHsxfi7tuBn4w2c07AG5oypxQOZW3ENCtWEEtG7xqk8EXG6/nSsCTV8X9kENdf/uE8sI28jY0kraQFRiX4t62CfR22kNdmNswz0UMkhx1VtA4VQwEdCgF0jYLfRxpoV6lAa4NrDrVmjs/XNAbMW4kjsaBINaU31QUbPX4miqXywIxppOGG5vE7hqCn14RC60rdGrt0awreoUI4saHs2SlV+OBIZkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G8CflWRguBHrm9ZvGzSA7EQQvh5p3bv3himHSc+dd28=; b=hoSJtf1CtHiw3GLBfypDcP9aQ9zOjNI15/VvhSqsJqR3AWJXuylbwMorNeLiN2bHtNSkJ7zHPv8nncJfR817hiOiIZO7o9ubpFgqOfC+N3irp62JnX85rJYYIk9wf40FBSDxE1E08QVKNlSGrVkcb9v8ukRBob4n25HmHASO0MM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM0PR04MB7107.eurprd04.prod.outlook.com (2603:10a6:208:1a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:25 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:25 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 6/7] adapter: Fix UUID name advertised for bcast source Date: Wed, 16 Aug 2023 19:44:34 +0300 Message-Id: <20230816164435.5149-7-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM0PR04MB7107:EE_ X-MS-Office365-Filtering-Correlation-Id: 32c06ab5-dc43-4d44-f42f-08db9e7830c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jG7/mb65UiG5nuz5VjuipxRM/OVQ0MSv6n+i6uD/m75XZgVlQbwDWwZpgWtdx1v0zk5inFMLQg8BcRIMNGgYWzfD3DY1AmF5swBMw0nXClsa0tlEmovcnFgSZzZrYnccdE6ZGPMHKhoE/Of85s2PeCLj3nAQI2+WAwYG29pN8nhW37H6z4/uVCtiyPuDQMKsIOQEjK+vHaT7HunuKap3Ud9+M8Bs80fSorwFK+/f7X9ym5tbCN+vm+KMHrxAMlUuAu/bQfBDYKpn6f7SgFutvhHZXMMmbbqCyLry4//93od8Ve3jCS7oOTr3EEoHYkBInBawiKPzY6AL2Ag9taud+MsD+lKVq5ZCd3mgo8kQnotJ+mOOXzjSCpt32Ysx6XZnVwwfsLnG2SSwxuYUyLswUzHEmP+jAYk/T4u1WFUzqJpxfVH6JuVuIp2XGAvCqQ08ME9VmaKRtpprmXv33bnpeSo8MJW7oQWq8aX4+THhi/8FpB3n2y8ESL/NH+qNpEQcM2UJM4V2WO4fZ9bXw3uXSv2KJvSlU+S2JiBTQq6+kTmzTw1p+5cRmThWkumT07oQnBy9AujYZ45BjzRogGNINrv4nGNavdc5vzkRoiqUVxRN+NpcmvqRfHQvSidymMFG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(2906002)(4744005)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GPkCknWsAaaM5KGg2NkGtHQs9pOGFg0WgZEtNC9i4LHPwNC91q/LguAgy+ouo7CBvuLO7coRWABmCPpAbWJeysp5KTyFbTSPSBcZl3dBuCIEYZSUaSq7nBxQzIjhKqHeUR1DH5hubBCNhxnky/LemKpmk+iSeh0Ag7v+3hlUq4WvShetHX2Al0zO5oinhBa7qtIf3frdZPJVh4HisRUlOfUzvAVRt6XluxYYAzlWcw2XOmu/JIf4rNJp7hSIYpqHrHchCtDWGKjcybEpJR/Btg+iLJ1Wk3HnhVR0hET4vOdZmq+bDn/hqs90JBmCRLSUalWuROsElUm6D2Q9CsRiJmAqoecabc/D0A4R8ekj7M2isWdZO7JQ0gj8X/Y2rqQFfBKRg7atHHWMlc5XHToy3+Qg/a8q6CXtfz5poIWJggwlpTv+0W00BJ5rOIjYOKu9w8HOZUl/3zMTRiD3hiTHyXxjFmrJ67+phcRqG78sKtqbDobCQ1eSPBW/04x2knPHpjbgcEPESLnHdEKp0vPtbplHPiSE7Gfvo1Ma8F8MHYOsT3bbAn+fKa+N0n0nXUn8BMUF4zXe6mTClcG9VNGCwLAew4UepbbyEV11/m+Zwbt9fdfPc+lzYURrKx4auN5qIFF3rRQGKNbEKiZF+wUWlsn8QnNtm6DzChXSF+obJtbd4TiX02ppy6swVXkgSfFhchUUlDpNTFfSDG1PUHANSJwPVpn8gk7BsPxwpG1hFUDb/PWAXFpZ7GgHaATmYlEEifGYt6ywh4dQFhqLCGh90rxRkbTS8YReYV0Q7TZwOx2Erh+jN0Rx6AwnAajat9qljGY0JuUg28/Yzua35IvrqTM2nlNgYSFCzqrLwxUerGHc4ENsfJHWzchaddsWHEXajrKYxiGcQq/DCa2eTymPBTrdx78fiSsZHy65CmAb1+jUxhGcffb3Ps6fpzNiYOihLwquB2amIzUUhvLuGbfEW6/zftUxRlppMN++pOKid73UltFYdVnmf8XK7Yg8PHxas6c/9v5cJln+GLG5Cv73xNUJ2WNh6X6sHx9lqaxjxaDH1EruzpM5kp8kLX1nYyXPyvD7WJW/0xVqWzMNLa1m/pbkk364xXE2eaxOYmgajt95fcGgXzh3No36logwAygt9ffV4QWrWLcThxjz7BPZw/EITEs1ImDykHgCqWloAmN+z1QcnkpwjiHmoUI0cYEdz0CDtYTPcV6hhC+KdeFrqxXSt4Azzp+f7JcyzCA3/91sdmN5v+2Y8Tkg5+qK+IP+gB2DT1qVFI8Asons36ARKc2Uh48YQmY5pC1YIpuGEDbA+UuxS0txsCdU/5/oZqnkQzZI6+SrpBIevUGCcm/rW/HeOf82e9/PXW5baOy1WQ1OLlhumMxKXTaNViW/P3wFrKz9J/XktB9wSADaAo0xuAhrrmt8uOM8p6PkPvWW6bfStGfsCnJvAFJXiKpqxrie5cvT7T6ldcQqSQyHb3GZ2IHfdpfFIjhQnPqXbpuXULdgxASW0YfbMbqiIpZSd3XPqmf3jUtQgcC7GsB3ZDG8nhstFw2uNPWhBo2zfAx7cJpGVaSkymXTEvPh8VoP6f7Z X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32c06ab5-dc43-4d44-f42f-08db9e7830c5 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:25.6871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OP1fgZTPTiNLOwteCf/7yjysVtpPcH5D+t0zjyMOraiE3IEiNyo22ydmVq6jyOKcqs8co5hnaswN1b4llW0aKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7107 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Fix UUID name typo. --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 004062e7c..f2f53d339 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -7155,7 +7155,7 @@ void btd_adapter_device_found(struct btd_adapter *adapter, /* Monitor Devices advertising Broadcast Announcements if the * adapter is capable of synchronizing to it. */ - if (eir_get_service_data(&eir_data, BAA_SERVICE_UUID) && + if (eir_get_service_data(&eir_data, BCAA_SERVICE_UUID) && btd_adapter_has_settings(adapter, MGMT_SETTING_ISO_SYNC_RECEIVER)) monitoring = true; From patchwork Wed Aug 16 16:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudia Draghicescu X-Patchwork-Id: 13355500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 804CFC04FE0 for ; Wed, 16 Aug 2023 16:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344846AbjHPQrA (ORCPT ); Wed, 16 Aug 2023 12:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236127AbjHPQq3 (ORCPT ); Wed, 16 Aug 2023 12:46:29 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2046.outbound.protection.outlook.com [40.107.247.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054232D40 for ; Wed, 16 Aug 2023 09:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RULo2dKDLTxwzmTISJd41uK7L9xniTUNZHPzlAzeo4LMRh3M3VKSVruk8MXD9xbHPi01aZiZ4+djtCojlDkVSPDgN8LgMWwkRHv1taz0XbqkqJj6uGGgdIqUMRKCyjVVtKJhtka4PaI+DsVfvZvGxdSBcj8ZAzURfgsm7R78TfhVNT1pCtYlK02M8L5pM3FvKJjPz522GCXuznOJOoZJqNpxRbel5M6oS2C1Jpi8fVIfvTuSgvK6L6CFVyUdy57MbVO+SmSjTYntDayAxu8OSaOKTAhD7mO7nXNgCa22imSYGX12RFXJ3r/8DXi/l8MpptQRtRmXCUN4gm0LT0FWwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IB7Lp7kKiyR6ev9+AbF+zX/i6OoL2QxYMBxWBmUwNpA=; b=iC429Gwbat9FuZfWVBmeXgsNYnkt6sL3G6vqtqiEJwMXzeE+pW7DZRvsd/PlAHDtp9EFILlq8rEA3SARTMJ0Q8lwRp7FRTiA1ARdlOKjnU9orlHd4Dc5Ep1nTZQWNVrq/VNd3GuaDcFrTOn8xi4TUnYK+BSNf+gmvcOKUQFQTCApEDHOrmsGAPZFeZ0yq9zutVHdUlbbDcQc4xB1ystHDO3p7OyJrxBGjaKeUg4+z0I4phTo3OsXHbZ/UyU3nq0XJh2Nq+uZSuQBVdGiNBpIoqTou4PTypHXbmB8uFXhBbiRic9Dfqn5Mkfi67WmxUO8cG9tzPNUT6Sp3iO4GKtA9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IB7Lp7kKiyR6ev9+AbF+zX/i6OoL2QxYMBxWBmUwNpA=; b=NOjwwz1wDSbIsAlQAYVpV3i6IiHrAYwyNA4GX+KS5WkKGRoE2uJhmdE1b0OmJNspqe0EGiWzq3kdYzyZgzTcdFOad6scqWXiFzg3Ywfc4wQCY920Q2hfY7E7ejSCBQYsAzz5XMXzHKX85HhmWPmNDjJIBCeADvM6JTPeP4b14mo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) by AM0PR04MB7107.eurprd04.prod.outlook.com (2603:10a6:208:1a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:45:28 +0000 Received: from GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9]) by GV1PR04MB9151.eurprd04.prod.outlook.com ([fe80::c2fe:9eef:61ea:36d9%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 16:45:28 +0000 From: Claudia Draghicescu To: linux-bluetooth@vger.kernel.org Cc: iulia.tanasescu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, Claudia Draghicescu Subject: [PATCH BlueZ v6 7/7] device: Set as non-temporary device that has matching profiles Date: Wed, 16 Aug 2023 19:44:35 +0300 Message-Id: <20230816164435.5149-8-claudia.rosu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816164435.5149-1-claudia.rosu@nxp.com> References: <20230816164435.5149-1-claudia.rosu@nxp.com> X-ClientProxiedBy: VE1PR03CA0047.eurprd03.prod.outlook.com (2603:10a6:803:118::36) To GV1PR04MB9151.eurprd04.prod.outlook.com (2603:10a6:150:26::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9151:EE_|AM0PR04MB7107:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d2a0a82-71ff-40a7-c851-08db9e783277 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 488B7nAObyzBcLvES016xnNq9FFYcUb0eDfynA3JGdgDPRaxICCh9K2IqMzwqhhMaxzDKYIbSSfJwT3VJ/Qka2Jf3Lw83K3Mbd/X/8/Mv7XaONMo4jtT1D0yZFU0ziGdrlQXPQMxhJazdmUgTQV2/qAC45RFXAzIe/dc3o7uT4H8KQBRkw9uf/7dbdBfklNXlUSNSVoNtK0fHRPcHls9AZBnkFwW6hpnVFp0kaYCh20We0Uau7EAFkrSPcEdIc0Yc14ZU7t8C94+wbvWdXdTvl0Ri3zgNtoxd9WTmVPMnNbMsnxdClUKuiD9MqqEJNTYRSQPPxA3jhJA/+oJ8mF832dIN8Ne1Wsnrd75+gBGUyH0REvJ9d69Zh8r3ajIi7sPRs9XGZvV1z7sxmy8w1bm2MqW7PxkQSZBTR237D9nbFGkc6D5BHwusAkkEmvGw42yTY4niRBTIm9mnmv/twREXaYjweDiCiTpyeaBAuPk6ojxKMWBqHAd9oFrma6dJYjJVCW1/Q872RWwfWUBFMTFbGfQRzuNFZMxU46dPfjQkcWmv/4EL3epRTmNHMreVDhOkSF6T0pRx0aQ5V6thr2X5wbDeV72qiob6Dss1kgHEi4iEcFodHQ0MCRfBhQDOF4w X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9151.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(38350700002)(38100700002)(8676002)(4326008)(8936002)(2906002)(4744005)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 38CBFLwcHHSIs8FjOemgpAn/+0pT6infYPrGpOdOFzLSRU94koPxC+VoTvztZHVVj5IFOXlv+/MXkcMpVr/Gu/pnngnS9L1dS3ObQbbNj63damX7DnxFL1qWvlePjc/37xLpiou1z86KCe67CwdQmHRx/kBSAP2wQWqIm0S0xybblea4JZlkigQCVBuWexcQ0htvdyHaoqBgh1Dz6QOaNF2KjG07rpi2PWuVv8kHVjHEOcMSsNhjMStxRwodyJsSxmJo2+5MZOBKHttF1ZNzbKUsyVjvU6TqhyCXm7pRAOgmXLDppGgK+RdTUh7DZAf0mxo1QZpf410Blz9WUU3giz677hQ4eWI5LEAj1pv103zua29pKhV6yyCwk5Ii7RY8q2SvgGO7HySWxU38VmiPpdvD3qHSQGTm1QvN1hY24ycC5F+Mx2F4uWKbvoHYbTqYRkN4YOrO06YDg07e0ekn8NJb7D6z/2d5qLnLeRQ3NoEmXYEZcxvSQoSkLbkSm67xsKIaGaHwzDsPq3ZtwQMEj25LaKyq8VaI4mnzOuowXTYxAv2+67Zm+rgLlaWzPMrlPCFkzohna0BeQW80ODu5QfjIl5rVbCnH1QA8pbimrbOU7UlNL+0TLw+/8oUZu67BQ9VJDmMZ9Bqn8U7W3Osi7mbvIvgZgnD2tMIBbihrJoTYtuGfCFFZI8CSbHxisOCuosrbZ5lqeViLSJwBeby5/1gfq3OSXnKay7gAf4QxGmxHjySqAOSayLYySbxXyKQ8ATVgcT+63xMAaBeRQnSfz3IrIFdVJf6gnpWQ6Z7g7SOMTGuWAKx+nPyk0wLudUCZOGxpEk5F6Cx/4wYcogTaVSQgb108k9BBZHXDV9y2OihPEVAKj65bPsrpSUn/eHxANBt4PhNry24ZijOK0g/CO/jDJ6zazgxRsHnzjnnxj7J9cyfhMh0Qymublw77CLuZRT1TC4m9CPYHtrTZnOPzG4qlN1AWoq7sdtFJh3Ms2HICv+3aiBvceXX41CX+1s890aKa/ZHULjm5p375m82ELKnVP2LNoay3qKMUf7v0G8my4Us7b5wpwyVAy6EosC9XDcE6lNE2SDngiB1SBFmsMDKVlLYvC1gVT5nre+IkQPuK9ubp7QsgKh4Ip/3UkZ61QUm4YpaY2pa+0BxwEmQYNjdlfA2s73Soo5isHSb9wF0jUTHIgFbXK5E354i0j9fSHFG5KuBVGX8OnSIreVo0viMQVN3kIRZnaIHUXb7qSRUKCUiOHQvlx5oNiuSM4cQu5zLzpW6nadRPCsahUl7H1CHZwWYdfzjqrGVqLyZTe2aWQNWqMkKKbHNRew47cr+Xe1s8BrE2dt0Pbtlbvk9geGQ3u/Dd+IXjeddnYhbqMFyxmM+CBFq8k78YQXBypku+8wkfqAlIQuE8AVHiyJdw5wD9a3IKcX6zNJbH9FcVY8zzAEkbIswAtPjBPgwfBYVyxm6L1abpQJPvMdsQb0/TN2aPAhiWrdZTbzzH/zltAKPig5oLQr+0xFXUv27w7XKULjpFc3SheZ5aNcNd9Uf6JaOQLYtrXtSKq5cv0gig5iap9fl65UxNDSP8Fouu3yzi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d2a0a82-71ff-40a7-c851-08db9e783277 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 16:45:28.5659 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R7zMliF+p8eSxPaMmrQ9mOrs3sVpaDUrrJD6SUxQTbyMtDWwUq5x2QD2896Kr8sxPuO+vUhANoXqC7h6QVm16g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7107 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Mark as non-temporary a device that has matching profiles. For the BAP broadcast case, this fixes the case where the broadcast source was discovered and the remote endpoint was created and the sync is performed after the timer for the device expired. --- src/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/device.c b/src/device.c index ecd385cf8..57632b51e 100644 --- a/src/device.c +++ b/src/device.c @@ -3943,6 +3943,8 @@ static bool device_match_profile(struct btd_device *device, bt_uuid_strcmp) == NULL) return false; + btd_device_set_temporary(device, false); + return true; }