SAR 配置客户端
SAR 配置客户端模型是 Bluetooth Mesh 规范定义的基础模型。它是一种可选型号,通过 CONFIG_BT_MESH_SAR_CFG_CLI
配置选项启用。
SAR 配置客户端模型在 Bluetooth Mesh 协议规范版本1.1中引入,它支持配置支持 SAR 配置服务器 模型的节点的较低传输层行为。
该模型可以使用 SAR 配置消息发送消息来查询或更改SAR配置服务器(SAR 发射机和 SAR 接收机)支持的状态。
SAR 发射机程序用于确定和配置 SAR 配置服务器的 SAR 发射机状态。函数调用 bt_mesh_sar_cfg_cli_transmitter_get()
和 bt_mesh _sar_cfg_cli_ttransmitter_set()
分别用于获取和设置目标节点的 SAR 发射机状态。
SAR 接收机过程用于确定和配置 SAR 配置服务器的 SAR 接收机状态。函数调用 bt_mesh_sar_cfg_cli_receiver_get()
和 bt_mesh _sar_cf _ cli_receivers_set()
分别用于获取和设置目标节点的 SAR 接收机状态。
有关这两个状态的详细信息,请参见 SAR 状态 。
元素可以随时发送任何 SAR 配置客户端消息,以查询或更改对等节点的 SAR 配置服务器模型支持的状态。SAR 配置客户端模型仅接受使用支持 SAR 配置服务器模型的节点的设备密钥加密的消息。
如果存在,SAR 配置客户端模型必须仅在主元素上实例化。
API 参考
- group bt_mesh_sar_cfg_cli
Bluetooth Mesh.
Defines
-
BT_MESH_MODEL_SAR_CFG_CLI(_cli)
SAR Configuration Client model composition data entry.
- 参数:
_cli – [in] Pointer to a Bluetooth Mesh SAR Configuration Client Model instance.
Functions
-
int bt_mesh_sar_cfg_cli_transmitter_get(uint16_t net_idx, uint16_t addr, struct bt_mesh_sar_tx *rsp)
Get the SAR Transmitter state of the target node.
- 参数:
net_idx – Network index to encrypt with.
addr – Target node address.
rsp – Status response parameter.
- 返回:
0 on success, or (negative) error code on failure.
-
int bt_mesh_sar_cfg_cli_transmitter_set(uint16_t net_idx, uint16_t addr, const struct bt_mesh_sar_tx *set, struct bt_mesh_sar_tx *rsp)
Set the SAR Transmitter state of the target node.
- 参数:
net_idx – Network index to encrypt with.
addr – Target node address.
set – New SAR Transmitter state to set on the target node.
rsp – Status response parameter.
- 返回:
0 on success, or (negative) error code on failure.
-
int bt_mesh_sar_cfg_cli_receiver_get(uint16_t net_idx, uint16_t addr, struct bt_mesh_sar_rx *rsp)
Get the SAR Receiver state of the target node.
- 参数:
net_idx – Network index to encrypt with.
addr – Target node address.
rsp – Status response parameter.
- 返回:
0 on success, or (negative) error code on failure.
-
int bt_mesh_sar_cfg_cli_receiver_set(uint16_t net_idx, uint16_t addr, const struct bt_mesh_sar_rx *set, struct bt_mesh_sar_rx *rsp)
Set the SAR Receiver state of the target node.
- 参数:
net_idx – Network index to encrypt with.
addr – Target node address.
set – New SAR Receiver state to set on the target node.
rsp – Status response parameter.
- 返回:
0 on success, or (negative) error code on failure.
-
int32_t bt_mesh_sar_cfg_cli_timeout_get(void)
Get the current transmission timeout value.
- 返回:
The configured transmission timeout in milliseconds.
-
void bt_mesh_sar_cfg_cli_timeout_set(int32_t timeout)
Set the transmission timeout value.
- 参数:
timeout – The new transmission timeout.
-
struct bt_mesh_sar_cfg_cli
Mesh SAR Configuration Client Model Context
Public Members
-
struct bt_mesh_model *model
Access model pointer.
-
struct bt_mesh_model *model
-
BT_MESH_MODEL_SAR_CFG_CLI(_cli)