Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp620146rdb; Thu, 18 Jan 2024 13:33:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQhUqLul6xihcQyM0EShkme31Ylylv8bLvWoWxDGNg8P8M4I9EYGpQLl63QwuiLBaTqp4h X-Received: by 2002:a05:620a:1721:b0:783:25b7:aeec with SMTP id az33-20020a05620a172100b0078325b7aeecmr405617qkb.5.1705613606008; Thu, 18 Jan 2024 13:33:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705613605; cv=pass; d=google.com; s=arc-20160816; b=bOG425ajRfaqVcOV55L6G6X06ap4W0mwZX7GC9hRyJn32SMxuHexQd7yggcn/9q3fd aSjnLL0aZ9JkDpq2ynVHSVNz3BfFAEmfuuwjJpQX2i7p3IIoUZbSXHwIH4a2/Nh2cPNE zH1WxCc0YLZKmVtlNQ0JalAWVcnklMoSucrayyWwGO8/nncN8co0In35Ia/VzXSAEOae YfYjonv9vwSUaZMohzTjZ1LprynctxsQI9VZs9MP8KEL3aOIzZEiqH+6zi9lk9Fefcmu JPj0Km4VyixNOtXhH/Kt7bAgtR/cVXDVJw9ggkjeEJrgIzgqaU/qPMQzzMugbrKKq1km jSsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=whPRIrmxj3IUu42msiK9GPrFaC7pd7/RcvdGJ6mVBjg=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=AasgsJ8yAD2jDVhrXdOBGvAsi4v/TRwmmT3z8gtDatiXIKphY7sk7M5sisVDUe9xkH j8QFzXIO8uHv7ROq1C1vSZLC1/DJp8y+cqZpLZb1jWz7h9JokZ/4x2o83keVITrRPP38 /yofjiqeJ69b1d6DJO4ULfuItNN7BBOWPnRYMEt5OzBOFyPSdtenhVBii0aGHvSCvo/j 0Zq0jxT/5wP1WVnfFuft9vVCvY4dXPLRE9hjA0Q7SoQrpPbriEtgVy4R4Hs+yfZPiHw0 grVbLcpXUwYDKCfzQHTbFteNRDYxOAkGaU6JI3kbm4l3e5sH0kLKLNRxOZtrPbpBB1OF 80TA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="kW/xEopP"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dt9-20020a05620a478900b007815c7aa50bsi14548123qkb.263.2024.01.18.13.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 13:33:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="kW/xEopP"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C01781C22FFC for ; Thu, 18 Jan 2024 21:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 294F62EB06; Thu, 18 Jan 2024 21:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kW/xEopP" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40E7D3172E for ; Thu, 18 Jan 2024 21:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705613600; cv=none; b=dBxw6baL3xBdC5HPjCSzC/v3APD9lSnuCUGiBWHiTeH69vAP5eOjekvl8COMFHRSZZ63So/ZJakjRF3S06NIdZeXmJjy/WQXIfZeNTVakjzlNQxhIgNrlN2KNBN2NLm7isx95IwoTv2R/doPCQSqc0+b59zKbY225avSNIc6W5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705613600; c=relaxed/simple; bh=4+P2Wle40NQ97lEZJP2Co9YeWuaLlYdwrsdVRP3tMgE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=CwWGGsfdBlxp3ZPqwzQzKdtzzFCiTDOUAaCdqru5aLpZul3oSENz9+Q+9tCoj9dPjBlx6qv2133LeOMFaEgzHtbO7rv98rFCoEE0M2E6qgi09TelGuWzRhcSI7tSwsQPiyFigyNkNzKfvgDwrCek4dsszlwE0NrTs740vMUuPLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kW/xEopP; arc=none smtp.client-ip=209.85.161.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-598cf18b259so68769eaf.1 for ; Thu, 18 Jan 2024 13:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705613597; x=1706218397; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=whPRIrmxj3IUu42msiK9GPrFaC7pd7/RcvdGJ6mVBjg=; b=kW/xEopPI3sEKfnICWLZ52ow7L0sympGx1+J3gTCD2Yppj0axaxX9wMf+dj0hh/cTb ZoiGsSk6oDTn2+Ru1TwDTj4FJ64KEmqDczZo1QS/UGhWgP+e8IRo/R2vVmoIe1NKzkgO Qx/i9wQBaBKgMaBf9t8XI3YXEurBoR0B6j3Vs5NBqku7pjWizSGzgm0iRGN/jp9wen0w qeoSrC3iDNVTrdoVXjhURH9Rsf2sgwlclvrqlpobIAgIpIZL/dzxaH3x/+hM6XRhSxr0 ymS85fQVFDObRfPOnQ3jyz8UN/+V6vMjh9Kzzk0HhCegDtHj6/qNUxmNAPKUNrSN9tCS V8Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705613597; x=1706218397; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=whPRIrmxj3IUu42msiK9GPrFaC7pd7/RcvdGJ6mVBjg=; b=EAiMrqWfy+IdU7P3CIcpBTse9nsLxE9SYf4gz4H83VwCTBsXFHa6ePjriuLXXDfXTj m9HoKmKHrTDcB/NHvVAOxgk0Fe6uxbFBXkkJP80S5HdPADES0eqLuufWW2JGRcB7+FRI E3/mkaDJxL8Oxy7bKBxcWslLi9bNPrwiHkoXcMukBkS79boGEWR7V+B1cBW/gUVx6seN jFoH0UzH2CvO70MjwthuB4xwpI/uY47Y0vdXZBWikXp+XbAzag9yuTdnie3YXN/CR8mQ qWsC0jo8rHECdBuWUKQdsOTDcczlR4VuPbGET3KxfsHK9bp5v8kF1QM1dw685Gjv35/q UOKQ== X-Gm-Message-State: AOJu0YzlOiFU5Zyu56zXjXl+eRj3kvMetfNtrRJ75Thx1MrAAjKoMMQ7 xfRRJ+HjrLDiClxdS13K2ZpJhnKa0CdBSMb8bz//eQ5tQucXNJ+Vi5XqhK0s X-Received: by 2002:a05:6359:6395:b0:175:a4ad:40fa with SMTP id sg21-20020a056359639500b00175a4ad40famr1048426rwb.48.1705613596921; Thu, 18 Jan 2024 13:33:16 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id d7-20020a254f07000000b00dbd9a0ec1d5sm6301383ybb.47.2024.01.18.13.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 13:33:15 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 1/2] player: Fix endpoint.config for broadcast Date: Thu, 18 Jan 2024 16:33:13 -0500 Message-ID: <20240118213314.2066415-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz endpoint.config where taking different arguments for broadcast which is not recommended with shell as it doesn't support such a thing. So instead of taking different arguments for broadcast both remote and local endpoints shall be passed but in case of broadcast sync both the remote and the local endpoint actually refer to the same endpoint registered by bluetoothctl: endpoint.config /org/bluez/hci0/pac_bcast0 /local/endpoint/ep2 16_2_1 --- client/player.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/client/player.c b/client/player.c index 39d1be665c8f..1bc64af3c2ae 100644 --- a/client/player.c +++ b/client/player.c @@ -3642,10 +3642,6 @@ static void cmd_config_endpoint(int argc, char *argv[]) { struct endpoint_config *cfg; const struct codec_preset *preset; - const struct capabilities *cap; - char *uuid; - uint8_t codec_id; - bool broadcast = false; cfg = new0(struct endpoint_config, 1); @@ -3660,33 +3656,14 @@ static void cmd_config_endpoint(int argc, char *argv[]) /* Search for the local endpoint */ cfg->ep = endpoint_find(argv[2]); if (!cfg->ep) { - - /* When the local endpoint was not found either we received - * UUID, or the provided local endpoint is not available - */ - uuid = argv[2]; - codec_id = strtol(argv[3], NULL, 0); - cap = find_capabilities(uuid, codec_id); - if (cap) { - broadcast = true; - cfg->ep = endpoint_new(cap); - cfg->ep->preset = find_presets_name(uuid, argv[3]); - if (!cfg->ep->preset) - bt_shell_printf("Preset not found\n"); - } else { - bt_shell_printf("Local Endpoint %s," - "or capabilities not found\n", uuid); - goto fail; - } + bt_shell_printf("Local Endpoint %s not found\n", argv[2]); + goto fail; } - if (((broadcast == false) && (argc > 3)) || - ((broadcast == true) && (argc > 4))) { - char *preset_name = (broadcast == false)?argv[3]:argv[4]; - - preset = preset_find_name(cfg->ep->preset, preset_name); + if (argc > 3) { + preset = preset_find_name(cfg->ep->preset, argv[3]); if (!preset) { - bt_shell_printf("Preset %s not found\n", preset_name); + bt_shell_printf("Preset %s not found\n", argv[3]); goto fail; } @@ -4105,8 +4082,7 @@ static const struct bt_shell_menu endpoint_menu = { { "unregister", "", cmd_unregister_endpoint, "Register Endpoint", local_endpoint_generator }, - { "config", - " [local endpoint/UUID] [preset/codec id] [preset]", + { "config", " [local endpoint] [preset]", cmd_config_endpoint, "Configure Endpoint", endpoint_generator }, -- 2.43.0