Skip to content

Commit

Permalink
applications: Matter Bridge: Use common binding handler
Browse files Browse the repository at this point in the history
This commit removes Matter Bridge specific binding handler,
and re-uses the common one.

Signed-off-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
  • Loading branch information
LipinskiPNordicSemi authored and nordicjm committed Jan 5, 2024
1 parent 33cfc1c commit 2790dbd
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 195 deletions.
2 changes: 1 addition & 1 deletion applications/matter_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ target_sources(app PRIVATE
${COMMON_ROOT}/src/bridge/matter_bridged_device.cpp
${COMMON_ROOT}/src/bridge/bridge_storage_manager.cpp
${COMMON_ROOT}/src/bridge/bridged_device_data_provider.cpp
${COMMON_ROOT}/src/bridge/binding_handler.cpp
${COMMON_ROOT}/src/binding/binding_handler.cpp
src/zap-generated/IMClusterCommandHandler.cpp
src/zap-generated/callback-stub.cpp
${COMMON_ROOT}/src/led/led_widget.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ble_lbs_data_provider.h"

#ifdef CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE
#include "binding_handler.h"
#include "binding/binding_handler.h"
#endif

#include <bluetooth/gatt_dm.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include "simulated_onoff_light_switch_data_provider.h"
#include "binding_handler.h"
#include "binding/binding_handler.h"

#include <zephyr/logging/log.h>

Expand Down
137 changes: 0 additions & 137 deletions samples/matter/common/src/bridge/binding_handler.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions samples/matter/common/src/bridge/binding_handler.h

This file was deleted.

7 changes: 3 additions & 4 deletions samples/matter/common/src/bridge/bridge_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "bridge_manager.h"

#include "binding_handler.h"
#include "binding/binding_handler.h"

#include <app-common/zap-generated/ids/Clusters.h>
#include <app/reporting/reporting.h>
Expand Down Expand Up @@ -41,7 +41,7 @@ CHIP_ERROR BridgeManager::Init(LoadStoredBridgedDevicesCallback loadStoredBridge
emberAfEndpointEnableDisable(emberAfEndpointFromIndex(static_cast<uint16_t>(emberAfFixedEndpointCount() - 1)),
false);

BindingHandler::GetInstance().Init();
BindingHandler::Init();

/* Invoke the callback to load stored devices in a proper moment. */
CHIP_ERROR err = loadStoredBridgedDevicesCb();
Expand Down Expand Up @@ -425,8 +425,7 @@ void BridgeManager::HandleCommand(BridgedDeviceDataProvider &dataProvider, Clust
}
}

DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::DeviceWorkerHandler,
reinterpret_cast<intptr_t>(bindingData));
BindingHandler::RunBoundClusterAction(bindingData);
}

BridgedDeviceDataProvider *BridgeManager::GetProvider(EndpointId endpoint, uint16_t &deviceType)
Expand Down
2 changes: 1 addition & 1 deletion samples/matter/common/src/bridge/bridge_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "bridge_util.h"
#include "bridged_device_data_provider.h"
#include "matter_bridged_device.h"
#include "binding_handler.h"
#include "binding/binding_handler.h"

class BridgeManager {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/util/attribute-storage.h>
#include "binding_handler.h"
#include "binding/binding_handler.h"

class BridgedDeviceDataProvider {
public:
Expand Down

0 comments on commit 2790dbd

Please sign in to comment.