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.

CC2538: How to get list of attribute using the MT/UART commands on ZNP-Host-Framework Application.

Part Number: CC2538

Hello Community,

I am using znp-host-framework application for development.

So far, I am able to add device in to the network & make some actuation over it using the AF_DATA_REQ.

But now I wants to get the all supported attribute list & their types with respective to each cluster & endpoint for a device added in to the network.

Which command should I used to get the all supported atrribute list of a device by using the znp-host framework application?..

Regards,

Shiv patil.

  • Hi,

    To do this requires multiple commands:

    • ZDO_ACTIVE_EP_REQ: Request list of active endpoints from a device (provided MT command)
    • ZDO_SIMPLE_DESC_REQ: Request the simple descriptor of an endpoint, which shows which clusters are supported on that endpoint (provided MT command)
    • ZCL_CMD_DISCOVER_ATTRS: Request attributes of a cluster (this is a ZCL command, you could use AF_DATA_REQ to send this)

    Regards,
    Toby

  • hello ,

    Will you please eloborate this answer. I am not getting how the AF_DATA_REQ can be used to get the attribute details using ZCL_CMD_DISCOVER_ATTRS.

    1. what is CMD0 & CMD1 values?

    2. Should I passed ZCL_CMD_DISCOVER_ATTRS in payload?.. If yes, then what is the format for the payload shoud be defined?...

    Regards,

    Shiv Patil.

  • Try to refer to zcl_SendDiscoverAttrsCmd() implementation.

  • Hello .

    Is there any API documentation for the ZCL_CMD_DISCOVER_ATTRS  types of cdommands, which will help us to know the required parameters for the  zcl_SendDiscoverAttrsCmd() / AF_DATA_REQUEST on the ZNP Host Framework Application..

  • I don’t see any API document for this.

  • how do I am able to know that the frame structure required for the ZCL_CMD_DISCOVER_ATTRS,

    Regards,

    Shiv Patil.

  • As YK mentioned, you can figure this out from zcl_SendDiscoverAttrsCmd (found in zcl.c).
    This command eventually calls AF_DataRequest, which is the same function that the ZNP will call when you send it the MT command AF_DATA_REQUEST.

    Using the AF_DATA_REQUEST:

    • length of data is 6 (header + command fields)
      • header: frame control (can leave as 0x00) + ZCL sequence number (0-255, increment per ZCL command) + ZCL_CMD_DISCOVER_ATTRS (value is 0x0C)
      • command fields: LO_UINT16(start attr id) + HI_UINT16(start attr id) + max ids
        • According to ZCL spec, start attr id specifies which attr id in the cluster that the endpoint should start with (for the response), and max ids specifies the maximum number of attr ids that response can contain

  • hello toby pan,

    I have tried this solution, & its working with the znp-host framework application.

    But, 

    What will be the header size & its value if I wants to add header containt to the AF Data request ?...

    Will you help me to know that?...

    Regards,

    Shiv Patil.

  • What do you mean to add header containt to the AF Data request?

  • Hello ,

    Please refer the Zigbee Linux Gateway application, In zcl.c file there a function called zcl_SendCommand();

    As per my knowledge this function is hanndeling all types of AF_DATA_REQ.

    If you look in to the code you will be find  zclFrameHdr_t hdr; which is >>
    // ZCL header - frame control field
    typedef struct
    {
      unsigned int type:2;
      unsigned int manuSpecific:1;
      unsigned int direction:1;
      unsigned int disableDefaultRsp:1;
      unsigned int reserved:3;
    } zclFrameControl_t;

    // ZCL header
    typedef struct
    {
      zclFrameControl_t fc;
      uint16            manuCode;
      uint8             transSeqNum;
      uint8             commandID;
    } zclFrameHdr_t;

    But As per the  suggestion, header value is 0x00, so If I wants to add those values mentioned the the above header format what will be its frame format???

    How do I form a playload data for header containt mentioned above?

    Also what is differnce between the transSeqNum & ZCL sequence number?

    Regards,

    Shiv Patil.

  • For those data, you can refer to ZCL spec.

  • In that context, I meant that ZCL sequence number == transaction sequence number.

    There are other sequence numbers involved in Zigbee (including MAC seq num, NWK seq num), so I wanted to specify that this was for the ZCL.