Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2430932ybl; Thu, 9 Jan 2020 12:38:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwaJkAuz1SR+oRepWJfWYuHSIF7fuUN77FzuMW0xhl5PDaDpYfszxlyKwS7Ckzl3qlwxK52 X-Received: by 2002:a9d:6c01:: with SMTP id f1mr9674915otq.133.1578602282541; Thu, 09 Jan 2020 12:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578602282; cv=none; d=google.com; s=arc-20160816; b=TDiZfIdcwgDzfGUwfBONIxZuCRf3po6YTaeaBJ+DhKXgOm/cunzdwkI+XXgFmIdyji zBTLIrGRnCYilEa4+qerRTtiOdWbnYz4OUNfahwHEqEbWLnZbxA+LpSUTSh6/IzmFtE2 2c9E78n3+chBClEyWgxfqDKAR+6q9CcOOiNxzZ5XFC2LG2L2qG+DvGP4vyJO8rULHsHS 2XTHqMQMEVJSCUAv3nKb4w3NIJ+NGWhBG1dxB7fFoDH/4w5u3r7K++ov+lgk0h/uAetK WwELYPGyrO/x77MBRsZMB/iryZuFD/zw/G4OHtG/Pi93/ZwcGskFAxRjLlb7BVwngayl PU9Q== 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 :message-id:date:subject:cc:to:from; bh=UcoODhfXt0TS5/b5IK7AqGsi3vbJoaSS6CEvcm7w9Vs=; b=xqdHHO1mA34EwCpkfFDpWu2oJlmBeMcx+DgQgFIDkXOkn+CpO6tMHMSaWxcfMyiVF5 86CM152rODxQerTyvwM3eJhnx7Ri3GSGPkRi7naulz6NUhSpMKq+TWyrIMFw+dbD7Wv1 WINUzL9Bq4NmAj9n4zZU6ul8HQnhIfSoHxyEsT0UuEDLo3OZ3PX2bMA6JOyMqSCuduNs DeX9TZc4FFIiL++YPzIWij5SWs5Tk8WcVJ1G6ZMd+FrZg3O+te6P+x530VPkG5be7/Yy QQmNlA079Prkr9+nhtuVF5fuEl2VIfaoJk5bovsjrhqg73zTEyzoIZKrJjipHymNTH7b xSfQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g126si4268306oif.106.2020.01.09.12.37.42; Thu, 09 Jan 2020 12:38:02 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388249AbgAIRoQ (ORCPT + 99 others); Thu, 9 Jan 2020 12:44:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:29106 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731894AbgAIRoP (ORCPT ); Thu, 9 Jan 2020 12:44:15 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 09:44:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,414,1571727600"; d="scan'208";a="211967107" Received: from ingas-nuc1.sea.intel.com ([10.254.104.252]) by orsmga007.jf.intel.com with ESMTP; 09 Jan 2020 09:44:15 -0800 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ] tools/mesh: Fix check condition for model ID Date: Thu, 9 Jan 2020 09:44:09 -0800 Message-Id: <20200109174409.18135-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.1 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 Use the value of VENDOR_ID_MASK to set/check vendor model and SIG model IDs --- tools/mesh/cfgcli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mesh/cfgcli.c b/tools/mesh/cfgcli.c index 1fcf82035..2403c9293 100644 --- a/tools/mesh/cfgcli.c +++ b/tools/mesh/cfgcli.c @@ -247,7 +247,7 @@ static uint32_t print_mod_id(uint8_t *data, bool vid, const char *offset) if (!vid) { mod_id = get_le16(data); bt_shell_printf("%sModel Id\t%4.4x\n", offset, mod_id); - mod_id = 0xffff0000 | mod_id; + mod_id = VENDOR_ID_MASK | mod_id; } else { mod_id = get_le16(data + 2); bt_shell_printf("%sModel Id\t%4.4x %4.4x\n", offset, @@ -327,7 +327,7 @@ static void print_pub(uint16_t ele_addr, uint32_t mod_id, bt_shell_printf("\tElement: %4.4x\n", ele_addr); bt_shell_printf("\tPub Addr: %4.4x\n", pub->u.addr16); - if (mod_id > 0xffff0000) + if (mod_id < VENDOR_ID_MASK) bt_shell_printf("\tModel: %8.8x\n", mod_id); else bt_shell_printf("\tModel: %4.4x\n", -- 2.21.1