[Zigbee] Manufacturer Code clarification

Setup: 

nrf52840DK (Zigbee Cordinator based on Zigbee Coordinator sample)

nrf52840DK (ZED)

nrf52840 dongle (Wireshark sniffer)

NCS v2.4.1

Hi,

In my application I am using Manufacturer specific ZCL commands and attributes. All of that seems working fine but I am little bit confused regarding the Manufacturer Code usage.

There are two magic values in NCS: 
0x1234 defined as:

#define ZB_MANUFACTURER_CODE_DSR            0x1234U
/* That is not a joke, our manufacturer code is really 1234! */
/*! @endcond */ /* internals_doc */

#define ZB_DEFAULT_MANUFACTURER_CODE ZB_MANUFACTURER_CODE_DSR

Manufacturer Code of DSR for all applications based on ZBOSS.

0x127F defined as: 

config ZIGBEE_FOTA_MANUFACTURER_ID
	hex "Manufacturer ID"
	default 0x127F
	range 0x0000 0xFFFF
	help
	  This is the ZigBee assigned identifier for each member company.
	  0x127F - Nordic Semiconductor
	  0xFFFF - wild card value has a 'match all' effect.

Manufacturer Code of Nordic Semiconductor used only for FOTA purposes to fill up OTA Header with it.

  1. What happens if the manufacturer code placed in the OTA Header of the received image is different from the one set on the device (0x127F by default)?
  2. Which Manufacturer Code should be used in Cluster descriptor ?
    /** @brief ZCL cluster description. */
    typedef ZB_PACKED_PRE struct zb_zcl_cluster_desc_s
    {
      zb_uint16_t cluster_id; /**< ZCL 16-bit cluster id. @see zcl_cluster_id */
      zb_uint16_t attr_count;  /**< Attributes number supported by the cluster */
      struct zb_zcl_attr_s *attr_desc_list; /**< List of cluster attributes,
             declared using ZB_ZCL_DECLARE_<CLUSTER_NAME>_ATTRIB_LIST() macro */
      zb_uint8_t role_mask;   /**< Cluster role, refer to zcl_cluster_role */
      zb_uint16_t manuf_code; /**< Manufacturer code for cluster and its attributes */
      zb_zcl_cluster_init_t cluster_init;
    } ZB_PACKED_STRUCT
    zb_zcl_cluster_desc_t;
  3. Is it possible to overwrite #ZB_DEFAULT_MANUFACTURER_CODE ?
  4. Why #ZB_DEFAULT_MANUFACTURER_CODE is not overwritten by Nordic Semiconductor Manufacturer Code (0x127F) ? 

I am looking forward to hearing from you,

Pawel

  • Hello Pawel,

    I am not saying you are wrong, but I am trying to understand. 

    Whenever you call:

    void zb_zcl_send_report_attr_command(zb_zcl_reporting_info_t *rep_info, zb_uint8_t param)

    wouldn't the *rep_info hold information so that:

    is_manuf_spec = !!ZB_ZCL_IS_ATTR_MANUF_SPEC(attr_desc);

    would return false if that attribute is not a manufacturer specific attribute?

    And if is_manuf_spec is false, then the 

    ZB_ASSERT(rep_info->manuf_code != ZB_ZCL_NON_MANUFACTURER_SPECIFIC);

    will not run, right?

  • Hi Edvin,

    Sorry for the late reply.

    Whenever you call:

    Fullscreen
    1
    void zb_zcl_send_report_attr_command(zb_zcl_reporting_info_t *rep_info, zb_uint8_t param)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    wouldn't the *rep_info hold information so that:

    Fullscreen
    1
    is_manuf_spec = !!ZB_ZCL_IS_ATTR_MANUF_SPEC(attr_desc);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    would return false if that attribute is not a manufacturer specific attribute?

    Yes, is_manuf_spec will be false, and that information is determined based on the attribute descriptor, not based on reporting info.

    And if is_manuf_spec is false, then the 

    Fullscreen
    1
    ZB_ASSERT(rep_info->manuf_code != ZB_ZCL_NON_MANUFACTURER_SPECIFIC);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    will not run, right?

    That assert is in 2.6.0 in 2.4.1 it looks different. 

    ZB_ASSERT(ep_desc && cluster_desc && cluster_desc->manuf_code != ZB_ZCL_MANUF_CODE_INVALID);


  • Pawel(embeddedsolutions.pl) said:
    That assert is in 2.6.0 in 2.4.1 it looks different

    Yes, but it will still only be checked if is_manuf_specific is true?

Related