zigbee读属性的命令也是由zcl相关的任务处理吗?

2019-07-18 15:11发布

zigbee读属性的命令也是由zcl相关的任务处理吗?看SampleLight例子里面有 void zclSampleLight_ProcessIncomingMsg( zclIncomingMsg_t *pInMsg)这个函数,应该是处理读写属性的吧?这个和on/off命令是不一样的处理方法,读写属性的命令怎么用,有没有读写属性的例子?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
1条回答
广电总局
2019-07-18 19:26
关于发送的读的命令

/*********************************************************************
* @fn zcl_SendRead
*
* @brief Send a Read command
*
* @param srcEP - Application's endpoint
* @param dstAddr - destination address
* @param clusterID - cluster ID
* @param readCmd - read command to be sent
* @param direction - direction of the command
* @param seqNum - transaction sequence number
*
* @Return ZSuccess if OK
*/
ZStatus_t zcl_SendRead( uint8 srcEP, afAddrType_t *dstAddr,
uint16 clusterID, zclReadCmd_t *readCmd,
uint8 direction, uint8 disableDefaultRsp, uint8 seqNum)
{
uint16 dataLen;
uint8 *buf;
uint8 *pBuf;
ZStatus_t status;

dataLen = readCmd->numAttr * 2; // Attribute ID

buf = zcl_mem_alloc( dataLen );
if ( buf != NULL )
{
uint8 i;

// Load the buffer - serially
pBuf = buf;
for (i = 0; i < readCmd->numAttr; i++)
{
*pBuf++ = LO_UINT16( readCmd->attrID );
*pBuf++ = HI_UINT16( readCmd->attrID );
}

status = zcl_SendCommand( srcEP, dstAddr, clusterID, ZCL_CMD_READ, FALSE,
direction, disableDefaultRsp, 0, seqNum, dataLen, buf );
zcl_mem_free( buf );
}
else
{
status = ZMemError;
}

return ( status );
}

关于处理读属性的命令

static uint8 zclProcessInReadCmd( zclIncoming_t *pInMsg )

一周热门 更多>