Bluetooth: Mesh: Moved composition data out of mesh shell

The mesh shell module owns the composition data for the shell
application, which makes it impossible to use it outside of the
application itself. To support the shell as a generic debugging
component that can be added to any application, we have moved the
composition data out of shell.c, and into the application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
This commit is contained in:
Ingar Kulbrandstad 2021-05-14 10:37:32 +02:00 committed by Christopher Friedt
commit 59d5ef1e24
5 changed files with 227 additions and 121 deletions

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_
#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_
#include <bluetooth/mesh.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Maximum number of faults the health server can have. */
#define BT_MESH_SHELL_CUR_FAULTS_MAX 4
/** @def BT_MESH_SHELL_HEALTH_PUB_DEFINE
*
* A helper to define a health publication context for shell with the shell's
* maximum number of faults the element can have.
*
* @param _name Name given to the publication context variable.
*/
#define BT_MESH_SHELL_HEALTH_PUB_DEFINE(_name) \
BT_MESH_HEALTH_PUB_DEFINE(_name, \
BT_MESH_SHELL_CUR_FAULTS_MAX);
/** @brief External reference to health server */
extern struct bt_mesh_health_srv bt_mesh_shell_health_srv;
/** @brief External reference to health client */
extern struct bt_mesh_health_cli bt_mesh_shell_health_cli;
/** @brief External reference to provisioning handler. */
extern struct bt_mesh_prov bt_mesh_shell_prov;
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_SHELL_H_ */