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: How to make z-stack to support manufacturer-specific-cluster, manufacturer-specific-attribute and manufacturer-specific-command

Part Number: CC2652R
Other Parts Discussed in Thread: Z-STACK

Tool/software: WEBENCH® Design Tools

Following spec "07-5123-07-ZigbeeClusterLibrary_Revision_7" ,2.3.3, it is said like this

2.3.3 Manufacturer Specific Extensions

Manufacturers are free to extend the standard in the following ways
• Add manufacturer specific clusters to a standard device endpoint.
• Add manufacturer specific commands to a standard cluster.
• Add manufacturer specific attributes to a standard cluster.

All communications regarding manufacturer specific extensions SHALL be transmitted with the manufacturer specific sub-field of the frame control field set to 1 and the manufacturer code included in the frame. If the manufacturer code in a command frame is not recognized, the command is not carried out.

So we can make z-stack to support manufacturer-specific.

To support manufacturer-specific cluster,  if Node receives a manufacturer-specific enabled ZCL-frame, and the cluster ID of ZCL-frame is  larger than 0xFC00, is it a legal ZCL-frame? The manufacturer code is include in ZCL-frame, how to recognize the manufacturer code? match with ZDO_Config_Node_Descriptor.ManufacturerCode?

  • To support manufacturer-specific attribute/command, I have try 2-ways.

    1. Add member "manuCode" into struct "zclAttrRec_t" and "zclCommandRec_t". By this way, different manufacturer-specific attribute/command can use different manufacturer code. But it will wastes more memory space.

    typedef struct
    {
      uint16_t   clusterID; //!< Cluster ID
      uint16_t   manuCode; // added by luoyiming
      uint8_t    cmdID; //!< Command ID
      uint8_t    flag;  //!< one of CMD_DIR_CLIENT_GENERATED, CMD_DIR_CLIENT_RECEIVED, CMD_DIR_SERVER_GENERATED, CMD_DIR_SERVER_RECEIVED
    } zclCommandRec_t;
    
    /// Attribute record
    typedef struct
    {
      uint16_t          clusterID;    //!< Real cluster ID
      uint16_t          manuCode;  // added by luoyiming
      zclAttribute_t  attr;
    } zclAttrRec_t;

    2. Set manufacturer-specific flag.  By this way, only " ZDO_Config_Node_Descriptor.ManufacturerCode" can be used as ZCL-frame manufacturer-code

    // define command direction flag masks
    #define CMD_DIR_SERVER_GENERATED          0x01
    #define CMD_DIR_CLIENT_GENERATED          0x02
    #define CMD_DIR_SERVER_RECEIVED           0x04
    #define CMD_DIR_CLIENT_RECEIVED           0x08
    #define CMD_FLG_MANUCODE                  0x80 // add by luoyiming 2020-01-08
    
    
    /**
     * @defgroup ZCL_ACCESS_CONTROL_BITS ZCL Access Control Bits
     * @{
    *  @brief Access control (bitmask values)
     */
    #define ACCESS_CONTROL_READ                             0x01  // attribute can be read
    #define ACCESS_CONTROL_WRITE                            0x02  // attribute can be written
    #define ACCESS_REPORTABLE                               0x04  // indicate attribute is reportable
    #define ACCESS_CONTROL_COMMAND                          0x08
    #define ACCESS_CONTROL_AUTH_READ                        0x10
    #define ACCESS_CONTROL_AUTH_WRITE                       0x20
    #define ACCESS_GLOBAL                                   0x40  // TI unique to indicate attributes that are in both, client and server side of the cluster in the endpoint
    #define ACCESS_CLIENT                                   0x80  // TI unique, indicate client side attribute
    //NOTE: If no global or client access is define, then server side of the attribute is assumed
    // Access Control for client
    #define ACCESS_CONTROL_MASK                             0x07
    // Access Control as reported OTA via DiscoveryAttributesExtended
    #define ACCESS_CONTROLEXT_MASK                          0x07  // read/write/reportable bits same as above
    // Access Control for manufacture attribute, fixed by luoyiming 2020-01-08
    #define ACCESS_MANU_ATTR                                ACCESS_CONTROL_COMMAND
    /** @} End ZCL_ACCESS_CONTROL_BITS */

  • Aries,

    Adding links to similar threads you've started:

    https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/852203 
    https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/849273 

    It is known that default Z-Stack implementation does not support manufacturer-specific commands to standard clusters .  It is not a requirement of the Zigbee ZCL Spec to do so but you can modify the ZCL accordingly to support your needs.  Section 2.6.1.3 states that 0xFC00 through 0xFFFF are the manufacturer specific cluster identifiers.  Do you have any specific questions that you need assistance on?

    Regards,
    Ryan

  • Yes, I'm modifying the ZCL now. But I wonder how to modify it correctly. I have some questions.

    1, How many manufacturer code can be supported in a zigbee node?

    2, All the manufacturer-specific cluster in one zigbee node,  which  manufacturer-code do they recognize?  a general manufacturer-code or a unique for eachothers manufacturer-code?

    3, All the manufacturer-specific attribute/command in one standard cluster, which  manufacturer-code do they recognize?  a general manufacturer-code or a unique for eachothers manufacturer-code?

  • 1. If you are asking manufacturer code in ZCL frame, I suppose you can use as many as you want.

    2&3. Since it's manufacturer-specific cluster, it totally depends on your implementation.

  • 1, As I know, gateway or client-endpoint can fill any manufacturer-code in ZCL frame. If a gateway or client-endpoint want access target's manufacturer-specific cluster/attribute/command, it should get target's manufacturer-code at first. But how can gateway or client-endpoint get target's manufacturer-code?

    2, If a target has manufacturer-specific cluster/attribute/command, how does it tell other device to access its manufacturer-specific cluster/attribute/command. If target make "ZDO_Config_Node_Descriptor.ManufacturerCode" as its only manufacturer-code, other device can get it by ZDP command.

  • 1. Zigbee spec doesn't describe detail implementation and I suppose it depends on your implementation. Since the code is in ZCL frame, it's no problem to get it and parse it.

    2. Zigbee spec doesn't mention this too so you have to find your own way to do it.