Page 1 of 1
【已解决】zigbee数据发送
Posted: 2023年 Oct 22日 22:18
by yezhipeng
Hi,
Code: Select all
send_data.qos = QOS_VIP_0;
send_data.delay_time = delay_ms;
send_data.zcl_id = ZCL_ID_ONOFF;
send_data.frame_type = ZG_ZCL_FRAME_TYPE_SPEC_TO_CLUSTER;
send_data.direction = ZG_ZCL_DATA_CLIENT_TO_SERVER;
send_data.command_id = CMD_OFF_COMMAND_ID;
send_data.addr.mode = SEND_MODE_GROUP;
send_data.addr.type.dev.cluster_id = CLUSTER_ON_OFF_CLUSTER_ID;
send_data.addr.type.dev.dst_ep = 1;
send_data.addr.type.dev.src_ep = src_ep;
send_data.addr.type.dev.dst_addr = sendGroupId;
send_data.data.private.len = 1;
tal_zg_send_data(&send_data, zigbee_send_callback, 1000);
如上面的代码可以发送成功,但我把send_data.data.private.len = 0就发送失败请问是什么原因?
BRS
Ye.Zhi-Peng
Re: zigbee数据发送
Posted: 2023年 Oct 23日 10:35
by docker22docker
send_data.addr.mode = SEND_MODE_GROUP;
send_data.addr.type.dev.cluster_id = CLUSTER_ON_OFF_CLUSTER_ID;
send_data.addr.type.dev.dst_ep = 1;
send_data.addr.type.dev.src_ep = src_ep;
send_data.addr.type.dev.dst_addr = sendGroupId;
////// 联合体错误,使用SEND_MODE_GROUP模式,不应该是dev,应该是group,详细查看TAL_ZG_ADDR_T结构体
Re: zigbee数据发送
Posted: 2023年 Oct 23日 11:05
by yezhipeng
这边测试下看看,但我这边有一个疑问,联合体共用内存块,组播单播结构是一样的,理论上这样发送也没问题。
Re: zigbee数据发送
Posted: 2023年 Oct 23日 20:26
by yezhipeng
send_data.qos = QOS_VIP_0;
send_data.delay_time = delay_ms;
send_data.zcl_id = ZCL_ID_ONOFF;
send_data.frame_type = ZG_ZCL_FRAME_TYPE_SPEC_TO_CLUSTER;
send_data.direction = ZG_ZCL_DATA_CLIENT_TO_SERVER;
send_data.command_id = CMD_OFF_COMMAND_ID;
send_data.addr.mode = SEND_MODE_GROUP;
send_data.addr.type.group.cluster_id = CLUSTER_ON_OFF_CLUSTER_ID;
send_data.addr.type.group.dst_ep = 1;
send_data.addr.type.group.src_ep = src_ep;
send_data.addr.type.group.group_id = sendGroupId;
send_data.data.private.len = 0;
tal_zg_send_data(&send_data, zigbee_send_callback, 1000);
这样修改后还是不行,len大于0就可以。
Re: zigbee数据发送
Posted: 2023年 Oct 24日 14:41
by zeso
你好,mg21 3.6.1 SDK对ZCL payload为空的数据发送做了屏蔽,此问题在下一版本SDK中优化。