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.

WEBENCH® Tools/CC2652R: There is an issue of execute ZCL Config Report command

Part Number: CC2652R

Tool/software: WEBENCH® Design Tools

In function "zclParseInConfigReportCmd" in ZCL .c, in the first loop that count Attr number, if the data-type is not analog-type, the reportable change field is 0-byte length, so the "pBuf++" should be removed.

void *zclParseInConfigReportCmd( zclParseCmd_t *pCmd )
{
  .....


  // Calculate the length of the Request command
  while ( pBuf < ( pCmd->pData + pCmd->dataLen ) )
  {
    uint8 direction;

    numAttr++;
    direction = *pBuf++;
    pBuf += 2; // move pass the attribute ID

    // Is there a Reportable Change field?
    if ( direction == ZCL_SEND_ATTR_REPORTS )
    {
      dataType = *pBuf++;
      pBuf += 4; // move pass the Min and Max Reporting Intervals

      // For attributes of 'discrete' data types this field is omitted
      if ( zclAnalogDataType( dataType ) )
      {
        reportChangeLen = zclGetDataTypeLength( dataType );
        pBuf += reportChangeLen;

        // add padding if needed
        if ( PADDING_NEEDED( reportChangeLen ) )
        {
          reportChangeLen++;
        }

        dataLen += reportChangeLen;
      }
      /*  remove this code
      else
      {
        pBuf++; // move past reportable change field
      }
      */
    }
    else
    {
      pBuf += 2; // move pass the Timeout Period
    }
  } // while loop


   ......



}





  • Hi Aries,

    If the direction is set to ZCL_SEND_ATTR_REPORT then it is assumed that there is a reportable change field, and if not analog then it could be digital/binary with a 1-byte boolean value.  Can you provide a clear test case in which this code creates an issue for ZCL communication/processing?

    Regards,
    Ryan

  • In zstack, function "zcl_SendConfigReportCmd", if reportable change field is not analog, transported frame will not include this filed's any byte.

    ZStatus_t zcl_SendConfigReportCmd( uint8_t srcEP, afAddrType_t *dstAddr, uint16_t clusterID,
                                      zclCfgReportCmd_t *cfgReportCmd, uint8_t direction,
                                      uint8_t disableDefaultRsp, uint16_t manuCode, uint8_t seqNum )
    {
    
    
      // Find out the data length
      for ( i = 0; i < cfgReportCmd->numAttr; i++ )
      {
        zclCfgReportRec_t *reportRec = &(cfgReportCmd->attrList[i]);
    
        dataLen += 1 + 2; // Direction + Attribute ID
    
        if ( reportRec->direction == ZCL_SEND_ATTR_REPORTS )
        {
          dataLen += 1 + 2 + 2; // Data Type + Min + Max Reporting Intervals
    
          // Find out the size of the Reportable Change field (for Analog data types)
          if ( zclAnalogDataType( reportRec->dataType ) )
          {
            dataLen += zclGetDataTypeLength( reportRec->dataType );
          }
          // non-analog's dataLen is 0 byte.
        }
        else
        {
          dataLen += 2; // Timeout Period
        }
      }
    
     .....
    
        status = zcl_SendCommand( srcEP, dstAddr, clusterID, ZCL_CMD_CONFIG_REPORT, FALSE,
                                  direction, disableDefaultRsp, manuCode, seqNum, dataLen, buf );
    
    
      return ( status );
    }

  • Un-analog data type is really not cost any byte in ZCL-Config-Report-Command.

  • Thanks for clarifying Aries, I see the issue now and will pass this along to the Software Development Team.

    Regards,
    Ryan