Other Parts Discussed in Thread: SYSCONFIG
Code Composer Studio で開発をしています。
標準には存在しない新規のクラスタを作成して属性、コマンドを実装したいです。
しかし、Code Composer Studioでは標準のクラスタしか選択できず新規のクラスタが追加できません。
実装方法を教えていただけないでしょうか?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Code Composer Studio で開発をしています。
標準には存在しない新規のクラスタを作成して属性、コマンドを実装したいです。
しかし、Code Composer Studioでは標準のクラスタしか選択できず新規のクラスタが追加できません。
実装方法を教えていただけないでしょうか?
I guess you want to add proprietary clusters/attributes. If this is what you want, you can add them in your xxx_data.c (for example zcl_samplelight_data.c if you use samplelight example). By the way, this is an English based E2E forum so I would suggest you to use English to discuss your topic.
Thank you Chen
I was able to add a cluster to the end device.
However, I cannot send commands from the end device to the coordinator in the added cluster.
Do I need any other settings?
・zed_sw sample
・Add CluseterID 0xFC10、Command ID 0x00
zcl_SendCommandEx
(
SAMPLESW_ENDPOINT,
&zclSampleSw_DstAddr,
0xFC10,
0x00,
TRUE,
ZCL_FRAME_CLIENT_SERVER_DIR,
TRUE,
0,
Rsp.zclFrameCounter,
strlen(sndBuf),
sndBuf,
TRUE
);
I'm trying to send data from an end device to a coordinator using the API above.
When I captured the packet, the end device did not send the packet.
The status of zcl_SendCommandEx () is 0, which is normal.
No, zclSampleSw_DstAddr should use information of destination which is coordinator in your case.
We have confirmed that the settings of zclSampleSw_DstAddr are correct.
zcl_SendCommandEx () cluster ID, command ID parameters
CL_CLUSTER_ID_GENERAL_ON_OFF (0x0006), COMMAND_ON_OFF_TOGGLE (0x02)
It will be sent to the coordinator.
If you change only the part of cluster ID = 0xFC10 and command ID = 0x00 and
send No packets are sent.
If I do not define the added (cluster ID = 0xFC10, command ID = 0x00) somewhere,
it will be judged as an invalid parameter and the transmission seems to be canceled.
I tried adding 0xFC10 but couldn't send.
const cId_t zclSampleSw_OutClusterList[] =
{
ZCL_CLUSTER_ID_GENERAL_IDENTIFY,
ZCL_CLUSTER_ID_GENERAL_ON_OFF,
ZCL_CLUSTER_ID_GENERAL_GROUPS,
0xFC10
};
You can try to debug and trace into zcl_SendCommandEx to see why it rejects your API call.
It is messaged to another task and cannot be traced in detail.
If you know the name of the task or function that is performing the transmission process, please let me know.
I want to set a breakpoint there and debug.
I suppose you can set a breakpoint in zcl_SendCommandEx which can be found in zcl.c.
In sendReqDefaultRsp () of zstackapi.c
I can't follow OsalPort_msgSend ().
Receive the message sent by OsalPort_msgSend ()
Don't know the name of the function to process?
I think your problem is about zcl_SendCommandEx cannot send command with proprietary cluster. Why is this original issue related to sendReqDefaultRsp and OsalPort_msgSend?
As I traced zcl_SendCommandEx, I found that sendReqDefaultRsp and OsalPort_msgSend were called.
Up to the above, the process has been performed without any error, and I think that the transmission has been canceled at the destination of OsalPort_msgSend.
Since the packet capture log is not output, it cannot be attached.
I'm using Wireshark.
I am changing the sample source for zed_sw.
Is it possible to send the command of the original cluster even with the sample source?
1. I suspect you don't setup sniffer correctly or don't sniffer correct channel. I suggest you to check your sniffer again.
2. What do you mean use ON/OFF cluster to send proprietary command? If so, the answer is YES.
I think the sniffer is set correctly.
The command transmission / reception of the standard ON / OFF cluster can be captured.
The reason I used the zed_sw sample was because I wanted to easily try sending commands for my own cluster.
I see no reason why zcl_SendCommandEx returns success but you see nothing in sniffer.
I still suspect your issue is about zclSampleSw_DstAddr. Can you change parameters in zclSampleSw_DstAddr to the followings before your call zcl_SendCommandEx to send your proprietary command to see if it works?
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
zclSampleSw_DstAddr.endPoint = //Use endpoint of your coordinator;
zclSampleSw_DstAddr.addr.shortAddr = 0x0000;
I did what you suggested, but the results didn't change.
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
zclSampleSw_DstAddr.endPoint = //Use endpoint of your coordinator;
zclSampleSw_DstAddr.addr.shortAddr = 0x0000;
Can you show me your final settings? And, what is the return value of your zcl_SendCommandEx?
For your reference, I test the following code in my zed_sw example and I can see the proprietary command is sent on my sniffer.
****************************************************************************/
uint8 rotate=0;
char sndBuf[]="hello";
ZStatus_t ret;
void zclSampleSw_actionToggleLight(const int32_t _itemEntry)
{
zstack_getZCLFrameCounterRsp_t Rsp;
Zstackapi_getZCLFrameCounterReq(appServiceTaskId, &Rsp);
zclSampleSw_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
zclSampleSw_DstAddr.endPoint = 8;////Use endpoint of your coordinator;
zclSampleSw_DstAddr.addr.shortAddr = 0x0000;
if(rotate%2==0)
ret=zclGeneral_SendOnOff_CmdToggle( SAMPLESW_ENDPOINT, &zclSampleSw_DstAddr, TRUE, Rsp.zclFrameCounter );
else{
ret=zcl_SendCommandEx( SAMPLESW_ENDPOINT,&zclSampleSw_DstAddr,0xFC10,0x00,TRUE,ZCL_FRAME_CLIENT_SERVER_DIR,TRUE,0,Rsp.zclFrameCounter,strlen(sndBuf),sndBuf,TRUE);
}
rotate++;
}
I can now send by adding the definition below.
bdb_finding_and_binding.c
const cId_t bdb_ZclType1Clusters[] =
{
---
0xFC10
}
I thank you for your support.
你是想用Sysconfig工具创建自定义的cluster和attribute吗?我尝试过修改"zcl_config.c.xdt",可以兼容自定义的cluster和attribute.
生成的zcl_config文件中定义了_MANU_INCLUSTER_ATTRS和_MANU_INCLUSTERS,用自定义的attribute和cluster代替它们,需要创建一个文件"zcl_manuCode.h",在里面定义你的attribute和cluster.