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.

Z-Stack Manufacturer Specific Clusters

Other Parts Discussed in Thread: Z-STACK

Hi,

I have been adding some clusters and attributes (for now, NO commands or responses) that are manufacturer specific. I noticed that these are not flagged in the ZCL Header. Which is logical, since there doesn't seem to be a way for me to let Z-Stack know that the cluster I declared is Manufacturer specific.

I've read on the forum that it's not possible? Really? And I've downloaded some code from Double-0 for the SE profile that seems to deal with commands only, and which I have trouble with understanding, as the cluster isn't defined in the usual way and has no attributes.


Question is, does Z-Stack support manufacturer cluster specific clusters with attributes, and if so, how to declare them. If not, is there documentation or example code for Z-Stack Lighting or Z-Stack Home Automation?

Thanks,

Sjef.

  • To support manufacturer cluster specific clusters in Z-Stack, you can do the following steps:

    1. Define manufacturer cluster specific cluster and attribute in zcl.h

    2. Implement the related callback functions in zclXXX_ProcessIncomingMsg.

  • Hi Yikay,

    Thanks for answering, but unfortunately this is too vague to be useful. Maybe you can be a little more specific.

    Of course, I've defined some cluster ID's and Attribute ID's in header files (not zcl.h, but my app headers).

    Now, which callback functions are 'related' to what, and how are they called at all by only adding a few #define's in a header file?

    And, how is the manufacturer specific bit in the ZCL Header going to be set? How is the manufacturer code in the header going to be matched (as you know, no match = error).

    How is this mfg specific cluster going to show up in the Simple Descriptor?

    Anyway, it seems that Z-Stack unfortunately does not support this, looking in zcl.c in the zcl_ProcessMessageMSG function, there's

    if ( inMsg.hdr.fc.manuSpecific )
        {
          // We don't support any manufacturer specific command
          status = ZCL_STATUS_UNSUP_MANU_GENERAL_COMMAND;

    Well. That's clear, thanks but no thanks, Z-Stack... It seems I'm going to have to add this basic Zigbee feature myself then?

    EDIT:

    Looking deeper into Z-Stack, the MFS feature seems to be almost-finished. That means it has been quite easy to fix:

    What needs to be done in the first place is to add logic in zcl_ProcessMessageMSG:

      // Is this a foundation type message
      if ( !interPanMsg && zcl_ProfileCmd( inMsg.hdr.fc.type ) )
      {
        // Do support Manufacturer Specific frames (sdk 20140812)
        if  ( ( ( inMsg.hdr.fc.manuSpecific ) && ( inMsg.hdr.manuCode != MANUFACTURER_ID_CODE ) ) ||
                ( !inMsg.hdr.fc.manuSpecific && (pkt->clusterId >= ZCL_MFS_CLUSTER_START_ID) ) )
        {
          status = ZCL_STATUS_UNSUP_MANU_GENERAL_COMMAND;
        }
        else if ( ( inMsg.hdr.commandID <= ZCL_CMD_MAX ) &&
                  ( zclCmdTable[inMsg.hdr.commandID].pfnParseInProfile != NULL ) )


    and

      else  // Not a foundation type message, so it must be specific to the cluster ID.
      {
        // Do support Manufacturer Specific frames (sdk 20140812)
        if  ( ( ( inMsg.hdr.fc.manuSpecific ) && ( inMsg.hdr.manuCode != MANUFACTURER_ID_CODE ) ) ||
                ( !inMsg.hdr.fc.manuSpecific && (pkt->clusterId >= ZCL_MFS_CLUSTER_START_ID) ) )
        {
          status = ZCL_STATUS_UNSUP_MANU_CLUSTER_COMMAND;
        }
        else if ( pInPlugin && pInPlugin->pfnIncomingHdlr )

    and a few lines later:

        if ( status == ZFailure )
        {
    /*
          // Unsupported message
          if ( inMsg.hdr.fc.manuSpecific )
          {
            status = ZCL_STATUS_UNSUP_MANU_CLUSTER_COMMAND;
          }
          else */ // Do support Manufacturer Specific frames (sdk 20140812)
          {
            status = ZCL_STATUS_UNSUP_CLUSTER_COMMAND;
          }

    This is the basic logic. For this example I choose not to get too tied up in the exception-upon-exception way that ZIgbee specification is defined, so just define ZCL_MFS_CLUSTER_START_ID as 0xFC00 (spec. table 2.13) and forgo the ability to re-define existing cluster ID's as manufacturer specific in private profiles.

    Now looking at static CONST zclCmdItems_t zclCmdTable[] there are a lot of functions defined, we're interested in the Responses. All of them need changing, I'll just highlight one of them, zclProcessInReadCmd.

    This function calls zcl_SendReadRsp which needs an extra parameter:

    ZStatus_t zcl_SendReadRsp( uint8 srcEP, afAddrType_t *dstAddr,
                               uint16 clusterID, zclReadRspCmd_t *readRspCmd,
                               uint8 direction, uint8 disableDefaultRsp, uint8 seqNum, uint16 manuCode )

    and it needs to pass it at the end of the function:

        status = zcl_SendCommand( srcEP, dstAddr, clusterID, ZCL_CMD_READ_RSP, FALSE,
                                  direction, disableDefaultRsp, manuCode, seqNum, len, buf );
        zcl_mem_free( buf );
      }

    the manuCode parameter was simply 0 before. Back to zclProcessInReadCmd, at the end:

      // Build and send Read Response command
      zcl_SendReadRsp( pInMsg->msg->endPoint, &(pInMsg->msg->srcAddr), pInMsg->msg->clusterId,
                       readRspCmd, !pInMsg->hdr.fc.direction,
                       true, pInMsg->hdr.transSeqNum, pInMsg->hdr.manuCode );
      zcl_mem_free( readRspCmd );

    And so on for all the other functions. If you also want to send to manufacturer specific clusters from the device, the commands need to be changed as well. There's also a macro in zcl.h, zcl_DefaultRspCmd where I've removed the manuSpec checking part. Doesn't look like that's required.

    You can now add manufacturer specific clusters to the big CONST zclAttrRec_t zllApp_Attrs[APP_NUM_ATTRIBUTES] in your application and everything else is handled automatically. Just make sure that cluster ID is 0xFC00 - 0xFFFF.

    Sjef.

  • it seems like defined a CMD。

    if i defined a specific attribute,which was like on/off , does it also being callback in zclXXX_ProcessIncomingMsg?
  • Hi TheSeven,
    I don't understand your question well. Can you create a new thread for your problem and be more specific?
  • Hi Sjef de Krijger ,
    it is hard to understand what is the step of adding a private attribute.

    cloud you please make it clearly?

    BR
  • Hi TheSeve,
    This seems a duplicate post to e2e.ti.com/.../428016. I have tried to answer you in your original post.
  • Hi!

    I want to know how useful is defining our own manufacturer specific cluster?

    Because as far as I know we cannot added manufacturer specific cluster in linux gateway, so we cannot send any new manufacturer specific commands from gateway...

    Also, how do you test that your new command is working?

    Thanks 

    Anjali

  • In most cases, you don't need to use manufacturer specific cluster. You should ask yourself why your application need to use manufacturer specific cluster. Can't you find a suitable one for your application? When I create a manufacturer specific cluster, you can use ZTool to test it. It is not necessary to use Z-Stack Linux Home GW.

  • Ok, Now I get it. Are the steps defined by Sjef enough or anything else should be added?
  • No, that's enough.
  • Hello Yikai Sir,

    Greetings for the day!!!

    Sir,

    I want to know how to get the Cluster List from Remote node  is there any API to be called from Coordinator to get the Cluster List of the remote Node.

    I just want to get the List of Cluster Id from the Remote node ??

    Thanks and regards

    Manish Kumar

  • You can use ZDP_SimpleDescReq to get ZDP_SimpleDescRsp which contains Cluster List from Remote node.
  • Hello Sir,

    Thanks for the reply ,

    I have tried that but remote node is sending 0x83 as response code which means Not Active ??

    What to do next please do let me know ??

    thanks and regards

    Manish

  • What is your remote node?
  • Hello Yikai Sir,

    Thanks for the reply,

    Its  a Third Party GE LED Dimmer HA 1.2 Compatible.

    It is not responding to Simple Desc req but it is responding to Active_Ep_Req() and giving the response EP

    but i know it a LED Dimmer so it must have cluster 0x0006 for toggle and sending toggle command to it , it is working.

    But i want to know how more Cluster it supports ??

    thanks and regards 

    Manish

  • I think this is GE's problem. If a device cannot response to simple descriptor request, it won't be HA 1.2 Compatible.