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-20: Fix support for COMMAND_CLASS_METER V1,V2 & V3 #20

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

nkljajic
Copy link
Collaborator

Change

Fixes bug where Attribute [0x3208] Value can not get resolved for legacy devices.
Size of ZW_METER_GET_V3_FRAME is smaller than size of ZW_METER_GET_V5_FRAME.
Legacy device supporting COMMAND_CLASS_METER_V3 and below will ignore received V5 frames,
because frame size is larger than expected.

Checklist

Copy link
Collaborator

@rzr rzr left a comment

Choose a reason for hiding this comment

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

LGTM, some nitpicky feedback

@@ -205,13 +205,21 @@ static sl_status_t zwave_command_class_meter_get(attribute_store_node_t node,
attribute_store_node_t scale_node
= attribute_store_get_first_parent_with_type(rate_type_node,
ATTRIBUTE(SCALE));
zwave_cc_version_t supporting_node_version
= zwave_command_class_get_version_from_node(node, COMMAND_CLASS_METER);

meter_scale_t scale = 0;
attribute_store_get_reported(scale_node, &scale, sizeof(scale));

ZW_METER_GET_V5_FRAME *get_frame = (ZW_METER_GET_V5_FRAME *)frame;
get_frame->cmdClass = COMMAND_CLASS_METER_V6;
Copy link
Collaborator

Choose a reason for hiding this comment

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

not related to you pr, but I would expect to have v6 frame to align the cmd class version maybe different ones will work but I bring confusion IMHO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

V6 is only locally defined

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok this should have been done differently, I'll see how to avoid this kind of duplication...

FTR at zwave we want to generate headers from xml file, unify should do same...

nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Nov 28, 2023
Fixes bug where Attribute [0x3208] Value can not get resolved for legacy devices.
Size of ZW_METER_GET_V3_FRAME is smaller than size of ZW_METER_GET_V5_FRAME.
Legacy device supporting COMMAND_CLASS_METER_V3 and below will ignore received V5 frames,
because frame size is larger than expected.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
Copy link
Collaborator

@rzr rzr left a comment

Choose a reason for hiding this comment

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

For the record related links:

Build: https://github.com/nkljajic/UnifySDK/actions/runs/7019839630/job/19098211543 : success

Forwarded-SiliconLabs: task/UIC-3082/phcoval/GH-20/develop

rzr added a commit to rzr/UnifySDK that referenced this pull request Jan 16, 2024
…s of CC

Bug-SiliconLabs: UIC-3082
Origin: https://github.com/rzr/UnifySDK/tree/GH-20/UIC-3082/phcoval/main
Relate-to: nkljajic#1
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-20/develop
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
@rzr
Copy link
Collaborator

rzr commented Jan 16, 2024

Blocked-by: nkljajic#1

This change should comes along test fixes as verified at:

https://github.com/rzr/UnifySDK/actions/runs/7544676005/job/20538549227

nkljajic added a commit to nkljajic/UnifySDK that referenced this pull request Jan 17, 2024
@rzr
Copy link
Collaborator

rzr commented Jan 17, 2024

May your rebase on main to avoid the merge commit

I confident it will be part of upcoming unify release

Thank you for your contribution

nkljajic and others added 3 commits January 17, 2024 10:25
Fixes bug where Attribute [0x3208] Value can not get resolved for legacy devices.
Size of ZW_METER_GET_V3_FRAME is smaller than size of ZW_METER_GET_V5_FRAME.
Legacy device supporting COMMAND_CLASS_METER_V3 and below will ignore received V5 frames,
because frame size is larger than expected.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
More to be tested

Bug-SiliconLabs: UIC-3082
Bug-GitHub: rzr#3
Origin: https://github.com/rzr/UnifySDK/tree/GH-14/UIC-3082/phcoval/main
Forwarded: SiliconLabs#26
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
(cherry picked from commit 92f99dc)
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
…s of CC

Bug-SiliconLabs: UIC-3082
Origin: https://github.com/rzr/UnifySDK/tree/GH-20/UIC-3082/phcoval/main
Relate-to: #1
Forwarded-SiliconLabs: task/UIC-3082/phcoval/SiliconLabsGH-20/develop
Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
@rzr
Copy link
Collaborator

rzr commented Jan 17, 2024

Origin-SiliconLabs: ver_1.5.0-unstable-79-g24f0d9eb1

@agarwal57 agarwal57 merged commit 5f597bb into SiliconLabs:main Feb 13, 2024
agarwal57 pushed a commit that referenced this pull request Feb 13, 2024
Fixes bug where Attribute [0x3208] Value can not get resolved for legacy devices.
Size of ZW_METER_GET_V3_FRAME is smaller than size of ZW_METER_GET_V5_FRAME.
Legacy device supporting COMMAND_CLASS_METER_V3 and below will ignore received V5 frames,
because frame size is larger than expected.

Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants