Просмотр исходного кода

Merge branch 'bugfix/ble_mesh_proxy_client_net_resend' into 'master'

ble_mesh: stack: Fix proxy client may fail to resend msg

See merge request espressif/esp-idf!9882
Island 5 лет назад
Родитель
Сommit
b7c404d3ff
2 измененных файлов с 7 добавлено и 1 удалено
  1. 1 1
      components/bt/esp_ble_mesh/mesh_core/adv.c
  2. 6 0
      components/bt/esp_ble_mesh/mesh_core/net.c

+ 1 - 1
components/bt/esp_ble_mesh/mesh_core/adv.c

@@ -543,7 +543,7 @@ static void ble_mesh_relay_task_post(bt_mesh_msg_t *msg, uint32_t timeout)
         BT_INFO("Full queue, remove the oldest relay packet");
         BT_INFO("Full queue, remove the oldest relay packet");
         /* Remove the oldest relay packet from queue */
         /* Remove the oldest relay packet from queue */
         if (xQueueReceive(relay_queue.handle, &old_msg, K_NO_WAIT) != pdTRUE) {
         if (xQueueReceive(relay_queue.handle, &old_msg, K_NO_WAIT) != pdTRUE) {
-            BT_ERR("Failed to remove item from queue");
+            BT_ERR("Failed to remove item from relay queue");
             bt_mesh_unref_buf(msg);
             bt_mesh_unref_buf(msg);
             return;
             return;
         }
         }

+ 6 - 0
components/bt/esp_ble_mesh/mesh_core/net.c

@@ -828,6 +828,12 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct net_buf *buf,
         return 0;
         return 0;
     }
     }
 
 
+    if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT) &&
+        bt_mesh_proxy_client_relay(&buf->b, dst)) {
+        send_cb_finalize(cb, cb_data);
+        return 0;
+    }
+
     bt_mesh_adv_send(buf, cb, cb_data);
     bt_mesh_adv_send(buf, cb, cb_data);
     return 0;
     return 0;
 }
 }