]> granicus.if.org Git - esp-idf/commitdiff
ble_mesh: fix bt_mesh_net_resend() caused compiling error
authorlly <lly@espressif.com>
Mon, 2 Sep 2019 07:32:20 +0000 (15:32 +0800)
committerlly <lly@espressif.com>
Mon, 9 Sep 2019 09:15:16 +0000 (17:15 +0800)
components/bt/esp_ble_mesh/mesh_core/net.c

index ec13cbf359c5c4157d5e1460bcf9e03f35c3b89a..a9bbb2e6b82bd69b445e75203e8ce81631205662 100644 (file)
@@ -784,13 +784,15 @@ int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct net_buf *buf,
         return err;
     }
 
+    if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_provisioned()) {
     if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY) &&
         bt_mesh_proxy_relay(&buf->b, dst)) {
         send_cb_finalize(cb, cb_data);
-    } else {
-        bt_mesh_adv_send(buf, cb, cb_data);
+        return 0;
+    }
     }
 
+    bt_mesh_adv_send(buf, cb, cb_data);
     return 0;
 }