Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-30: Add an attribute store flag to control supervision #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

silabs-borisl
Copy link
Collaborator

Introducing a new flag that can control supervision frames. This should be compatible with other version as if the flag doesn't exist ZPC still send the supervision frame.

If device supports supervision ZPC will do an additional check :

  • If flag is not defined or defined to 1 : send supervision frame
    
  • If flag is defined to 1 : don't send supervision frame
    

This attribute could for example controlled from an .uam file for a specific device.

Forwarded: #30
Bug-SiliconLabs: UIC-3181
Bug-Github: #30

return true;
}

return (supervision_flag == 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest here to send on any non-zero value

Suggested change
return (supervision_flag == 1);
return (supervision_flag != 0);

= attribute_store_get_first_parent_with_type(updated_node,
ATTRIBUTE_ENDPOINT_ID);

attribute_store_node_t supervision_version_node
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here instead of add + set you could shortcut like this:

Suggested change
attribute_store_node_t supervision_version_node
attribute_store_set_child_reported(endpoint_node,
ATTRIBUTE_COMMAND_CLASS_SUPERVISION_ENABLED,
&supervision_enabled_flag,
sizeof(supervision_enabled_flag));

Because adding here unconditionally may just get the system to add it on restarts. Just test to restart the ZPC and see if the ATTRIBUTE_COMMAND_CLASS_SUPERVISION_ENABLED are not appearing in duplicates.

Also I would suggest to set that no matter the version of the Supervision attribute.

Also note that restart will always flip this setting back to 1, so if you do not have an active UAM map setting it it would re-activate itself on restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants