nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
bridged_device_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
9#include "binding/binding_handler.h"
10#include <app-common/zap-generated/ids/Attributes.h>
11#include <app-common/zap-generated/ids/Clusters.h>
12#include <app/util/attribute-storage.h>
13
14namespace Nrf
15{
16
18public:
19 using UpdateAttributeCallback = void (*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId,
20 chip::AttributeId attributeId, void *data, size_t dataSize);
21
22 using InvokeCommandCallback = void (*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId,
23 chip::CommandId commandId,
24 Nrf::Matter::BindingHandler::InvokeCommand invokeCommand);
25
27 InvokeCommandCallback commandCallback = nullptr)
28 {
29 mUpdateAttributeCallback = updateCallback;
30 mInvokeCommandCallback = commandCallback;
31 }
32 virtual ~BridgedDeviceDataProvider() = default;
33
34 virtual void Init() = 0;
35 virtual void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data,
36 size_t dataSize) = 0;
37
38 /* This method shall return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE for attributes that cannot be updated. */
39 virtual CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) = 0;
40
41 CHIP_ERROR NotifyReachableStatusChange(bool isReachable);
42
43protected:
46
47private:
48 struct ReachableContext {
49 bool mIsReachable;
51 };
52};
53
54} /* namespace Nrf */
BridgedDeviceDataProvider(UpdateAttributeCallback updateCallback, InvokeCommandCallback commandCallback=nullptr)
Definition bridged_device_data_provider.h:26
UpdateAttributeCallback mUpdateAttributeCallback
Definition bridged_device_data_provider.h:44
virtual CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer)=0
InvokeCommandCallback mInvokeCommandCallback
Definition bridged_device_data_provider.h:45
virtual void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize)=0
void(*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId, chip::CommandId commandId, Nrf::Matter::BindingHandler::InvokeCommand invokeCommand) InvokeCommandCallback
Definition bridged_device_data_provider.h:22
CHIP_ERROR NotifyReachableStatusChange(bool isReachable)
void(*)(BridgedDeviceDataProvider &dataProvider, chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) UpdateAttributeCallback
Definition bridged_device_data_provider.h:19
virtual ~BridgedDeviceDataProvider()=default
Definition bridged_device_data_provider.h:17
Definition ble_connectivity_manager.h:21