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.
Dear all,
As far as I know, ZCL is built on the top on AF.
Can I send and receive an AF message over a ZCL endpoint? i.e. the event_loop() function should have something like this:
while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleLight_TaskID )) ) { switch ( MSGpkt->hdr.event ) { case ZCL_INCOMING_MSG: // Incoming ZCL Foundation command/response messages ProcessIncomingZCLMsg( (zclIncomingMsg_t *)MSGpkt ); break; case AF_INCOMING_MSG_CMD: ProcessIncomingAFMsg( (afIncomingMSGPacket_t *)MSGpkt ); break; } …
Also, I found the structure of zclIncomingMsg_t and afIncomingMSGPacket_t are different.I am not sure if this causes any issue.
Thank you very much.
Best regards,
Barry
Hi YK
afIncomingMSGPacket_t don't include zclHdr.commandID,but afIncomingMSGPacket_t is translated zclIncomingMsg_t in zclSampleLight_event_loop How do get zclHdr.commandID ?
uint16 zclSampleLight_event_loop( uint8 task_id, uint16 events ) { afIncomingMSGPacket_t *MSGpkt; (void)task_id; // Intentionally unreferenced parameter if ( events & SYS_EVENT_MSG ) { while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleLight_TaskID )) ) { switch ( MSGpkt->hdr.event ) { case ZCL_INCOMING_MSG: // Incoming ZCL Foundation command/response messages zclSampleLight_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt ); .... }