Skip to content

Commit e244c51

Browse files
committed
GH-45: ZPC Poller Fix
Forwarded: #45 Bug-SiliconLabs: UIC-2964 Bug-Github: #45
1 parent 3b43b68 commit e244c51

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

applications/zpc/components/zpc_rust/src/zwave_poll_manager/zwave_poll_register.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ const ATTRIBUTE_ZWAVEPLUS_INFO_Z_WAVE_VERSION: AttributeTypeId = (0x5E << 8) | 0
3737
const ATTRIBUTE_HOME_ID: AttributeTypeId = 0x2;
3838
const ATTRIBUTE_ENDPOINT_ID: AttributeTypeId = 0x4;
3939

40-
//< This represents the Network Status of a node. NodeStateNetworkStatus
41-
const DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS: AttributeTypeId = 0x000D;
42-
const ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL: u8 = 1;
40+
//< DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS is taken from generated file here : components/unify_dotdot_attribute_store/zap-generated/include/unify_dotdot_defined_attribute_types.h
41+
//< 0xfd02 is the cluster ID of Unify_State.xml 0001 is the attribute ID of NetworkStatus
42+
//< Ideally ZAP should generate the .rs file for attributes ID.
43+
const DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS: AttributeTypeId = 0xfd020001;
44+
// This is taken from Unify_State.xml : NodeStateNetworkStatus type
45+
//< Even if this value is an enum8 in the cluster file, it is represented as u32 in the attribute store.
46+
const ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL: u32 = 0;
4347

4448
struct PollRegister {
4549
poll_map: Option<AttributePollMap>,
@@ -83,7 +87,7 @@ impl PollRegister {
8387
event.attribute.type_of() == DOTDOT_ATTRIBUTE_ID_STATE_NETWORK_STATUS
8488
&& event.event_type == AttributeEventType::ATTRIBUTE_UPDATED
8589
&& event.value_state == AttributeValueState::REPORTED_ATTRIBUTE
86-
&& event.attribute.get_reported::<u8>() == Ok(ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL)
90+
&& event.attribute.get_reported::<u32>() == Ok(ZCL_NODE_STATE_NETWORK_STATUS_ONLINE_FUNCTIONAL)
8791
&& is_in_home_id
8892
}
8993

0 commit comments

Comments
 (0)