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.

ZigBee3.0终端收不到协调器数据

ZigBee终端刚加入协调器的时候是可以收协调器的数据的,

但是过了一个晚上,终端就收不到协调器数据了,如附件的抓包,

是协调器没有发出还是终端的问题?5AB3终端收不到数据.psd

  • 有收到也有ack,你自己uart 有问题吧,你去debug吧

  • 我终端这边没有UART,终端收到后只是点亮和关闭LED,正常是可以控制的,
    但是测试一段时间就出现控制不了LED了
    因为有私有数据,终端协调器互发的时候用的函数都是zcl_SendReportCmd,
    下面是终端收到后点亮或者关闭LED的代码?有没有什么问题?
    static uint8 zclSampleSw_ProcessInReportCmd( zclIncomingMsg_t *pInMsg )
    {
    zclReportCmd_t *pReportCmd;
    pReportCmd=(zclReportCmd_t *)pInMsg->attrCmd;

    switch(pReportCmd->attrList[0].attrData[0])
    { case 0x04:
    zclSampleSo_OnOff = zclSampleSo_OnOff|0x01;
    //蓝
    HalLedSet( HAL_LED_3, HAL_LED_MODE_ON );
    //红
    HalLedSet( HAL_LED_6, HAL_LED_MODE_OFF );
    P0_6=1;

    //上报状态
    pReportCmd = osal_mem_alloc( sizeof(zclReportCmd_t) + sizeof(zclReport_t) );
    if ( pReportCmd != NULL )
    {
    pReportCmd->numAttr = 1;
    pReportCmd->attrList[0].attrID = ATTRID_ON_OFF;//数据类型
    pReportCmd->attrList[0].dataType = ZCL_DATATYPE_UINT8;
    pReportCmd->attrList[0].attrData = (void *)(&zclSampleSo_OnOff);
    //数据类别
    zcl_SendReportCmd( SAMPLELIGHT_ENDPOINT, &zclSampleLight_DstAddr,
    ZCL_CLUSTER_ID_GEN_ON_OFF,
    pReportCmd, ZCL_FRAME_SERVER_CLIENT_DIR, TRUE, zclSampleLightSeqNum++ );
    }
    osal_mem_free( pReportCmd );

    break;
    }

    return ( TRUE );
  • 看出什么问题,但是你为什么pReportCmd 要用已经赋值过的呢,而不是使用一个新的zclReportCmd_t的值
    pReportCmd = osal_mem_alloc( sizeof(zclReportCmd_t) + sizeof(zclReport_t) );
    你去debug吧。