Multiple endpoints of same type in one node

Hi

First of all i am quite new to nRF SDK so if the answer to my question turns out to be trivial then I am sorry.

I am in the process of developing a Zigbee light switch dimmer device. This device is going to have 4 buttons which each is going to have a light switch endpoint connected to it. My issue however is that this seems to not be possible in nRF SDK 2.6.0.

The following way of declaring two end points of the same type results in a build error:

ZB_ZCL_DECLARE_DIMMER_SWITCH_EP(

    dimmer_switch_ep1,

    1,      

    dimmer_switch_clusters);

ZB_ZCL_DECLARE_DIMMER_SWITCH_EP(

    dimmer_switch_ep2,

    2,  

    dimmer_switch_clusters);

…….

 

The issue is that the macro “ZB _DECLARE_DIMMER_SWITCH_EP” is using another macro “ZB_DECLARE_SIMPLE_DESC” which only takes the number of inputs in the cluster and the number of outputs in the cluster. This means that from the second declaration and onwards will the previous declaration be overwritten, which results in a build error. I’ve managed to find a solution from 3 years ago using a new header file: https://devzone.nordicsemi.com/f/nordic-q-a/83265/zigbee-multiple-endpoint-declaration-gives-error however this post gives the impression that this fix should have been implemented in newer versions. But I still get the same issue as in the post.

 

Is there something which I missed in the way you’re supposed to declare multiple endpoints of the same type or is this just the way to fix it?

 

Again, I’m sorry if the answer is obvious and trivial.

Parents
  • Hi, 

    It should be possible to define two endpoints, but you need to create separate attribute lists for the two endpoints.

    For example, just using the dimmable light bulb:

    ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(
    	dimmable_light_clusters_1,
    	basic_attr_list_1,
    	identify_attr_list_1,
    	groups_attr_list_1,
    	scenes_attr_list_1,
    	on_off_attr_list_1,
    	level_control_attr_list_1);
    
    ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(
    	dimmable_light_clusters_2,
    	basic_attr_list_2,
    	identify_attr_list_2,
    	groups_attr_list_2,
    	scenes_attr_list_2,
    	on_off_attr_list_2,
    	level_control_attr_list_2);
    
    ZB_DECLARE_DIMMABLE_LIGHT_EP(
    	dimmable_light_ep_1,
    	DIMMABLE_LIGHT_ENDPOINT_1,
    	dimmable_light_clusters_1);
    
    ZB_DECLARE_DIMMABLE_LIGHT_EP(
    	dimmable_light_ep_2,
    	DIMMABLE_LIGHT_ENDPOINT_2,
    	dimmable_light_clusters_2);
    
    ZBOSS_DECLARE_DEVICE_CTX_2_EP(
    	dimmable_light_ctx,
    	dimmable_light_ep_1,
    	dimmable_light_ep_2);

    Disclaimer: I haven't tested it myself, but we have seen customers doing this previously, so I think it should work. 

    Regards,
    Amanda H.

Reply
  • Hi, 

    It should be possible to define two endpoints, but you need to create separate attribute lists for the two endpoints.

    For example, just using the dimmable light bulb:

    ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(
    	dimmable_light_clusters_1,
    	basic_attr_list_1,
    	identify_attr_list_1,
    	groups_attr_list_1,
    	scenes_attr_list_1,
    	on_off_attr_list_1,
    	level_control_attr_list_1);
    
    ZB_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(
    	dimmable_light_clusters_2,
    	basic_attr_list_2,
    	identify_attr_list_2,
    	groups_attr_list_2,
    	scenes_attr_list_2,
    	on_off_attr_list_2,
    	level_control_attr_list_2);
    
    ZB_DECLARE_DIMMABLE_LIGHT_EP(
    	dimmable_light_ep_1,
    	DIMMABLE_LIGHT_ENDPOINT_1,
    	dimmable_light_clusters_1);
    
    ZB_DECLARE_DIMMABLE_LIGHT_EP(
    	dimmable_light_ep_2,
    	DIMMABLE_LIGHT_ENDPOINT_2,
    	dimmable_light_clusters_2);
    
    ZBOSS_DECLARE_DEVICE_CTX_2_EP(
    	dimmable_light_ctx,
    	dimmable_light_ep_1,
    	dimmable_light_ep_2);

    Disclaimer: I haven't tested it myself, but we have seen customers doing this previously, so I think it should work. 

    Regards,
    Amanda H.

Children
No Data
Related