节点上报的数据在协调器的接收处理如下,怎么只收到1字节数据
节点每格10秒上报3字节数据,节点为CC2630,协调器CC25358,协议栈home 1.2.2
case ZCL_CMD_REPORT://节点上报数据
//zclSampleDoorLockController_ProcessInReportCmd( pInMsg );
if (pInMsg->clusterId == ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK)
rpt_cmd= ((zclReportCmd_t *)pInMsg->attrCmd);
//numAttr=rpt_cmd->numAttr;
//attrID=rpt_cmd->attrList->attrID;
//dataType=rpt_cmd->attrList->dataType;
attrData=(rpt_cmd->attrList->attrData);//来自节点的数据
节点端(cc2630)上报程序如下:
zclReportCmd_t *reportCmd;
// Build and send a ZCL temperature reading to the matched device
reportCmd = ICall_malloc( sizeof(zclReportCmd_t) + sizeof(zclReport_t) );
//if(reportCmd != NULL)
//{
afAddrType_t dstAddr;
// Fill in the destination address
dstAddr.addrMode = (afAddrMode_t)Addr16Bit;
dstAddr.addr.shortAddr = 0x00;
dstAddr.endPoint = DLSAPP_EP;
//dstAddr.panId = ztsDstAddr.panID;
// Fill in the single attribute information for the temperature reading
reportCmd->numAttr = 1;
reportCmd->attrList[0].attrID = ATTRID_CLOSURES_LOCK_STATE;
reportCmd->attrList[0].dataType = ZCL_DATATYPE_UINT8;
reportCmd->attrList[0].attrData = (void *)(zdlLockState);
// Call ZCL function to send the report
zcl_SendReportCmd(DLSAPP_EP, &dstAddr,
ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK,
reportCmd,
ZCL_FRAME_CLIENT_SERVER_DIR,
true,
zclSampleDoorLockSeqNum++);
ICall_free(reportCmd);