nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
ble_bridged_device_factory.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 "bridge_util.h"
12#include <lib/support/CHIPMem.h>
13
14#if defined(CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE) && (defined(CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE) || defined(CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE))
16
17#ifdef CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE
18#include "onoff_light.h"
19#endif
20
21#ifdef CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE
22#include "generic_switch.h"
23#endif
24
25#ifdef CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE
26#include "onoff_light_switch.h"
27#endif
28
29#endif
30
31#ifdef CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE
32#include "humidity_sensor.h"
33#endif
34
35#ifdef CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE
36#include "temperature_sensor.h"
37#endif
38
39#if defined(CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE) && defined(CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE)
41#endif
42
44{
45
46/* The values were assigned based on BT_UUID_16(uuid)->val of a BT services. */
47enum ServiceUuid : uint16_t { LedButtonService = 0xbcd1, EnvironmentalSensorService = 0x181a };
48
51using DeviceType = uint16_t;
54
57
70CHIP_ERROR CreateDevice(int deviceType, bt_addr_le_t btAddress, const char *uniqueID, const char *nodeLabel,
71 uint8_t index, uint16_t endpointId);
72
86CHIP_ERROR CreateDevice(uint16_t uuid, bt_addr_le_t btAddress, const char *uniqueID, const char *nodeLabel,
88
96CHIP_ERROR RemoveDevice(int endpointId);
97
103const char *GetUuidString(uint16_t uuid);
104
105} /* namespace BleBridgedDeviceFactory */
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 bridge_util.h:28
CHIP_ERROR RemoveDevice(int endpointId)
Remove bridged device.
BleDataProviderFactory & GetDataProviderFactory()
ServiceUuid
Definition ble_bridged_device_factory.h:47
@ LedButtonService
Definition ble_bridged_device_factory.h:47
@ EnvironmentalSensorService
Definition ble_bridged_device_factory.h:47
Nrf::BridgedDeviceDataProvider::UpdateAttributeCallback UpdateAttributeCallback
Definition ble_bridged_device_factory.h:49
CHIP_ERROR CreateDevice(int deviceType, bt_addr_le_t btAddress, const char *uniqueID, const char *nodeLabel, uint8_t index, uint16_t endpointId)
Create a bridged device using a specific device type, index and endpoint ID.
BridgedDeviceFactory & GetBridgedDeviceFactory()
const char * GetUuidString(uint16_t uuid)
Get helper string containing Bluetooth LE service name.
Nrf::BridgedDeviceDataProvider::InvokeCommandCallback InvokeCommandCallback
Definition ble_bridged_device_factory.h:50
uint16_t DeviceType
Definition ble_bridged_device_factory.h:51
Definition ble_bridged_device_factory.h:44
Definition ble_connectivity_manager.h:115