Hi Nordic Team,
I am using NCS v3.0.0 and working on a Matter-based application.
I have enabled the ActiveHardwareFaults attribute (0x0005) in the General Diagnostics cluster (0x0033) using ZAP GUI, and now I am implementing tamper detection functionality (enum value 10: TamperDetected
).
-
I have written custom logic to detect tamper events and update the
ActiveHardwareFaults
attribute accordingly. -
However, on the chip-tool side, the attribute still shows 0 entries — it does not reflect the tamper fault value.
1. My code logic for how I’m updating the ActiveHardwareFaults
attribute.
// Work handler function: runs in thread context static void tamper_work_handler(struct k_work *work) { GeneralFaults<kMaxHardwareFaults> hwFaultsPrevious; GeneralFaults<kMaxHardwareFaults> hwFaultsCurrent; using app::Clusters::GeneralDiagnostics::HardwareFaultEnum; ReturnOnFailure(hwFaultsCurrent.add(to_underlying(HardwareFaultEnum::kTamperDetected))); ReturnOnFailure(hwFaultsPrevious.add(to_underlying(HardwareFaultEnum::kTamperDetected))); LOG_ERR("Before OnHardwareFaultsDetect"); app::Clusters::GeneralDiagnosticsServer::Instance().OnHardwareFaultsDetect(hwFaultsPrevious, hwFaultsCurrent); LOG_ERR("After OnHardwareFaultsDetect"); } // GPIO button interrupt callback static void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { gpio_pin_toggle_dt(&led); tamperDetected = !tamperDetected; LOG_INF("TamperDetected set to: %s", tamperDetected ? "true" : "false"); k_work_submit(&tamper_work); // Defer heavy processing }
2.A screenshot of chip-tool output showing no tamper entry.
[1745906495.161] [26069:26186] [EM] >>> [E:30943r S:33378 M:217564310] (S) Msg RX from 1:0000000000002231 [DD9E] to 000000000001B669 --- Type 0001:05 (IM:ReportData) (B:70) [1745906495.161] [26069:26186] [EM] Handling via exchange: 30943r, Delegate: 0x6013e6a79348 [1745906495.161] [26069:26186] [DMG] ReportDataMessage = [1745906495.161] [26069:26186] [DMG] { [1745906495.161] [26069:26186] [DMG] SubscriptionId = 0xb5a61ce8, [1745906495.161] [26069:26186] [DMG] AttributeReportIBs = [1745906495.161] [26069:26186] [DMG] [ [1745906495.161] [26069:26186] [DMG] AttributeReportIB = [1745906495.161] [26069:26186] [DMG] { [1745906495.161] [26069:26186] [DMG] AttributeDataIB = [1745906495.161] [26069:26186] [DMG] { [1745906495.161] [26069:26186] [DMG] DataVersion = 0x25eb9646, [1745906495.161] [26069:26186] [DMG] AttributePathIB = [1745906495.161] [26069:26186] [DMG] { [1745906495.161] [26069:26186] [DMG] Endpoint = 0x0, [1745906495.161] [26069:26186] [DMG] Cluster = 0x33, [1745906495.161] [26069:26186] [DMG] Attribute = 0x0000_0005, [1745906495.161] [26069:26186] [DMG] } [1745906495.161] [26069:26186] [DMG] [1745906495.161] [26069:26186] [DMG] Data = [ [1745906495.161] [26069:26186] [DMG] [1745906495.161] [26069:26186] [DMG] ], [1745906495.161] [26069:26186] [DMG] }, [1745906495.161] [26069:26186] [DMG] [1745906495.161] [26069:26186] [DMG] }, [1745906495.161] [26069:26186] [DMG] [1745906495.161] [26069:26186] [DMG] ], [1745906495.161] [26069:26186] [DMG] [1745906495.161] [26069:26186] [DMG] InteractionModelRevision = 12 [1745906495.161] [26069:26186] [DMG] } [1745906495.161] [26069:26186] [TOO] Endpoint: 0 Cluster: 0x0000_0033 Attribute 0x0000_0005 DataVersion: 636196422 [1745906495.161] [26069:26186] [TOO] ActiveHardwareFaults: 0 entries
Could you please guide me on how to correctly update and report the ActiveHardwareFaults attribute so that the chip-tool reflects the tamper fault?
Thanks & Regards,
Rahul Chauhan