mesh: Remove `bt_mesh_net_start`
Move `bt_mesh_net_start` functionality to `bt_mesh_start`
this is port of 627ee1125b808dc6bda427efca25f8fc73ff4fff
diff --git a/nimble/host/mesh/src/mesh.c b/nimble/host/mesh/src/mesh.c
index f289ce8..2f9d3e3 100644
--- a/nimble/host/mesh/src/mesh.c
+++ b/nimble/host/mesh/src/mesh.c
@@ -20,6 +20,7 @@
#include "prov.h"
#include "provisioner.h"
#include "net.h"
+#include "subnet.h"
#include "app_keys.h"
#include "rpl.h"
#include "beacon.h"
@@ -374,7 +375,34 @@
int bt_mesh_start(void)
{
- bt_mesh_net_start();
+ if (bt_mesh_beacon_get() == BT_MESH_BEACON_ENABLED) {
+ bt_mesh_beacon_enable();
+ } else {
+ bt_mesh_beacon_disable();
+ }
+
+ if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY) &&
+ bt_mesh_gatt_proxy_get() != BT_MESH_GATT_PROXY_NOT_SUPPORTED) {
+ bt_mesh_proxy_gatt_enable();
+ bt_mesh_adv_update();
+ }
+
+ if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER)) {
+ bt_mesh_lpn_init();
+ } else {
+ bt_mesh_scan_enable();
+ }
+
+ if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
+ bt_mesh_friend_init();
+ }
+
+ if (IS_ENABLED(CONFIG_BT_MESH_PROV)) {
+ struct bt_mesh_subnet *sub = bt_mesh_subnet_next(NULL);
+ uint16_t addr = bt_mesh_primary_addr();
+
+ bt_mesh_prov_complete(sub->net_idx, addr);
+ }
bt_mesh_model_foreach(model_start, NULL);
return 0;
diff --git a/nimble/host/mesh/src/net.c b/nimble/host/mesh/src/net.c
index 9aaf16e..09dc5a7 100644
--- a/nimble/host/mesh/src/net.c
+++ b/nimble/host/mesh/src/net.c
@@ -839,38 +839,6 @@
}
}
-void bt_mesh_net_start(void)
-{
- if (bt_mesh_beacon_get() == BT_MESH_BEACON_ENABLED) {
- bt_mesh_beacon_enable();
- } else {
- bt_mesh_beacon_disable();
- }
-
- if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY) &&
- bt_mesh_gatt_proxy_get() != BT_MESH_GATT_PROXY_NOT_SUPPORTED) {
- bt_mesh_proxy_gatt_enable();
- bt_mesh_adv_update();
- }
-
- if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER)) {
- bt_mesh_lpn_init();
- } else {
- bt_mesh_scan_enable();
- }
-
- if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
- bt_mesh_friend_init();
- }
-
- if (IS_ENABLED(CONFIG_BT_MESH_PROV)) {
- struct bt_mesh_subnet *sub = bt_mesh_subnet_next(NULL);
- uint16_t addr = bt_mesh_primary_addr();
-
- bt_mesh_prov_complete(sub->net_idx, addr);
- }
-}
-
void bt_mesh_net_init(void)
{
k_delayed_work_init(&bt_mesh.ivu_timer, ivu_refresh);
diff --git a/nimble/host/mesh/src/net.h b/nimble/host/mesh/src/net.h
index b3f2457..b1f0668 100644
--- a/nimble/host/mesh/src/net.h
+++ b/nimble/host/mesh/src/net.h
@@ -283,8 +283,6 @@
uint32_t bt_mesh_next_seq(void);
-void bt_mesh_net_start(void);
-
void bt_mesh_net_init(void);
void bt_mesh_net_header_parse(struct os_mbuf *buf,
struct bt_mesh_net_rx *rx);