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:
Michał Narajowski
2018-02-16 14:07:30 +01:00
parent ab275d8935
commit 287101bdaf
4 changed files with 13 additions and 9 deletions
+3
View File
@@ -39,3 +39,6 @@ pkg.deps.BLE_MESH_SHELL:
pkg.req_apis:
- log
- stats
pkg.init:
ble_mesh_shell_init: 1000
-4
View File
@@ -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
+9 -4
View File
@@ -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 -1
View File
@@ -1,6 +1,6 @@
#ifndef __SHELL_H__
#define __SHELL_H__
void mesh_shell_init(void);
void ble_mesh_shell_init(void);
#endif