nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
simulated_generic_switch_data_provider.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#pragma once
8
10
12public:
13 SimulatedGenericSwitchDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback) : Nrf::BridgedDeviceDataProvider(updateCallback, commandCallback) {}
14 ~SimulatedGenericSwitchDataProvider() { k_timer_stop(&mTimer); }
15
16 void Init() override;
17 void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data,
18 size_t dataSize) override;
19 CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) override;
20
21private:
22 static void NotifyAttributeChange(intptr_t context);
23
24 static void TimerTimeoutCallback(k_timer *timer);
25 static constexpr uint16_t kSwitchChangePositionIntervalMs = 30000;
26 k_timer mTimer;
27
28 bool mCurrentSwitchPosition = false;
29};
BridgedDeviceDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback=nullptr)
Definition bridged_device_data_provider.h:26
void(*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId, chip::CommandId commandId, Nrf::Matter::BindingHandler::InvokeCommand invokeCommand) InvokeCommandCallback
Definition bridged_device_data_provider.h:22
void(*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) UpdateAttributeCallback
Definition bridged_device_data_provider.h:19
Definition bridged_device_data_provider.h:17
SimulatedGenericSwitchDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback)
Definition simulated_generic_switch_data_provider.h:13
void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override
CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) override
~SimulatedGenericSwitchDataProvider()
Definition simulated_generic_switch_data_provider.h:14
Definition simulated_generic_switch_data_provider.h:11
Definition ble_connectivity_manager.h:21