mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-06 06:47:21 +00:00
mesh: Initialize shell on sysinit
This is needed, because mesh-shell has commands to initialize mesh, so the shell should not be initialized during mesh init. X-Original-Commit: dc3dc40af95ca271ba9aa51f1c4416d5cebe775a
This commit is contained in:
@@ -39,3 +39,6 @@ pkg.deps.BLE_MESH_SHELL:
|
||||
pkg.req_apis:
|
||||
- log
|
||||
- stats
|
||||
|
||||
pkg.init:
|
||||
ble_mesh_shell_init: 1000
|
||||
|
||||
@@ -246,10 +246,6 @@ int bt_mesh_init(uint8_t own_addr_type, const struct bt_mesh_prov *prov,
|
||||
bt_mesh_beacon_enable();
|
||||
#endif
|
||||
|
||||
#if (MYNEWT_VAL(BLE_MESH_SHELL))
|
||||
mesh_shell_init();
|
||||
#endif
|
||||
|
||||
#if (MYNEWT_VAL(BLE_MESH_PB_GATT))
|
||||
bt_mesh_proxy_prov_enable();
|
||||
#endif
|
||||
|
||||
@@ -193,7 +193,7 @@ static struct bt_mesh_health_cli health_cli = {
|
||||
.current_status = health_current_status,
|
||||
};
|
||||
|
||||
static u8_t dev_uuid[16] = { 0xdd, 0xdd };
|
||||
static u8_t dev_uuid[16] = MYNEWT_VAL(BLE_MESH_DEV_UUID);
|
||||
|
||||
static struct bt_mesh_model root_models[] = {
|
||||
BT_MESH_MODEL_CFG_SRV(&cfg_srv),
|
||||
@@ -2108,11 +2108,16 @@ static const struct shell_cmd mesh_commands[] = {
|
||||
|
||||
{ NULL, NULL, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
void mesh_shell_init(void)
|
||||
void ble_mesh_shell_init(void)
|
||||
{
|
||||
#if !(MYNEWT_VAL(BLE_MESH_SHELL))
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* Initialize health pub message */
|
||||
health_pub_init();
|
||||
|
||||
shell_register("mesh", mesh_commands);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef __SHELL_H__
|
||||
#define __SHELL_H__
|
||||
|
||||
void mesh_shell_init(void);
|
||||
void ble_mesh_shell_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user