tools/mesh: Get rid of "unreliable opcodes" in models
authorInga Stotland <inga.stotland@intel.com>
Tue, 7 Jul 2020 16:44:39 +0000 (09:44 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
This removes an old notion of unreliable opcodes in models , i.e.,
a correctly formatted acknowledged message always gets a response.

Change-Id: I9d6702927addac5a8ad25728046ea2d741f2022e
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
tools/mesh-gatt/config-client.c
tools/mesh-gatt/config-server.c
tools/mesh-gatt/onoff-model.c
tools/mesh-gatt/util.h
tools/mesh/cfgcli.c
tools/mesh/model.h

index ed31c67d9ea6307abb5872892bf9e6905ce72c0a..bfc788258a965c2c3e571d11efc4c5ba3b41c305 100644 (file)
@@ -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;
 
index 8fc6edcc00de41f63c545a93dc951c9d00321e81..9e9b9395963f1a8497ab42ab6668a747326e0fb3 100644 (file)
@@ -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;
 
index 92c9a31055663e8828eba15afc9bc69dfb5b0780..be519c9692541c4b2e8c122cc6574841b060a002 100644 (file)
@@ -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;
 
index c3facfa739a536b5db139b45a5b99495ecebe583..dba2c480b9f415c2b5764a18af0725e75b5ed16a 100644 (file)
@@ -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,
index 218e82c508fdbde658b449c767681d400bcb7f95..e36c8dca5f0a18fb3884ce2bf62f9bf3d9eb3bbb 100644 (file)
@@ -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;
 
index 449fe19b2945cf4c6cb0c9b5e7918c32ed491cc2..35bb80efc4c6164052635e521e471278f1ecbecb 100644 (file)
@@ -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,