Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1245810ybh; Mon, 13 Jul 2020 13:15:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSV23nYXMw5h8YYAJtW/PnphZao3gaqasa+jJobVNiYi5+Yfz0gWCnfpzdlW5uiktFBLEz X-Received: by 2002:aa7:d692:: with SMTP id d18mr1091183edr.73.1594671347464; Mon, 13 Jul 2020 13:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594671347; cv=none; d=google.com; s=arc-20160816; b=t9w+x/ltDunY+i+0UjXddI0gDOP3voFMTrIIgIDi4GEULktq+o0C/oGG9Qk7Xw0jC9 HaIe1/7ZPmsjpaiyhHmgPwFwAKmj/vAp6zJxPj7OgXEKujpd6SQIDYyHTbP6AN4KGRAI b/A1IbWXMXq2nW2p4VqbWVMnCvwzwC0/4AKYFlZbEUkhVO0HyP+Ek1SI+bDYaDnMyFfg mgf0WSxwc73dvgnvEwejTroL4MbRu9jOx8fEYGFY/waOhM29lZkUp48exEDJQoKBal30 YIlrKz+xX2x7g60HXZwdDLJC/je+jmm68VoOfTzCH+pvSMESGzpPdLvkQZTOpWIC7SoX qEsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xuwheI+yFoySeDdqiX9Di5PWt7znOMhM8gXI0aBJuic=; b=cmvv7g2xDULd8gYNbG8qIm73ZwNKp9LklBQ6CsX0t0UN1eCjAuvwgDb37l6IxSyKRk kNfZr1yZf7neozyfORSSNAMO55oNb0B8hZetl1gsK8jeMScTw1SvywMJQ/cDdANhSJnA lwKdQJ3z8t81xaO/eyD+cKadjSWBF0jpBEBkph4jZCdSVxb9Im6+hOBNIc00KyB4Vryw fZ+4cssFzDvBKn2pbIczSP6zII4wsnIluBsTd+MPsCbrw45758zJ0qbpIMyqy2Zlun9y sGzWKgZ19O1WmRiUohHjfXr1As8g/FJ+FseosRi7n7IG9a/MyQA6MnXe97J63HscHlLb 4z7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="b/7kWF87"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf27si10135899ejb.83.2020.07.13.13.15.22; Mon, 13 Jul 2020 13:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="b/7kWF87"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbgGMUPH (ORCPT + 99 others); Mon, 13 Jul 2020 16:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbgGMUPG (ORCPT ); Mon, 13 Jul 2020 16:15:06 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD936C061755 for ; Mon, 13 Jul 2020 13:15:06 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id x9so6011109plr.2 for ; Mon, 13 Jul 2020 13:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xuwheI+yFoySeDdqiX9Di5PWt7znOMhM8gXI0aBJuic=; b=b/7kWF87GiyV5+sodQkD2ZHy+FdJZqCkfuZaSd1uqlzgW7ml0CZ9XglUjlVXBnJMiK d0KFLvkPWxdD5R1SOQmMUisRAhke4dLNgeAvXeZgWDLV3NomZCsUB2hXNzruEvP7dpEa 9iPbpZCLzw9OxR8OrfL4ZKWxfPUgbWRPGmnLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xuwheI+yFoySeDdqiX9Di5PWt7znOMhM8gXI0aBJuic=; b=QimzKJ8tfkLkErcP0QVLk3PmrteXgKxJEmwt/D7sKUPI0c8HGo+yeBf0ECiY2S44+Y VGYIUL9U/Y+uRFF9VrXtkuCywfKQdEGXovzcepTaLEraZLctgzp+oVgG3mMMjdPivrx0 8soY+4PcmWiuY0M9rzuX9b2A33oKn6o27VFCvMcSpkxMDrmt3hluIo4H4grhru3gs07B iHbX+RKrzL1IdvQ6O7gFb+2JZwk5O1ChEi5VHvVroch8665VoYzI9qy1IfC8QFHtgyZg zltRsffTujcH3MkKKaeCEhtA1d49iQMvn+ZWK+ApGZVZB9WzCv6vy10EOeUfQlZBINCR A8xQ== X-Gm-Message-State: AOAM5308VlQj9O0Ar2hofcyxI1nlCuaGsL2LVSMtslz/J+Jp9zpNvrIY gcHho4HSPrUwJTTnqxaNhNaFXQ== X-Received: by 2002:a17:90a:9d84:: with SMTP id k4mr1084380pjp.227.1594671306331; Mon, 13 Jul 2020 13:15:06 -0700 (PDT) Received: from sonnysasaka-chrome.mtv.corp.google.com ([2620:15c:202:201:4a0f:cfff:fe66:e60c]) by smtp.gmail.com with ESMTPSA id h18sm7866135pfr.186.2020.07.13.13.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jul 2020 13:15:05 -0700 (PDT) From: Sonny Sasaka To: linux-bluetooth-@vger.kernel.org, linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Alain Michaud Subject: [PATCH BlueZ 3/3] client: Add set-allow-internal-profiles command Date: Mon, 13 Jul 2020 13:14:41 -0700 Message-Id: <20200713201441.235959-4-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200713201441.235959-1-sonnysasaka@chromium.org> References: <20200713201441.235959-1-sonnysasaka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Reviewed-by: Alain Michaud --- client/main.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/client/main.c b/client/main.c index 9abada69f..c2b6e21e4 100644 --- a/client/main.c +++ b/client/main.c @@ -1678,6 +1678,7 @@ static void cmd_info(int argc, char *argv[]) print_property(proxy, "Connected"); print_property(proxy, "WakeAllowed"); print_property(proxy, "LegacyPairing"); + print_property(proxy, "AllowInternalProfiles"); print_uuids(proxy); print_property(proxy, "Modalias"); print_property(proxy, "ManufacturerData"); @@ -1838,6 +1839,39 @@ static void cmd_unblock(int argc, char *argv[]) return bt_shell_noninteractive_quit(EXIT_FAILURE); } +static void cmd_set_allow_internal_profiles(int argc, char *argv[]) +{ + GDBusProxy *proxy; + dbus_bool_t allow_internal_profiles; + char *str; + + proxy = find_device(argc, argv); + if (!proxy) + return bt_shell_noninteractive_quit(EXIT_FAILURE); + + if (strcmp(argv[2], "true") != 0 && strcmp(argv[2], "false") != 0) { + bt_shell_printf("Invalid argument: %s\n", argv[2]); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + allow_internal_profiles = strcmp(argv[2], "true") == 0 ? true : false; + + str = g_strdup_printf("%s allow internal profiles", + proxy_address(proxy)); + + if (g_dbus_proxy_set_property_basic(proxy, "AllowInternalProfiles", + DBUS_TYPE_BOOLEAN, + &allow_internal_profiles, + generic_callback, + str, + g_free) == TRUE) + return; + + g_free(str); + + return bt_shell_noninteractive_quit(EXIT_FAILURE); +} + static void remove_device_reply(DBusMessage *message, void *user_data) { DBusError error; @@ -2824,6 +2858,10 @@ static const struct bt_shell_menu main_menu = { dev_generator }, { "unblock", "[dev]", cmd_unblock, "Unblock device", dev_generator }, + { "set-allow-internal-profiles", " ", + cmd_set_allow_internal_profiles, + "Set allow internal profiles", + dev_generator }, { "remove", "", cmd_remove, "Remove device", dev_generator }, { "connect", "", cmd_connect, "Connect device", -- 2.26.2