Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3141030pxb; Fri, 5 Nov 2021 10:24:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwPAIM34CRwzOji5oINt5MRoqmrOSvpysqTNzIXbM4prFatXFxr0x6HeeDl7Gid7Ed/487 X-Received: by 2002:a05:6e02:1ba4:: with SMTP id n4mr23231466ili.305.1636133052896; Fri, 05 Nov 2021 10:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636133052; cv=none; d=google.com; s=arc-20160816; b=zta56TB7vmY5tp04FmCb5HB1mCocoz9ndccJCt0vwKl0IKHG0pkhROfp3t9DHxvqS7 6w2d418ZjNyUpecvzWc99axcByJpV6af6/j/Q1nNgMMy1+KsPgnKnnkm1hBsyOtWX6mt 30b2NdiVMqP3/M0HH2+AnjixheQBJ9KSlKlYETo4NT8ki71NglLUk4ZYyyuqeomep04E +yPLkMKE3EFjeW00QAyPnjb5FC9wGSY8lXXcUyKB3QIXZfr41ZaFZTtWGkrs3zQVw+bq Yw51k+avaar/RXFBxmzSfF+lYLbQalrcWskL1tShEME2x/oxcD48Z+VpLsLJsglOGGyL Diyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lFFls0QXklC6N2oJJPdeNf3RykoHVkdfuCLNKLfFnE8=; b=ZJiuTBgDFZOpINu5alhY+bPar+G8F925nK1cbNTjcShpLuUcdrniwZrTWA5lmAMZ6G FtISrssdpL55Iz2nQ1fPn1kRaWNLFdFrf4ptNBw+G4PCs9CblktqJaNeCwzkCXrrxD9a TdbcVCC/yGBpOUt8ycT5G5yTjxzWew9FJmJ9cSjdusj0G3pdz3NrmjALE/mEsmJrQst+ aLInYQC6do5n67KC9yPE/LVpgUgGDXjmk+rfEryL7ldgsc6xibaJ41KSXQSkgCDHUf3x sSCHVw27HezIybrR8xfEfqenMjfQFdI4ZLGe5GUgS3Dfa3oW23PY3U64zLuLkf9wi5o1 2K8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VVGMyDxt; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si1448373ioa.61.2021.11.05.10.23.29; Fri, 05 Nov 2021 10:24:12 -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=@gmail.com header.s=20210112 header.b=VVGMyDxt; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233725AbhKERAt (ORCPT + 99 others); Fri, 5 Nov 2021 13:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbhKERAt (ORCPT ); Fri, 5 Nov 2021 13:00:49 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7460EC061714 for ; Fri, 5 Nov 2021 09:58:09 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id g18so4620725pfk.5 for ; Fri, 05 Nov 2021 09:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lFFls0QXklC6N2oJJPdeNf3RykoHVkdfuCLNKLfFnE8=; b=VVGMyDxt9/Bg6NGQCHj1Bl2BuiOFmhHI+zdrU6fLkhwTgExRHN6P/pivTGvU/eRKsm w78fDbgQja0mLghSJkozMxdKAcT6xwZyNOa+x7R9WoV8dhYtcqTDBgQKT48w79uY9gy1 RUG+dl1ml7IDwPCKRVs44rHwNnDCqEpPESIv/3DI0WgEQyGfb+o2OuhAt7y7bw2C1jaC /OJzgKAqbgLhENOFbR21OtGMJtZp+dH64gDZqzWyJFQ/6MI1KXo9/yudQuxwoIu1dLLc XnUqpgqpxHm5HIYIkSSbW7DHIJ+Xjk0Ias9N7q/lu1uNdEMHXBmSE+4iChK/1qgfeTFr l/1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lFFls0QXklC6N2oJJPdeNf3RykoHVkdfuCLNKLfFnE8=; b=ZkA5urgw+cGqJOShd0Hk50WsYAIENWYcFknF2E3aCcE31193gpXPb7zwpuqNYolk1N iH7Y9s9BnvCiPcJS5JNVbiyeW0YFsiPopll6T1CnAP1YU0/Y57vNgmLXqVLuy0MlUoIX fI7bvIphwH0Zjn1MRUh0BTk0m4iCZyXAiKF/YXa72GCFa3CPcPExLbqwC8WGrK4dNtgS 9plu/o370HpuOgPCQ5H4asBdbcScso6p6H0SbLzTTyRyZizgTY1nlTDDlYxv5fCgtG69 KKVYg0fa1uStSaLhF/YVlvzzKejTamN1vPLUvfwR52DNp5WTL2iGy2tn8UCOfQJr6T9+ YLVg== X-Gm-Message-State: AOAM532EQpZc7o59WNBANKGV6rLrWTOEdNROV8I6To7Nt3unEDscU2rZ eKmZ2Z16rhJ/tXDqLTIW+Vn9p9nAOTiutQ== X-Received: by 2002:a62:3306:0:b0:480:f89c:c251 with SMTP id z6-20020a623306000000b00480f89cc251mr43564934pfz.74.1636131484247; Fri, 05 Nov 2021 09:58:04 -0700 (PDT) Received: from localhost.localdomain ([69.196.88.170]) by smtp.gmail.com with ESMTPSA id k73sm6361486pgc.63.2021.11.05.09.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 09:58:04 -0700 (PDT) From: Jefferson Zhai X-Google-Original-From: Jefferson Zhai To: linux-bluetooth@vger.kernel.org Cc: Jefferson Zhai Subject: [PATCH BlueZ 1/1] FIX: Fixed oversight of not supporting vendor model in Meshctl tool's sub-add command Date: Fri, 5 Nov 2021 09:57:35 -0700 Message-Id: <20211105165735.13606-2-GoodGame13241324@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211105165735.13606-1-GoodGame13241324@gmail.com> References: <20211105165735.13606-1-GoodGame13241324@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Jefferson Zhai --- tools/mesh-gatt/config-client.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/mesh-gatt/config-client.c b/tools/mesh-gatt/config-client.c index 3ec42d94a..7bdd028d2 100644 --- a/tools/mesh-gatt/config-client.c +++ b/tools/mesh-gatt/config-client.c @@ -972,7 +972,7 @@ static void cmd_sub_add(int argc, char *argv[]) n = mesh_opcode_set(OP_CONFIG_MODEL_SUB_ADD, msg); parm_cnt = read_input_parameters(argc, argv); - if (parm_cnt != 3) { + if (parm_cnt != 3 && parm_cnt != 4) { bt_shell_printf("Bad arguments: %s\n", argv[1]); return bt_shell_noninteractive_quit(EXIT_FAILURE); } @@ -984,9 +984,15 @@ static void cmd_sub_add(int argc, char *argv[]) /* Subscription Address */ put_le16(parms[1], msg + n); n += 2; - /* SIG Model ID */ - put_le16(parms[2], msg + n); - n += 2; + /* Model ID */ + if (parm_cnt == 4) { + put_le16(parms[3], msg + n); + put_le16(parms[2], msg + n + 2); + n += 4; + } else { + put_le16(parms[2], msg + n); + n += 2; + } if (!config_send(msg, n)) { bt_shell_printf("Failed to send \"ADD SUBSCRIPTION\"\n"); @@ -1222,7 +1228,7 @@ static const struct bt_shell_menu cfg_menu = { cmd_hb_sub_set, "Set heartbeat subscribe"}, {"hb-sub-get", NULL, cmd_hb_sub_get, "Get heartbeat subscribe"}, - {"sub-add", " ", + {"sub-add", " [cid]", cmd_sub_add, "Add subscription"}, {"sub-get", " ", cmd_sub_get, "Get subscription"}, -- 2.25.1