Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp706933yba; Thu, 16 May 2019 07:43:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMnNh3eSBybNYkKiBgqUJVEt4O2fEiDHBWN6DjyO3KnSzeRrHBJeTPcNB724Zb1q0JuEyr X-Received: by 2002:a63:ea42:: with SMTP id l2mr50360323pgk.19.1558017780301; Thu, 16 May 2019 07:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558017780; cv=none; d=google.com; s=arc-20160816; b=rnpKP9AcHf8fEHsQyV+DQ8qjhmtSaFzVd8UfJkgcq5pSIxe85QDXFbirIUMI/zYGPP goQ+UjBNzzzN3ebkObIVw9PPKosMxU4wM9bqi9J7zDslF8XyHd+QzQP6PbpUPbjcb29i 6Gn0cZn5w7/mhp58YcFdPDWO2d9XozThDtSRR29/PtPz0UNbZJkZqSKJY6/v4ZE+C+0T cu3J6hkE7ov2jsTtMtt1z10k+vunmficBKraPlmqjPy9JGM2+D9PRhmIHMbpj3fKG7MZ BqtDJOao3bTQMj2wURvZl4ig77g9RNDqDHByVcegYWkrNs/7buAjlZox/7tkGVJJzRo5 PW7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=CJaa602zoPoxTb9reWAVPF8P7l4Xd4aNSKn5b/Gv790=; b=G9zswlZaWOgdXd8y2jdjsEoD2+yf40+HCyLgU63rQhFe91H/Nyfym35W+0R5laixSF 9ih5r6nZIWEb3RAIF0y7Bnlsx/E77PcitVCS+Y176owxBQ4vUVPjyUPluLF/oGJYlHJq mYnB2B80BhP+tEPV9qt5TSvgLsHrz4C8fM4d2i7WY7l2ZPqVs5LgfA5L+xZ57XqVAF3B /08Y20V1AxmHEUNmbzJg4V6XoxQDoHE5jwhEogIjYmHmZYkPBvCXoaMVUkjcGWP3Gygi 0Lnw3Vd+IU2QR6B0iM/Rf1EU5E4VHEQcQZplLEzYKFZQ93MkS+Oz9dvBl8pUMdx3qmyk 14rQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si4964292pgp.199.2019.05.16.07.42.29; Thu, 16 May 2019 07:43:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfEPOm0 (ORCPT + 99 others); Thu, 16 May 2019 10:42:26 -0400 Received: from mail.edilprogetti.net ([185.96.219.211]:39612 "EHLO mail.tinia.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbfEPOm0 (ORCPT ); Thu, 16 May 2019 10:42:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.tinia.eu (Postfix) with ESMTP id 69DDD2226BB for ; Thu, 16 May 2019 16:36:05 +0200 (CEST) Received: from mail.tinia.eu ([127.0.0.1]) by localhost (mail.tinia.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NkEIGUcNVESU for ; Thu, 16 May 2019 16:36:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.tinia.eu (Postfix) with ESMTP id 8D3702226C5 for ; Thu, 16 May 2019 16:36:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at yes Received: from mail.tinia.eu ([127.0.0.1]) by localhost (mail.tinia.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nVmM6rsiUlxd for ; Thu, 16 May 2019 16:36:04 +0200 (CEST) Received: from DANBIAMBL (customer-31-185-23-59.com-com.it [31.185.23.59]) by mail.tinia.eu (Postfix) with ESMTPSA id 625E32226BB for ; Thu, 16 May 2019 16:36:04 +0200 (CEST) From: "Daniele Biagetti" To: Subject: [PATCH 1/4] meshctl: Subscription Delete message added to configuration client Date: Thu, 16 May 2019 16:35:48 +0200 Message-ID: <000601d50bf4$b0527f60$10f77e20$@cblelectronics.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdUL66zO9sHo+9FiTgiUDqkruHD+iw== Content-Language: it Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Subscription delete command/message added to the configuration client model. Signed-off-by: Daniele Biagetti --- tools/mesh/config-client.c | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tools/mesh/config-client.c b/tools/mesh/config-client.c index df2643622..bff38e7a3 100644 --- a/tools/mesh/config-client.c +++ b/tools/mesh/config-client.c @@ -1042,6 +1042,44 @@ static void cmd_sub_get(int argc, char *argv[]) return bt_shell_noninteractive_quit(EXIT_SUCCESS); } +static void cmd_sub_del(int argc, char *argv[]) +{ + uint16_t n; + uint8_t msg[32]; + int parm_cnt; + + if (IS_UNASSIGNED(target)) { + bt_shell_printf("Destination not set\n"); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + n = mesh_opcode_set(OP_CONFIG_MODEL_SUB_DELETE, msg); + + parm_cnt = read_input_parameters(argc, argv); + if (parm_cnt != 3) { + bt_shell_printf("Bad arguments: %s\n", argv[1]); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + /* Per Mesh Profile 4.3.2.19 */ + /* Element Address */ + put_le16(parms[0], msg + n); + n += 2; + /* Subscription Address */ + put_le16(parms[1], msg + n); + n += 2; + /* SIG Model ID */ + put_le16(parms[2], msg + n); + n += 2; + + if (!config_send(msg, n)) { + bt_shell_printf("Failed to send \"ADD SUBSCRIPTION\"\n"); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); +} + static void cmd_mod_appidx_get(int argc, char *argv[]) { uint16_t n; @@ -1237,6 +1275,8 @@ static const struct bt_shell_menu cfg_menu = { cmd_sub_add, "Add subscription"}, {"sub-get", " ", cmd_sub_get, "Get subscription"}, + {"sub-del", " ", + cmd_sub_del, "Delete subscription"}, {"node-reset", NULL, cmd_node_reset, "Reset a node and remove it from network"}, {} }, -- 2.19.2.windows.1