linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Inga Stotland <inga.stotland@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: brian.gix@intel.com, Inga Stotland <inga.stotland@intel.com>
Subject: [PATCH BlueZ v2 03/10] mesh: Clean up handling of config node identity message
Date: Thu, 30 Jul 2020 23:19:29 -0700	[thread overview]
Message-ID: <20200731061936.56952-3-inga.stotland@intel.com> (raw)
In-Reply-To: <20200731061936.56952-1-inga.stotland@intel.com>

This modification allows using a single point for sending out
the composed status messages by the Config Server.
---
 mesh/cfgmod-server.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
index 8a92c6cd7..2d47429f7 100644
--- a/mesh/cfgmod-server.c
+++ b/mesh/cfgmod-server.c
@@ -773,11 +773,7 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx,
 		break;
 
 	case OP_NODE_IDENTITY_SET:
-		if (size != 3 || pkt[2] > 0x01)
-			return true;
-
-		n_idx = l_get_le16(pkt);
-		if (n_idx > 0xfff)
+		if (size != 3)
 			return true;
 
 		/* Currently setting node identity not supported */
@@ -785,18 +781,13 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx,
 		/* Fall Through */
 
 	case OP_NODE_IDENTITY_GET:
-		if (size < 2)
+		if (opcode == OP_NODE_IDENTITY_GET && size != 2)
 			return true;
 
 		n_idx = l_get_le16(pkt);
-		if (n_idx > 0xfff)
-			return true;
 
 		n = mesh_model_opcode_set(OP_NODE_IDENTITY_STATUS, msg);
-
-		status = mesh_net_get_identity_mode(net, n_idx, &state);
-
-		msg[n++] = status;
+		msg[n++] = mesh_net_get_identity_mode(net, n_idx, &state);
 
 		l_put_le16(n_idx, msg + n);
 		n += 2;
-- 
2.26.2


  parent reply	other threads:[~2020-07-31  6:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31  6:19 [PATCH BlueZ v2 01/10] mesh: Clean up handling of config subscription messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 02/10] mesh: Clean up handling of config model binding messages Inga Stotland
2020-07-31  6:19 ` Inga Stotland [this message]
2020-07-31  6:19 ` [PATCH BlueZ v2 04/10] mesh: Clean up handling of config publication messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 05/10] mesh: Clean up handling of config net and app key messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 06/10] mesh: Clean up handling of config relay messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 07/10] mesh: Clean up handling of config poll timeout message Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 08/10] mesh: Clean up handling of config net transmit messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 09/10] mesh: Clean up handling of config KR phase messages Inga Stotland
2020-07-31  6:19 ` [PATCH BlueZ v2 10/10] mesh: Refactor heartbeat pub/sub Inga Stotland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200731061936.56952-3-inga.stotland@intel.com \
    --to=inga.stotland@intel.com \
    --cc=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).