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.

LAUNCHXL-CC26X2R1: Sending report data is wrong after receiving data from Coordinator via report cmd

Part Number: LAUNCHXL-CC26X2R1


Hi TI team,

I tried to send data to Coordinator from my End-Device via report cmd after I receive data that is sent by report cmd as well from Coordinator.

But I found my Coordinator received the wrong data. For example, I sent 0x02(boolean) from End-Device but Coordinator received 0x01. I also checked the packet over the air and the data was 0x01.

It seems that my data is wrong when I send it from my End-Device. Could you help me to check it?

By the way, If I just directly send data to Coordinator from my End-Device via report cmd and the data is correct. 

Thanks

Here is my code in my End-Device.

static uint8 zclSampleSw_ProcessInReportCmd( zclIncoming_t *pInMsg )
{
    zstack_bdbGetZCLFrameCounterRsp_t Rsp;
    zclReportCmd_t sendrptcmd;
    zclReportCmd_t *rptcmd;
    uint8 i=0;

    //printf("clusterID=%04x\n",pInMsg->msg->clusterId);
    //fflush(stdout);

    if(pInMsg->msg->clusterId == ZCL_CLUSTER_ID_GEN_DEVICE_TEMP_CONFIG) //Device Configuration
    {
        rptcmd = (zclReportCmd_t *)pInMsg->attrCmd;
        for(i=0; i<rptcmd->numAttr; i++)
        {
            printf("attID=%04x\n",rptcmd->attrList[i].attrID);
            fflush(stdout);
            if(rptcmd->attrList[i].attrID == ATTRID_TYPE_DOOR)
            {
                Zstackapi_bdbGetZCLFrameCounterReq(zclSampleSw_Entity, &Rsp);

                zclSampleDoor_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
                zclSampleDoor_DstAddr.endPoint = 8;
                zclSampleDoor_DstAddr.addr.shortAddr = 0x0000;

                uint8 device_type=0x02;
                sendrptcmd.numAttr = 1;
                sendrptcmd.attrList[0].attrID = ATTRID_TYPE_DOOR;
                sendrptcmd.attrList[0].dataType = ZCL_DATATYPE_BOOLEAN;
                sendrptcmd.attrList[0].attrData = (uint8 *)&device_type;

                printf("data=%02x\n",*(sendrptcmd.attrList[0].attrData));
                fflush(stdout);

                zcl_SendReportCmd(SAMPLESW_ENDPOINT, &zclSampleDoor_DstAddr , ZCL_CLUSTER_ID_GEN_DEVICE_TEMP_CONFIG, &sendrptcmd, ZCL_FRAME_SERVER_CLIENT_DIR, 1, Rsp.zclFrameCounter);
            }
        }
    }
}