[PATCH BlueZ 2/2] tools/mesh: Get rid of "unreliable opcodes" in models

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This removes an old notion of unreliable opcodes in models , i.e.,
a correctly formatted acknowledged message always gets a response.
---
 tools/mesh-gatt/config-client.c | 2 +-
 tools/mesh-gatt/config-server.c | 2 +-
 tools/mesh-gatt/onoff-model.c   | 2 +-
 tools/mesh-gatt/util.h          | 2 --
 tools/mesh/cfgcli.c             | 4 ++--
 tools/mesh/model.h              | 1 -
 6 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/tools/mesh-gatt/config-client.c b/tools/mesh-gatt/config-client.c
index ed31c67d9..bfc788258 100644
--- a/tools/mesh-gatt/config-client.c
+++ b/tools/mesh-gatt/config-client.c
@@ -100,7 +100,7 @@ static bool client_msg_recvd(uint16_t src, uint8_t *data,
 	if (primary != src)
 		return false;
 
-	switch (opcode & ~OP_UNRELIABLE) {
+	switch (opcode) {
 	default:
 		return false;
 
diff --git a/tools/mesh-gatt/config-server.c b/tools/mesh-gatt/config-server.c
index 8fc6edcc0..9e9b93959 100644
--- a/tools/mesh-gatt/config-server.c
+++ b/tools/mesh-gatt/config-server.c
@@ -73,7 +73,7 @@ static bool server_msg_recvd(uint16_t src, uint8_t *data,
 
 	n = 0;
 
-	switch (opcode & ~OP_UNRELIABLE) {
+	switch (opcode) {
 	default:
 		return false;
 
diff --git a/tools/mesh-gatt/onoff-model.c b/tools/mesh-gatt/onoff-model.c
index 92c9a3105..be519c969 100644
--- a/tools/mesh-gatt/onoff-model.c
+++ b/tools/mesh-gatt/onoff-model.c
@@ -123,7 +123,7 @@ static bool client_msg_recvd(uint16_t src, uint8_t *data,
 								len, opcode);
 	print_byte_array("\t",data, len);
 
-	switch (opcode & ~OP_UNRELIABLE) {
+	switch (opcode) {
 	default:
 		return false;
 
diff --git a/tools/mesh-gatt/util.h b/tools/mesh-gatt/util.h
index c3facfa73..dba2c480b 100644
--- a/tools/mesh-gatt/util.h
+++ b/tools/mesh-gatt/util.h
@@ -25,8 +25,6 @@
 
 struct mesh_publication;
 
-#define OP_UNRELIABLE			0x0100
-
 void set_menu_prompt(const char *name, const char *id);
 void print_byte_array(const char *prefix, const void *ptr, int len);
 bool str2hex(const char *str, uint16_t in_len, uint8_t *out_buf,
diff --git a/tools/mesh/cfgcli.c b/tools/mesh/cfgcli.c
index 218e82c50..e36c8dca5 100644
--- a/tools/mesh/cfgcli.c
+++ b/tools/mesh/cfgcli.c
@@ -416,7 +416,7 @@ static bool msg_recvd(uint16_t src, uint16_t idx, uint8_t *data,
 
 	bt_shell_printf("Received %s (len %u)\n", opcode_str(opcode), len);
 
-	req = get_req_by_rsp(src, (opcode & ~OP_UNRELIABLE));
+	req = get_req_by_rsp(src, opcode);
 	if (req) {
 		cmd = req->cmd;
 		free_request(req);
@@ -424,7 +424,7 @@ static bool msg_recvd(uint16_t src, uint16_t idx, uint8_t *data,
 	} else
 		cmd = NULL;
 
-	switch (opcode & ~OP_UNRELIABLE) {
+	switch (opcode) {
 	default:
 		return false;
 
diff --git a/tools/mesh/model.h b/tools/mesh/model.h
index 449fe19b2..35bb80efc 100644
--- a/tools/mesh/model.h
+++ b/tools/mesh/model.h
@@ -18,7 +18,6 @@
  *
  */
 
-#define OP_UNRELIABLE	0x0100
 #define VENDOR_ID_INVALID	0xFFFF
 
 typedef bool (*model_send_msg_func_t) (void *user_data, uint16_t dst,
-- 
2.26.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux