TuyaOS
函数
tkl_bluetooth_mesh_device.h 文件参考

This is tuya tal_adc file 更多...

#include "tkl_bluetooth_mesh_def.h"
tkl_bluetooth_mesh_device.h 的引用(Include)关系图:

浏览源代码.

函数

OPERATE_RET tkl_mesh_access_normal_data_send (USHORT_T src_addr, USHORT_T dst_addr, UINT_T opcode, UCHAR_T *data, USHORT_T data_len, USHORT_T appkey_idx)
 Send mesh data to unicast/group addr. 更多...
 
OPERATE_RET tkl_mesh_access_rsp_data_send (USHORT_T src_addr, USHORT_T dst_addr, UINT_T opcode, UCHAR_T *data, USHORT_T data_len)
 Send mesh data to unicast/group addr. 更多...
 
VOID tkl_mesh_composition_data_set (USHORT_T company_id, USHORT_T product_id, USHORT_T version_id)
 Init the mesh node composition data(head). 更多...
 
VOID tkl_mesh_device_key_get (UCHAR_T *key)
 get the mesh node device key. 更多...
 
VOID tkl_mesh_device_key_update (UCHAR_T *key)
 Set the mesh node device key. 更多...
 
OPERATE_RET tkl_mesh_element_register (USHORT_T element_index)
 Function to register a elemennt. 更多...
 
UCHAR_T tkl_mesh_get_if_prov_success (VOID)
 Get the mesh node provision state. 更多...
 
USHORT_T * tkl_mesh_group_addr_sub_list_get (USHORT_T ele_idx, UINT_T model_id)
 Function to get the subscribe addr list of a model of the element. 更多...
 
OPERATE_RET tkl_mesh_group_addr_sub_set (USHORT_T opcode, USHORT_T ele_addr, USHORT_T sub_addr, UINT_T model_id)
 Function to subscribe a group address for a model of the element. 更多...
 
VOID tkl_mesh_mode_identity_set (VOID)
 Set the node PB-GATT ADV use identity type. 更多...
 
OPERATE_RET tkl_mesh_model_appkey_bind_all (UINT16_T appkey_idx)
 Bind all the model use the appkey index input. 更多...
 
OPERATE_RET tkl_mesh_model_register (UCHAR_T element_index, TKL_MESH_MODEL_HADLE_T *pmodel_info)
 Function to register a model into the element. 更多...
 
OPERATE_RET tkl_mesh_net_state_cb_register (TKL_MESH_NET_STATE_CB_T mesh_net_state_cb)
 Function to register a mesh net state callback into tkl. 更多...
 
VOID tkl_mesh_network_recover (VOID)
 Recover the mesh node into provision state. Node recover into provision state with the network parameters in flash. 更多...
 
VOID tkl_mesh_network_relay_retransmit_get (UCHAR_T *cnt, UCHAR_T *step)
 Get the network layer retransmit parameters. 更多...
 
VOID tkl_mesh_network_relay_retransmit_set (UCHAR_T cnt, UCHAR_T step)
 Set the network layer relay retransmit parameters. 更多...
 
VOID tkl_mesh_network_reset (VOID)
 Reset the mesh node into unprovision state. The unprovision state should store in flash,and the clear the network parameters. 更多...
 
VOID tkl_mesh_network_reset_in_ram (VOID)
 Reset the mesh node into unprovision state. The unprovision state only keep in ram,and must not clear the network parameters. 更多...
 
VOID tkl_mesh_network_transmit_get (UCHAR_T *cnt, UCHAR_T *step)
 Get the network layer retransmit parameters. 更多...
 
VOID tkl_mesh_network_transmit_set (UCHAR_T cnt, UCHAR_T step)
 Set the network layer retransmit parameters. 更多...
 
UCHAR_T tkl_mesh_node_default_ttl_get (void)
 Get the node defalut ttl. 更多...
 
OPERATE_RET tkl_mesh_node_default_ttl_set (UCHAR_T ttl)
 Set the node defalut ttl. 更多...
 
UCHAR_T tkl_mesh_node_features_get (MESH_FEATURE_T featrue)
 Get the node feature. 更多...
 
OPERATE_RET tkl_mesh_node_features_set (MESH_FEATURE_T featrue, UCHAR_T enable)
 Set the node feature. 更多...
 
VOID tkl_mesh_node_param_save_all (VOID)
 Save all mesh param into flash. 更多...
 
VOID tkl_mesh_node_pbgatt_adv_enable (UCHAR_T enable)
 Close the mesh node gatt adv. Only use in unprovision state. 更多...
 
VOID tkl_mesh_node_unprovision_beacon_enable (UCHAR_T enable)
 Close the mesh node mesh beacon. Only use in unprovision state. 更多...
 
USHORT_T tkl_mesh_primary_ele_addr_get (VOID)
 Get the mesh node primary element address. 更多...
 
VOID tkl_mesh_primary_ele_addr_set (USHORT_T addr, int flash_save_en)
 Set the mesh node primary element address. 更多...
 
OPERATE_RET tkl_mesh_provision_data_set (UCHAR_T prov_en, TKL_NET_PROV_DATA_T *prov_data, TKL_APP_KEY_DATA_T *app_key)
 Update the mesh network provision data and the app key data. Use this function node can provision itself into provision state. 更多...
 
VOID tkl_mesh_seq_cache_reset (USHORT_T addr)
 Reset the seq cache. 更多...
 
VOID tkl_mesh_uuid_set (UCHAR_T *uuid)
 Init the mesh node uuid. 更多...
 

详细描述

This is tuya tal_adc file

版本
1.0
日期
2021-09-10

函数说明

◆ tkl_mesh_access_normal_data_send()

OPERATE_RET tkl_mesh_access_normal_data_send ( USHORT_T  src_addr,
USHORT_T  dst_addr,
UINT_T  opcode,
UCHAR_T *  data,
USHORT_T  data_len,
USHORT_T  appkey_idx 
)

Send mesh data to unicast/group addr.

参数
[in]src_addrelement addr of node
[in]dst_addrdestinat addr
[in]opcodemesh op code
[in]datadata point
[in]data_lendata point
[in]appkey_idxuse which appkey index
返回
tx result

◆ tkl_mesh_access_rsp_data_send()

OPERATE_RET tkl_mesh_access_rsp_data_send ( USHORT_T  src_addr,
USHORT_T  dst_addr,
UINT_T  opcode,
UCHAR_T *  data,
USHORT_T  data_len 
)

Send mesh data to unicast/group addr.

参数
[in]src_addrelement addr of node
[in]dst_addrdestinat addr
[in]opcodemesh op code
[in]datadata point
[in]data_lendata point
返回
tx result

◆ tkl_mesh_composition_data_set()

VOID tkl_mesh_composition_data_set ( USHORT_T  company_id,
USHORT_T  product_id,
USHORT_T  version_id 
)

Init the mesh node composition data(head).

参数
[in]company_idcompany identifier assigned by the Bluetooth SIG
[in]product_idproduct identifier
[in]version_idproduct version identifier
返回
NULL

◆ tkl_mesh_device_key_get()

VOID tkl_mesh_device_key_get ( UCHAR_T *  key)

get the mesh node device key.

参数
[in]keypoint of device key
返回
NULL

◆ tkl_mesh_device_key_update()

VOID tkl_mesh_device_key_update ( UCHAR_T *  key)

Set the mesh node device key.

参数
[in]keypoint of device key
返回
NULL

◆ tkl_mesh_element_register()

OPERATE_RET tkl_mesh_element_register ( USHORT_T  element_index)

Function to register a elemennt.

参数
[in]element_indexindex of element
返回
SUCCESS ERROR

◆ tkl_mesh_get_if_prov_success()

UCHAR_T tkl_mesh_get_if_prov_success ( VOID  )

Get the mesh node provision state.

返回
the provision state

◆ tkl_mesh_group_addr_sub_list_get()

USHORT_T * tkl_mesh_group_addr_sub_list_get ( USHORT_T  ele_idx,
UINT_T  model_id 
)

Function to get the subscribe addr list of a model of the element.

参数
[in]ele_indexthe index of element
[in]group_addrgroup address
返回
subscribe addr list

◆ tkl_mesh_group_addr_sub_set()

OPERATE_RET tkl_mesh_group_addr_sub_set ( USHORT_T  opcode,
USHORT_T  ele_addr,
USHORT_T  sub_addr,
UINT_T  model_id 
)

Function to subscribe a group address for a model of the element.

参数
[in]opcodeto indicate subscribe or delete
[in]ele_indexthe index of element
[in]group_addrgroup address
返回
SUCCESS ERROR INSUFFICIENT_RESOURCES

◆ tkl_mesh_mode_identity_set()

VOID tkl_mesh_mode_identity_set ( VOID  )

Set the node PB-GATT ADV use identity type.

返回
NULL

◆ tkl_mesh_model_appkey_bind_all()

OPERATE_RET tkl_mesh_model_appkey_bind_all ( UINT16_T  appkey_idx)

Bind all the model use the appkey index input.

参数
[in]appkey_idxapp key index
返回
SUCCESS ERROR

◆ tkl_mesh_model_register()

OPERATE_RET tkl_mesh_model_register ( UCHAR_T  element_index,
TKL_MESH_MODEL_HADLE_T pmodel_info 
)

Function to register a model into the element.

参数
[in]element_indexindex of element
[in]pmodel_infomodel information
返回
SUCCESS ERROR

◆ tkl_mesh_net_state_cb_register()

OPERATE_RET tkl_mesh_net_state_cb_register ( TKL_MESH_NET_STATE_CB_T  mesh_net_state_cb)

Function to register a mesh net state callback into tkl.

参数
[in]TKL_MESH_NET_STATE_CB_Tcallback
返回
SUCCESS ERROR

◆ tkl_mesh_network_recover()

VOID tkl_mesh_network_recover ( VOID  )

Recover the mesh node into provision state. Node recover into provision state with the network parameters in flash.

返回
NULL

◆ tkl_mesh_network_relay_retransmit_get()

VOID tkl_mesh_network_relay_retransmit_get ( UCHAR_T *  cnt,
UCHAR_T *  step 
)

Get the network layer retransmit parameters.

参数
[out]cnttransmit cnt = (cnt + 1) times
[out]stepretransmission interval = (net_trans_steps + 1) * 10ms
返回
NULL

◆ tkl_mesh_network_relay_retransmit_set()

VOID tkl_mesh_network_relay_retransmit_set ( UCHAR_T  cnt,
UCHAR_T  step 
)

Set the network layer relay retransmit parameters.

参数
[in]cnttransmit cnt = (cnt + 1) times
[in]stepretransmission interval = (net_trans_steps + 1) * 10ms
返回
NULL

◆ tkl_mesh_network_reset()

VOID tkl_mesh_network_reset ( VOID  )

Reset the mesh node into unprovision state. The unprovision state should store in flash,and the clear the network parameters.

返回
NULL

◆ tkl_mesh_network_reset_in_ram()

VOID tkl_mesh_network_reset_in_ram ( VOID  )

Reset the mesh node into unprovision state. The unprovision state only keep in ram,and must not clear the network parameters.

返回
NULL

◆ tkl_mesh_network_transmit_get()

VOID tkl_mesh_network_transmit_get ( UCHAR_T *  cnt,
UCHAR_T *  step 
)

Get the network layer retransmit parameters.

参数
[out]cnttransmit cnt = (cnt + 1) times
[out]stepretransmission interval = (net_trans_steps + 1) * 10ms
返回
NULL

◆ tkl_mesh_network_transmit_set()

VOID tkl_mesh_network_transmit_set ( UCHAR_T  cnt,
UCHAR_T  step 
)

Set the network layer retransmit parameters.

参数
[in]cnttransmit cnt = (cnt + 1) times
[in]stepretransmission interval = (net_trans_steps + 1) * 10ms
返回
NULL

◆ tkl_mesh_node_default_ttl_get()

UCHAR_T tkl_mesh_node_default_ttl_get ( void  )

Get the node defalut ttl.

返回
ttl

◆ tkl_mesh_node_default_ttl_set()

OPERATE_RET tkl_mesh_node_default_ttl_set ( UCHAR_T  ttl)

Set the node defalut ttl.

参数
[in]ttl(timeto live).
返回
SUCCESS ERROR

◆ tkl_mesh_node_features_get()

UCHAR_T tkl_mesh_node_features_get ( MESH_FEATURE_T  featrue)

Get the node feature.

参数
[in]featrueRelay, proxy, friend or Low Power.
返回
Enable : 1 Disable : 0

◆ tkl_mesh_node_features_set()

OPERATE_RET tkl_mesh_node_features_set ( MESH_FEATURE_T  featrue,
UCHAR_T  enable 
)

Set the node feature.

参数
[in]featrueRelay, proxy, friend or Low Power.
[in]enableEnable or Disable
返回
SUCCESS ERROR

◆ tkl_mesh_node_param_save_all()

VOID tkl_mesh_node_param_save_all ( VOID  )

Save all mesh param into flash.

返回
ttl

◆ tkl_mesh_node_pbgatt_adv_enable()

VOID tkl_mesh_node_pbgatt_adv_enable ( UCHAR_T  enable)

Close the mesh node gatt adv. Only use in unprovision state.

参数
[in]enableenable or disable the adv
返回
NULL

◆ tkl_mesh_node_unprovision_beacon_enable()

VOID tkl_mesh_node_unprovision_beacon_enable ( UCHAR_T  enable)

Close the mesh node mesh beacon. Only use in unprovision state.

参数
[in]enableenable or disable the adv
返回
NULL

◆ tkl_mesh_primary_ele_addr_get()

USHORT_T tkl_mesh_primary_ele_addr_get ( VOID  )

Get the mesh node primary element address.

返回
the primary element address

◆ tkl_mesh_primary_ele_addr_set()

VOID tkl_mesh_primary_ele_addr_set ( USHORT_T  addr,
int  flash_save_en 
)

Set the mesh node primary element address.

参数
[in]addrunicast address
[in]flash_save_ensave in flash or only update in ram
返回
NULL

◆ tkl_mesh_provision_data_set()

OPERATE_RET tkl_mesh_provision_data_set ( UCHAR_T  prov_en,
TKL_NET_PROV_DATA_T *  prov_data,
TKL_APP_KEY_DATA_T *  app_key 
)

Update the mesh network provision data and the app key data. Use this function node can provision itself into provision state.

参数
[in]prov_en0 device is unprovision state, only update in ram 1 device is provisioned state, save in flash
[in]prov_datanetwork provision data
[in]app_keyapp key data
返回
SUCCESS ERROR

◆ tkl_mesh_seq_cache_reset()

VOID tkl_mesh_seq_cache_reset ( USHORT_T  addr)

Reset the seq cache.

参数
[in]addrthe src addr
返回
NULL

◆ tkl_mesh_uuid_set()

VOID tkl_mesh_uuid_set ( UCHAR_T *  uuid)

Init the mesh node uuid.

参数
[in]uuidmesh universally unique identifier
返回
NULL