Skip to contentSkip to conversation

mesh: Fix string of public-oob and static-oob

PATCH Applied Prathyusha Nelluri 2 participants 5 messages Dec 3, 2019 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20191203100133epcas5p1bf4b021f6cabcba3b5ff67965ccfec56@epcas5p1.samsung.com

#1 lore raw

PATCH 1/1 mesh: Fix string of public-oob and static-oob

From: Prathyusha N <[email protected]>

Fix string typo as per mesh-api.txt

---
 mesh/agent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mesh/agent.c +2 -2
index 5a5570a..9f9399f 100644
@@ -131,9 +131,9 @@ static void parse_prov_caps(struct mesh_agent_prov_caps *caps,
 			break;
 		}
 
-		if (!strcmp(str, "PublicOOB"))
+		if (!strcmp(str, "public-oob"))
 			caps->pub_type = 1;
-		else if (!strcmp(str, "StaticOOB"))
+		else if (!strcmp(str, "static-oob"))
 			caps->static_type = 1;
 	}
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 mesh: Fix invalid transaction number in PROV_INVITE

From: Prathyusha N <[email protected]>

For initiator, transaction number starts from 0x00 where as for acceptor transaction number starts from 0x80. Since transaction number is pre-incremented and sent in every packet, initialize it with 0xFF for initiator and 0x7F for acceptor.

---
 mesh/pb-adv.c | 1 +
 1 file changed, 1 insertion(+)
mesh/pb-adv.c +1 -0
index 6b4a700..19d1453 100644
@@ -292,6 +292,7 @@ static void pb_adv_packet(void *user_data, const uint8_t *pkt, uint16_t len)
 		/* Only call Open callback once */
 		if (first) {
 			l_debug("PB-ADV open confirmed");
+			session->local_trans_num = 0xFF;
 			session->open_cb(session->user_data, pb_adv_tx,
 							session, PB_ADV);
 		}
Signature · 1 line
2.7.4
Applied
#3 lore raw

Re: [PATCH 1/1] mesh: Fix invalid transaction number in PROV_INVITE

Applied

Quoted 22 lines · Prathyusha Nelluri

From: Prathyusha N <[email protected]>

For initiator, transaction number starts from 0x00 where as for acceptor transaction number starts from 0x80. Since transaction number is pre-incremented and sent in every packet, initialize it with 0xFF for initiator and 0x7F for acceptor.

---
 mesh/pb-adv.c | 1 +
 1 file changed, 1 insertion(+)
mesh/pb-adv.c +1 -0
index 6b4a700..19d1453 100644
@@ -292,6 +292,7 @@ static void pb_adv_packet(void *user_data, const uint8_t *pkt, uint16_t len)
 		/* Only call Open callback once */
 		if (first) {
 			l_debug("PB-ADV open confirmed");
+			session->local_trans_num = 0xFF;
 			session->open_cb(session->user_data, pb_adv_tx,
 							session, PB_ADV);
 		}
#4 lore raw

PATCH 1/1 mesh: Fix to send close indication on timeout

In reply to Prathyusha Nelluri

From: Prathyusha N <[email protected]>

If pb_session is freed in timeout, close indication will not be sent. pb_session is freed in pb_adv_unreg() and hence removed from tx_timeout. Added acceptor_free() in acp_prov_close() to ensure pb_session is freed.

---
 mesh/pb-adv.c        | 2 --
 mesh/prov-acceptor.c | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)
mesh/pb-adv.c +0 -2
index 19d1453..586cd7f 100644
@@ -175,8 +175,6 @@ static void tx_timeout(struct l_timeout *timeout, void *user_data)
 	l_info("TX timeout");
 	cb = pb_session->close_cb;
 	user_data = pb_session->user_data;
-	l_free(pb_session);
-	pb_session = NULL;
 	cb(user_data, 1);
 }
 
mesh/prov-acceptor.c +1 -0
index bca0193..03972c2 100644
@@ -121,6 +121,7 @@ static void acceptor_free(void)
 static void acp_prov_close(void *user_data, uint8_t reason)
 {
 	/* TODO: Handle Close */
+	acceptor_free();
 }
 
 static void prov_to(struct l_timeout *timeout, void *user_data)
Signature · 1 line
2.7.4
Applied
#5 lore raw
In reply to Prathyusha Nelluri

Applied

Quoted 23 lines · Prathyusha Nelluri

From: Prathyusha N <[email protected]>

Fix string typo as per mesh-api.txt

---
 mesh/agent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mesh/agent.c +2 -2
index 5a5570a..9f9399f 100644
@@ -131,9 +131,9 @@ static void parse_prov_caps(struct mesh_agent_prov_caps *caps,
 			break;
 		}
 
-		if (!strcmp(str, "PublicOOB"))
+		if (!strcmp(str, "public-oob"))
 			caps->pub_type = 1;
-		else if (!strcmp(str, "StaticOOB"))
+		else if (!strcmp(str, "static-oob"))
 			caps->static_type = 1;
 	}