主题中讨论的其他部件:Sysconfig、 ENERGYTRACE
工具/软件:
在 ZBOOS 堆栈中、ZB_APS_SEND_USER_PAYLOAD 接口在发送数据时会导致非常长的延迟、例如单跳单播传输的延迟为 900 毫秒。
我认为单跳单播延迟异常、 请检查是否正确使用了“ZB_APS_SEND_USER_PAYLONG" API“ API 接口。 这应该是发送缓冲区引起的问题、在执行“ZB_APS_SEND_USER_PAYLONG"API 接口“ 接口后、没有立即发送数据传输。
typedef 结构
{
unsigned char addr_mode;
unsigned char ack_enable;
unsigned char source_endpoint;
unsigned char dest_endpoint;
unsigned short cluster_id;
unsigned short profile_id;
}ws_send_frame_t;
静态易失性无符号字符 ws_rf_send_status=0;
静态空洞 ws_rf_send_CB(zb_uint8_t 参数)
{
zb_ret_t status=zb_buf_get_status (param);
zb_buf_free (param);
WS_RF_send_status=0;
WS_printf(“ws_rf_send_CB:0x%x\r\n“、status);
}
unsigned char ws_rf_send (zb_addr_u dest_addr、unsigned char *data、unsigned char len、ws_send_frame_t *param)
{
If(!ZB_Joined())
{
返回 WS_SEND_NO_NET;
}
IF(长度>82)
{
返回 WS_SEND_TOO_LONG;
}
if (ws_rf_send_status=1)
{
返回 WS_Sending;
}
WS_RF_Send_status=1;
zb_bufid_t buf_id;
buf_id = zb_buf_get_out ();
if(!buf_id)
{
返回 WS_SEND_BUF_ERR;
}
ZB_APS_SET_USER_DATA_TX_CB (WS_RF_Send_CB);
ws_send_addr=dest_addr.addr_short;
zB_ret_t ret=zB_APS_SEND_USER_PAYLONG (
buf_id、
dest_addr、/* dst_addr */
param->profile_id、// ws_default_profileID、/* profile_id */
param->cluster_id、//ws_default_clusterd、/* cluster_id */
param->dest_endpoint、//ws_default_dest_endpoint、/* dst_endpoint */
param->source_endpoint、//ws_default_soure_endpoint、/* src_endpoint */
param->addr_mode、//ZB_APS_ADDR_MODE_16_ENDP_PRESENT、/* addr_mode */
param->ack_enable、/*ZB_false*//*ZB_true*//* aps_ack_is_enabled */
数据、
长度
);
if (ret!=RET_OK)
{
返回 WS_SEND_BUF_ERR;
}
返回 0;
}
unsigned char ws_at_send_rf_data (unsigned char *buf、unsigned short len)
{
unsigned char ret=0;
ws_send_frame_t ws_at_send_frame;
zb_addr_u dest_addr;
ws_at_send_frame.ack_enable=1;
ws_at_send_frame.addr_mode=ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
dest_addr.addr_short = 0; //目标地址是协调器。
ws_at_send_frame.source_endoint=ws_default_soure_endoint;
ws_at_send_frame.dest_endpoint = WS_DEFAULT_DEST_ENDPOINT;
ws_at_send_frame.cluster_id = ws_default_clusterid;
ws_at_send_frame.profile_id =WS_DEFAULT_PROFILEID;
ret=ws_rf_send (dest_addr、buf、len、&ws_at_send_frame);
返回 ret;
}


