Bluetooth: Mesh: Fix Config/Health Client async API
The previous PR was not fully baked, so this PR fixes issues by: - Adding checks when dereferncing pointers stored in params. - Clearing ack context if a return argument is NULL to not block and wait for response. Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This commit is contained in:
parent
ff9d967832
commit
ef1fcd0e82
4 changed files with 396 additions and 25 deletions
|
@ -56,6 +56,10 @@ int bt_mesh_cfg_node_reset(uint16_t net_idx, uint16_t addr, bool *status);
|
|||
* return the largest page number it supports that is less than the requested
|
||||
* page index. The actual page the device responds with is returned in @c rsp.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p rsp and @p comp
|
||||
* as NULL. This way the method will not wait for response and will return
|
||||
* immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param page Composition data page, or 0xff to request the first available
|
||||
|
@ -69,6 +73,10 @@ int bt_mesh_cfg_comp_data_get(uint16_t net_idx, uint16_t addr, uint8_t page,
|
|||
uint8_t *rsp, struct net_buf_simple *comp);
|
||||
|
||||
/** @brief Get the target node's network beacon state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -81,6 +89,11 @@ int bt_mesh_cfg_comp_data_get(uint16_t net_idx, uint16_t addr, uint8_t page,
|
|||
int bt_mesh_cfg_beacon_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's network key refresh phase state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and @p phase
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param key_net_idx Network key index.
|
||||
|
@ -93,6 +106,11 @@ int bt_mesh_cfg_krp_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
|
|||
uint8_t *status, uint8_t *phase);
|
||||
|
||||
/** @brief Set the target node's network key refresh phase parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and @p phase
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param key_net_idx Network key index.
|
||||
|
@ -107,6 +125,10 @@ int bt_mesh_cfg_krp_set(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
|
|||
uint8_t transition, uint8_t *status, uint8_t *phase);
|
||||
|
||||
/** @brief Set the target node's network beacon state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -121,6 +143,10 @@ int bt_mesh_cfg_krp_set(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx,
|
|||
int bt_mesh_cfg_beacon_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's Time To Live value.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p ttl
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -131,6 +157,10 @@ int bt_mesh_cfg_beacon_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t
|
|||
int bt_mesh_cfg_ttl_get(uint16_t net_idx, uint16_t addr, uint8_t *ttl);
|
||||
|
||||
/** @brief Set the target node's Time To Live value.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p ttl
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -142,6 +172,10 @@ int bt_mesh_cfg_ttl_get(uint16_t net_idx, uint16_t addr, uint8_t *ttl);
|
|||
int bt_mesh_cfg_ttl_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *ttl);
|
||||
|
||||
/** @brief Get the target node's Friend feature status.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -154,6 +188,10 @@ int bt_mesh_cfg_ttl_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *t
|
|||
int bt_mesh_cfg_friend_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
|
||||
|
||||
/** @brief Set the target node's Friend feature state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -169,6 +207,10 @@ int bt_mesh_cfg_friend_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
|
|||
int bt_mesh_cfg_friend_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's Proxy feature state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -182,6 +224,10 @@ int bt_mesh_cfg_friend_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t
|
|||
int bt_mesh_cfg_gatt_proxy_get(uint16_t net_idx, uint16_t addr, uint8_t *status);
|
||||
|
||||
/** @brief Set the target node's Proxy feature state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -199,6 +245,10 @@ int bt_mesh_cfg_gatt_proxy_set(uint16_t net_idx, uint16_t addr, uint8_t val,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's network_transmit state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p transmit
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -212,6 +262,10 @@ int bt_mesh_cfg_net_transmit_get(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *transmit);
|
||||
|
||||
/** @brief Set the target node's network transmit parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p transmit
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -226,6 +280,10 @@ int bt_mesh_cfg_net_transmit_set(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t val, uint8_t *transmit);
|
||||
|
||||
/** @brief Get the target node's Relay feature state.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and @p transmit
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -242,6 +300,10 @@ int bt_mesh_cfg_relay_get(uint16_t net_idx, uint16_t addr, uint8_t *status,
|
|||
uint8_t *transmit);
|
||||
|
||||
/** @brief Set the target node's Relay parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p transmit as NULL. This way the method will not wait for
|
||||
* response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -264,6 +326,10 @@ int bt_mesh_cfg_relay_set(uint16_t net_idx, uint16_t addr, uint8_t new_relay,
|
|||
uint8_t new_transmit, uint8_t *status, uint8_t *transmit);
|
||||
|
||||
/** @brief Add a network key to the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -277,6 +343,10 @@ int bt_mesh_cfg_net_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_id
|
|||
const uint8_t net_key[16], uint8_t *status);
|
||||
|
||||
/** @brief Get a list of the target node's network key indexes.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p keys
|
||||
* or @p key_cnt as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -292,6 +362,10 @@ int bt_mesh_cfg_net_key_get(uint16_t net_idx, uint16_t addr, uint16_t *keys,
|
|||
size_t *key_cnt);
|
||||
|
||||
/** @brief Delete a network key from the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -304,6 +378,10 @@ int bt_mesh_cfg_net_key_del(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t key_net_idx, uint8_t *status);
|
||||
|
||||
/** @brief Add an application key to the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -321,6 +399,10 @@ int bt_mesh_cfg_app_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_id
|
|||
/** @brief Get a list of the target node's application key indexes for a
|
||||
* specific network key.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and
|
||||
* ( @p keys or @p key_cnt ) as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param key_net_idx Network key index to request the app key indexes of.
|
||||
|
@ -340,6 +422,10 @@ int bt_mesh_cfg_app_key_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_id
|
|||
|
||||
|
||||
/** @brief Delete an application key from the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -353,6 +439,10 @@ int bt_mesh_cfg_app_key_del(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t key_net_idx, uint16_t key_app_idx, uint8_t *status);
|
||||
|
||||
/** @brief Bind an application to a SIG model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -367,6 +457,10 @@ int bt_mesh_cfg_mod_app_bind(uint16_t net_idx, uint16_t addr, uint16_t elem_addr
|
|||
uint16_t mod_app_idx, uint16_t mod_id, uint8_t *status);
|
||||
|
||||
/** @brief Unbind an application from a SIG model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -382,6 +476,10 @@ int bt_mesh_cfg_mod_app_unbind(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t mod_id, uint8_t *status);
|
||||
|
||||
/** @brief Bind an application to a vendor model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -398,6 +496,10 @@ int bt_mesh_cfg_mod_app_bind_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Unbind an application from a vendor model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response and will
|
||||
* return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -416,6 +518,10 @@ int bt_mesh_cfg_mod_app_unbind_vnd(uint16_t net_idx, uint16_t addr,
|
|||
/** @brief Get a list of all applications bound to a SIG model on the target
|
||||
* node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and ( @p apps or @p app_cnt ) as NULL. This way the method will
|
||||
* not wait for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param elem_addr Element address the model is in.
|
||||
|
@ -437,6 +543,10 @@ int bt_mesh_cfg_mod_app_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
/** @brief Get a list of all applications bound to a vendor model on the target
|
||||
* node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and ( @p apps or @p app_cnt ) as NULL. This way the method will
|
||||
* not wait for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param elem_addr Element address the model is in.
|
||||
|
@ -524,6 +634,10 @@ struct bt_mesh_cfg_mod_pub {
|
|||
};
|
||||
|
||||
/** @brief Get publish parameters for a SIG model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and
|
||||
* @p pub as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -539,6 +653,10 @@ int bt_mesh_cfg_mod_pub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Get publish parameters for a vendor model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p pub as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -555,6 +673,12 @@ int bt_mesh_cfg_mod_pub_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_a
|
|||
struct bt_mesh_cfg_mod_pub *pub, uint8_t *status);
|
||||
|
||||
/** @brief Set publish parameters for a SIG model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @p pub shall not be NULL.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -570,6 +694,12 @@ int bt_mesh_cfg_mod_pub_set(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Set publish parameters for a vendor model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @p pub shall not be NULL.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -586,6 +716,10 @@ int bt_mesh_cfg_mod_pub_set_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_a
|
|||
struct bt_mesh_cfg_mod_pub *pub, uint8_t *status);
|
||||
|
||||
/** @brief Add a group address to a SIG model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -600,6 +734,10 @@ int bt_mesh_cfg_mod_sub_add(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
uint16_t sub_addr, uint16_t mod_id, uint8_t *status);
|
||||
|
||||
/** @brief Add a group address to a vendor model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -616,6 +754,10 @@ int bt_mesh_cfg_mod_sub_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_a
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Delete a group address in a SIG model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -630,6 +772,10 @@ int bt_mesh_cfg_mod_sub_del(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
uint16_t sub_addr, uint16_t mod_id, uint8_t *status);
|
||||
|
||||
/** @brief Delete a group address in a vendor model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -651,6 +797,10 @@ int bt_mesh_cfg_mod_sub_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_a
|
|||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param elem_addr Element address the model is in.
|
||||
|
@ -669,6 +819,10 @@ int bt_mesh_cfg_mod_sub_overwrite(uint16_t net_idx, uint16_t addr, uint16_t elem
|
|||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param elem_addr Element address the model is in.
|
||||
|
@ -684,6 +838,10 @@ int bt_mesh_cfg_mod_sub_overwrite_vnd(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t mod_id, uint16_t cid, uint8_t *status);
|
||||
|
||||
/** @brief Add a virtual address to a SIG model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -700,6 +858,10 @@ int bt_mesh_cfg_mod_sub_va_add(uint16_t net_idx, uint16_t addr, uint16_t elem_ad
|
|||
uint16_t *virt_addr, uint8_t *status);
|
||||
|
||||
/** @brief Add a virtual address to a vendor model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -717,6 +879,10 @@ int bt_mesh_cfg_mod_sub_va_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t ele
|
|||
uint16_t cid, uint16_t *virt_addr, uint8_t *status);
|
||||
|
||||
/** @brief Delete a virtual address in a SIG model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -733,6 +899,10 @@ int bt_mesh_cfg_mod_sub_va_del(uint16_t net_idx, uint16_t addr, uint16_t elem_ad
|
|||
uint16_t *virt_addr, uint8_t *status);
|
||||
|
||||
/** @brief Delete a virtual address in a vendor model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -750,10 +920,14 @@ int bt_mesh_cfg_mod_sub_va_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t ele
|
|||
uint16_t cid, uint16_t *virt_addr, uint8_t *status);
|
||||
|
||||
/** @brief Overwrite all addresses in a SIG model's subscription list with a
|
||||
* virtual address.
|
||||
* virtual address.
|
||||
*
|
||||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -771,10 +945,14 @@ int bt_mesh_cfg_mod_sub_va_overwrite(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Overwrite all addresses in a vendor model's subscription list with a
|
||||
* virtual address.
|
||||
* virtual address.
|
||||
*
|
||||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
* Deletes all subscriptions in the model's subscription list, and adds a
|
||||
* single group address instead.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p virt_addr as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -793,6 +971,10 @@ int bt_mesh_cfg_mod_sub_va_overwrite_vnd(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t *virt_addr, uint8_t *status);
|
||||
|
||||
/** @brief Get the subscription list of a SIG model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and
|
||||
* ( @p subs or @p sub_cnt ) as NULL. This way the method will
|
||||
* not wait for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -812,6 +994,10 @@ int bt_mesh_cfg_mod_sub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr,
|
|||
size_t *sub_cnt);
|
||||
|
||||
/** @brief Get the subscription list of a vendor model on the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status and
|
||||
* ( @p subs or @p sub_cnt ) as NULL. This way the method will
|
||||
* not wait for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -870,6 +1056,12 @@ struct bt_mesh_cfg_hb_sub {
|
|||
};
|
||||
|
||||
/** @brief Set the target node's Heartbeat subscription parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @p sub shall not be null.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -882,6 +1074,10 @@ int bt_mesh_cfg_hb_sub_set(uint16_t net_idx, uint16_t addr,
|
|||
struct bt_mesh_cfg_hb_sub *sub, uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's Heartbeta subscription parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p sub as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -932,6 +1128,12 @@ struct bt_mesh_cfg_hb_pub {
|
|||
*
|
||||
* @note The target node must already have received the specified network key.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @p pub shall not be NULL;
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
* @param pub New Heartbeat publication parameters.
|
||||
|
@ -943,6 +1145,10 @@ int bt_mesh_cfg_hb_pub_set(uint16_t net_idx, uint16_t addr,
|
|||
const struct bt_mesh_cfg_hb_pub *pub, uint8_t *status);
|
||||
|
||||
/** @brief Get the target node's Heartbeat publication parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p pub as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -955,6 +1161,10 @@ int bt_mesh_cfg_hb_pub_get(uint16_t net_idx, uint16_t addr,
|
|||
struct bt_mesh_cfg_hb_pub *pub, uint8_t *status);
|
||||
|
||||
/** @brief Delete all group addresses in a SIG model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -969,6 +1179,10 @@ int bt_mesh_cfg_mod_sub_del_all(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Delete all group addresses in a vendor model's subscription list.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -984,6 +1198,10 @@ int bt_mesh_cfg_mod_sub_del_all_vnd(uint16_t net_idx, uint16_t addr,
|
|||
uint16_t cid, uint8_t *status);
|
||||
|
||||
/** @brief Update a network key to the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -998,6 +1216,10 @@ int bt_mesh_cfg_net_key_update(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *status);
|
||||
|
||||
/** @brief Update an application key to the target node.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -1013,6 +1235,10 @@ int bt_mesh_cfg_app_key_update(uint16_t net_idx, uint16_t addr,
|
|||
const uint8_t app_key[16], uint8_t *status);
|
||||
|
||||
/** @brief Set the Node Identity parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p identity as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -1030,6 +1256,10 @@ int bt_mesh_cfg_node_identity_set(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *status, uint8_t *identity);
|
||||
|
||||
/** @brief Get the Node Identity parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p status
|
||||
* and @p identity as NULL. This way the method will not wait
|
||||
* for response and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
@ -1046,6 +1276,10 @@ int bt_mesh_cfg_node_identity_get(uint16_t net_idx, uint16_t addr,
|
|||
uint8_t *identity);
|
||||
|
||||
/** @brief Get the Low Power Node Polltimeout parameters.
|
||||
*
|
||||
* This method can be used asynchronously by setting @p polltimeout
|
||||
* as NULL. This way the method will not wait for response
|
||||
* and will return immediately after sending the command.
|
||||
*
|
||||
* @param net_idx Network index to encrypt with.
|
||||
* @param addr Target node address.
|
||||
|
|
|
@ -111,6 +111,14 @@ struct bt_mesh_health_cli {
|
|||
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
|
||||
*
|
||||
|
@ -128,6 +136,14 @@ int bt_mesh_health_fault_get(uint16_t addr, uint16_t app_idx, uint16_t cid,
|
|||
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
|
||||
*
|
||||
|
@ -158,6 +174,13 @@ 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.
|
||||
|
@ -194,6 +217,13 @@ int bt_mesh_health_fault_test_unack(uint16_t addr, uint16_t app_idx,
|
|||
* 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.
|
||||
|
@ -213,6 +243,13 @@ int bt_mesh_health_period_get(uint16_t addr, uint16_t app_idx,
|
|||
* 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.
|
||||
|
@ -237,6 +274,13 @@ 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.
|
||||
|
@ -248,6 +292,13 @@ 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue