nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
simulated_onoff_light_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 SimulatedOnOffLightDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback) : Nrf::BridgedDeviceDataProvider(updateCallback, commandCallback) {}
15 {
16#ifdef CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC
17 k_timer_stop(&mTimer);
18#endif
19 }
20
21 void Init() override;
22 void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data,
23 size_t dataSize) override;
24 CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) override;
25
26private:
27 static void NotifyAttributeChange(intptr_t context);
28
29#ifdef CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC
30 static void TimerTimeoutCallback(k_timer *timer);
31 static constexpr uint16_t kOnOffIntervalMs = 30000;
32 k_timer mTimer;
33#endif
34 bool mOnOff = false;
35};
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
~SimulatedOnOffLightDataProvider()
Definition simulated_onoff_light_data_provider.h:14
CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) override
SimulatedOnOffLightDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback)
Definition simulated_onoff_light_data_provider.h:13
void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override
Definition simulated_onoff_light_data_provider.h:11
Definition ble_connectivity_manager.h:21