mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-01 04:57:22 +00:00
mesh: Remove bt_mesh_net_start
Move `bt_mesh_net_start` functionality to `bt_mesh_start` this is port of 627ee1125b808dc6bda427efca25f8fc73ff4fff
This commit is contained in:
committed by
Łukasz Rymanowski
parent
4d5a103af5
commit
61c3b30593
@@ -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 @@ static void model_start(struct bt_mesh_model *mod, struct bt_mesh_elem *elem,
|
||||
|
||||
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;
|
||||
|
||||
@@ -839,38 +839,6 @@ static void ivu_refresh(struct ble_npl_event *work)
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -283,8 +283,6 @@ void bt_mesh_net_loopback_clear(uint16_t net_idx);
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user