Bluetooth: Mesh: Remove deprecated health API
Deprecated Health client and server API has been deprecated for two releases: 3.2.0 and 3.3.0. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
parent
2e53128d52
commit
08f4a82038
4 changed files with 0 additions and 332 deletions
|
@ -110,219 +110,6 @@ struct bt_mesh_health_cli {
|
||||||
BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_CLI, bt_mesh_health_cli_op, \
|
BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_HEALTH_CLI, bt_mesh_health_cli_op, \
|
||||||
&(cli_data)->pub, cli_data, &bt_mesh_health_cli_cb)
|
&(cli_data)->pub, cli_data, &bt_mesh_health_cli_cb)
|
||||||
|
|
||||||
/** @brief Set Health client model instance to use for communication.
|
|
||||||
*
|
|
||||||
* @param model Health Client model instance from the composition data.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_cli_set(struct bt_mesh_model *model);
|
|
||||||
|
|
||||||
/** @brief Get the registered fault state for the given Company ID.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p test_id
|
|
||||||
* and ( @p faults or @p fault_count ) as NULL This way the method
|
|
||||||
* will not wait for response and will return immediately after
|
|
||||||
* sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c fault_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @see bt_mesh_health_faults
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param cid Company ID to get the registered faults of.
|
|
||||||
* @param test_id Test ID response buffer.
|
|
||||||
* @param faults Fault array response buffer.
|
|
||||||
* @param fault_count Fault count response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_fault_get(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t *test_id, uint8_t *faults, size_t *fault_count);
|
|
||||||
|
|
||||||
/** @brief Clear the registered faults for the given Company ID.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p test_id
|
|
||||||
* and ( @p faults or @p fault_count ) as NULL This way the method
|
|
||||||
* will not wait for response and will return immediately after
|
|
||||||
* sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c fault_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @see bt_mesh_health_faults
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param cid Company ID to clear the registered faults for.
|
|
||||||
* @param test_id Test ID response buffer.
|
|
||||||
* @param faults Fault array response buffer.
|
|
||||||
* @param fault_count Fault count response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_fault_clear(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t *test_id, uint8_t *faults, size_t *fault_count);
|
|
||||||
|
|
||||||
/** @brief Clear the registered faults for the given Company ID (unacked).
|
|
||||||
*
|
|
||||||
* @see bt_mesh_health_faults
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param cid Company ID to clear the registered faults for.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_fault_clear_unack(uint16_t addr, uint16_t app_idx, uint16_t cid);
|
|
||||||
|
|
||||||
/** @brief Invoke a self-test procedure for the given Company ID.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p faults
|
|
||||||
* or @p fault_count as NULL This way the method will not wait
|
|
||||||
* for response and will return immediately after sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c fault_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param cid Company ID to invoke the test for.
|
|
||||||
* @param test_id Test ID response buffer.
|
|
||||||
* @param faults Fault array response buffer.
|
|
||||||
* @param fault_count Fault count response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_fault_test(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t test_id, uint8_t *faults, size_t *fault_count);
|
|
||||||
|
|
||||||
/** @brief Invoke a self-test procedure for the given Company ID (unacked).
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param cid Company ID to invoke the test for.
|
|
||||||
* @param test_id Test ID response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_fault_test_unack(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t test_id);
|
|
||||||
|
|
||||||
/** @brief Get the target node's Health fast period divisor.
|
|
||||||
*
|
|
||||||
* The health period divisor is used to increase the publish rate when a fault
|
|
||||||
* is registered. Normally, the Health server will publish with the period in
|
|
||||||
* the configured publish parameters. When a fault is registered, the publish
|
|
||||||
* period is divided by (1 << divisor). For example, if the target node's
|
|
||||||
* Health server is configured to publish with a period of 16 seconds, and the
|
|
||||||
* Health fast period divisor is 5, the Health server will publish with an
|
|
||||||
* interval of 500 ms when a fault is registered.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p divisor
|
|
||||||
* as NULL. This way the method will not wait for response and will
|
|
||||||
* return immediately after sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c period_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param divisor Health period divisor response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_period_get(uint16_t addr, uint16_t app_idx, uint8_t *divisor);
|
|
||||||
|
|
||||||
/** @brief Set the target node's Health fast period divisor.
|
|
||||||
*
|
|
||||||
* The health period divisor is used to increase the publish rate when a fault
|
|
||||||
* is registered. Normally, the Health server will publish with the period in
|
|
||||||
* the configured publish parameters. When a fault is registered, the publish
|
|
||||||
* period is divided by (1 << divisor). For example, if the target node's
|
|
||||||
* Health server is configured to publish with a period of 16 seconds, and the
|
|
||||||
* Health fast period divisor is 5, the Health server will publish with an
|
|
||||||
* interval of 500 ms when a fault is registered.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p updated_divisor
|
|
||||||
* as NULL. This way the method will not wait for response and will
|
|
||||||
* return immediately after sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c period_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param divisor New Health period divisor.
|
|
||||||
* @param updated_divisor Health period divisor response buffer.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_period_set(uint16_t addr, uint16_t app_idx, uint8_t divisor,
|
|
||||||
uint8_t *updated_divisor);
|
|
||||||
|
|
||||||
/** @brief Set the target node's Health fast period divisor (unacknowledged).
|
|
||||||
*
|
|
||||||
* This is an unacknowledged version of this API.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param divisor New Health period divisor.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_period_set_unack(uint16_t addr, uint16_t app_idx, uint8_t divisor);
|
|
||||||
|
|
||||||
/** @brief Get the current attention timer value.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p attention
|
|
||||||
* as NULL. This way the method will not wait for response and will
|
|
||||||
* return immediately after sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c attention_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param attention Attention timer response buffer, measured in seconds.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_attention_get(uint16_t addr, uint16_t app_idx, uint8_t *attention);
|
|
||||||
|
|
||||||
/** @brief Set the attention timer.
|
|
||||||
*
|
|
||||||
* This method can be used asynchronously by setting @p updated_attention
|
|
||||||
* as NULL. This way the method will not wait for response and will
|
|
||||||
* return immediately after sending the command.
|
|
||||||
*
|
|
||||||
* To process the response arguments of an async method, register
|
|
||||||
* the @c attention_status callback in @c bt_mesh_health_cli struct.
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param attention New attention timer time, in seconds.
|
|
||||||
* @param updated_attention Attention timer response buffer, measured in
|
|
||||||
* seconds.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_attention_set(uint16_t addr, uint16_t app_idx, uint8_t attention,
|
|
||||||
uint8_t *updated_attention);
|
|
||||||
|
|
||||||
/** @brief Set the attention timer (unacknowledged).
|
|
||||||
*
|
|
||||||
* @param addr Target node element address.
|
|
||||||
* @param app_idx Application index to encrypt with.
|
|
||||||
* @param attention New attention timer time, in seconds.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code on failure.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_health_attention_set_unack(uint16_t addr, uint16_t app_idx,
|
|
||||||
uint8_t attention);
|
|
||||||
|
|
||||||
/** @brief Get the registered fault state for the given Company ID.
|
/** @brief Get the registered fault state for the given Company ID.
|
||||||
*
|
*
|
||||||
* This method can be used asynchronously by setting @p test_id
|
* This method can be used asynchronously by setting @p test_id
|
||||||
|
|
|
@ -206,19 +206,6 @@ struct bt_mesh_health_srv {
|
||||||
#define BT_MESH_HEALTH_TEST_INFO(cid, tests...) \
|
#define BT_MESH_HEALTH_TEST_INFO(cid, tests...) \
|
||||||
(cid & 0xff), (cid >> 8), sizeof((uint8_t[]){ tests }), tests
|
(cid & 0xff), (cid >> 8), sizeof((uint8_t[]){ tests }), tests
|
||||||
|
|
||||||
|
|
||||||
/** @brief Notify the stack that the fault array state of the given element has
|
|
||||||
* changed.
|
|
||||||
*
|
|
||||||
* This prompts the Health server on this element to publish the current fault
|
|
||||||
* array if periodic publishing is disabled.
|
|
||||||
*
|
|
||||||
* @param elem Element to update the fault state of.
|
|
||||||
*
|
|
||||||
* @return 0 on success, or (negative) error code otherwise.
|
|
||||||
*/
|
|
||||||
__deprecated int bt_mesh_fault_update(struct bt_mesh_elem *elem);
|
|
||||||
|
|
||||||
/** @brief Notify the stack that the fault array state of the given element has
|
/** @brief Notify the stack that the fault array state of the given element has
|
||||||
* changed.
|
* changed.
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,8 +28,6 @@ LOG_MODULE_REGISTER(bt_mesh_health_cli);
|
||||||
|
|
||||||
static int32_t msg_timeout;
|
static int32_t msg_timeout;
|
||||||
|
|
||||||
static struct bt_mesh_health_cli *health_cli;
|
|
||||||
|
|
||||||
struct health_fault_param {
|
struct health_fault_param {
|
||||||
uint16_t cid;
|
uint16_t cid;
|
||||||
uint8_t *expect_test_id;
|
uint8_t *expect_test_id;
|
||||||
|
@ -189,91 +187,6 @@ const struct bt_mesh_model_op bt_mesh_health_cli_op[] = {
|
||||||
BT_MESH_MODEL_OP_END,
|
BT_MESH_MODEL_OP_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
int bt_mesh_health_attention_get(uint16_t addr, uint16_t app_idx, uint8_t *attention)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_attention_get(health_cli, &ctx, attention);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_attention_set(uint16_t addr, uint16_t app_idx,
|
|
||||||
uint8_t attention, uint8_t *updated_attention)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_attention_set(health_cli, &ctx, attention, updated_attention);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_attention_set_unack(uint16_t addr, uint16_t app_idx, uint8_t attention)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_attention_set_unack(health_cli, &ctx, attention);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_period_get(uint16_t addr, uint16_t app_idx, uint8_t *divisor)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_period_get(health_cli, &ctx, divisor);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_period_set(uint16_t addr, uint16_t app_idx, uint8_t divisor,
|
|
||||||
uint8_t *updated_divisor)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_period_set(health_cli, &ctx, divisor, updated_divisor);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_period_set_unack(uint16_t addr, uint16_t app_idx, uint8_t divisor)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_period_set_unack(health_cli, &ctx, divisor);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_fault_test(uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t test_id,
|
|
||||||
uint8_t *faults, size_t *fault_count)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_fault_test(health_cli, &ctx, cid, test_id, faults, fault_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_fault_test_unack(uint16_t addr, uint16_t app_idx, uint16_t cid, uint8_t test_id)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_fault_test_unack(health_cli, &ctx, cid, test_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_fault_clear(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t *test_id, uint8_t *faults,
|
|
||||||
size_t *fault_count)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_fault_clear(health_cli, &ctx, cid, test_id, faults, fault_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_fault_clear_unack(uint16_t addr, uint16_t app_idx,
|
|
||||||
uint16_t cid)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_fault_clear_unack(health_cli, &ctx, cid);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_fault_get(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|
||||||
uint8_t *test_id, uint8_t *faults,
|
|
||||||
size_t *fault_count)
|
|
||||||
{
|
|
||||||
struct bt_mesh_msg_ctx ctx = BT_MESH_MSG_CTX_INIT_APP(app_idx, addr);
|
|
||||||
|
|
||||||
return bt_mesh_health_cli_fault_get(health_cli, &ctx, cid, test_id, faults, fault_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_cli_attention_get(struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx,
|
int bt_mesh_health_cli_attention_get(struct bt_mesh_health_cli *cli, struct bt_mesh_msg_ctx *ctx,
|
||||||
uint8_t *attention)
|
uint8_t *attention)
|
||||||
{
|
{
|
||||||
|
@ -489,19 +402,6 @@ void bt_mesh_health_cli_timeout_set(int32_t timeout)
|
||||||
msg_timeout = timeout;
|
msg_timeout = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_mesh_health_cli_set(struct bt_mesh_model *model)
|
|
||||||
{
|
|
||||||
if (!model->user_data) {
|
|
||||||
LOG_ERR("No Health Client context for given model");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
health_cli = model->user_data;
|
|
||||||
msg_timeout = CONFIG_BT_MESH_HEALTH_CLI_TIMEOUT;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int health_cli_init(struct bt_mesh_model *model)
|
static int health_cli_init(struct bt_mesh_model *model)
|
||||||
{
|
{
|
||||||
struct bt_mesh_health_cli *cli = model->user_data;
|
struct bt_mesh_health_cli *cli = model->user_data;
|
||||||
|
@ -514,7 +414,6 @@ static int health_cli_init(struct bt_mesh_model *model)
|
||||||
}
|
}
|
||||||
|
|
||||||
cli->model = model;
|
cli->model = model;
|
||||||
health_cli = cli;
|
|
||||||
msg_timeout = CONFIG_BT_MESH_HEALTH_CLI_TIMEOUT;
|
msg_timeout = CONFIG_BT_MESH_HEALTH_CLI_TIMEOUT;
|
||||||
|
|
||||||
cli->pub.msg = &cli->pub_buf;
|
cli->pub.msg = &cli->pub_buf;
|
||||||
|
|
|
@ -384,11 +384,6 @@ static int health_pub_update(struct bt_mesh_model *mod)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bt_mesh_fault_update(struct bt_mesh_elem *elem)
|
|
||||||
{
|
|
||||||
return bt_mesh_health_srv_fault_update(elem);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_mesh_health_srv_fault_update(struct bt_mesh_elem *elem)
|
int bt_mesh_health_srv_fault_update(struct bt_mesh_elem *elem)
|
||||||
{
|
{
|
||||||
struct bt_mesh_model *mod;
|
struct bt_mesh_model *mod;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue