26
26
#include " controller/InvokeInteraction.h"
27
27
28
28
namespace {
29
- void BoundDeviceChangedHandler (const EmberBindingTableEntry * binding, chip::DeviceProxy * peer_device, void * context)
29
+ void BoundDeviceChangedHandler (const EmberBindingTableEntry & binding, chip::DeviceProxy * peer_device, void * context)
30
30
{
31
31
using namespace chip ;
32
32
using namespace chip ::app;
@@ -38,17 +38,18 @@ void BoundDeviceChangedHandler(const EmberBindingTableEntry * binding, chip::Dev
38
38
ChipLogError (NotSpecified, " OnOff command failed: %" CHIP_ERROR_FORMAT, error.Format ());
39
39
};
40
40
41
- if (binding-> type == EMBER_MULTICAST_BINDING)
41
+ if (binding. type == EMBER_MULTICAST_BINDING)
42
42
{
43
43
ChipLogError (NotSpecified, " Group binding is not supported now" );
44
44
return ;
45
45
}
46
46
47
- if (binding->type == EMBER_UNICAST_BINDING && binding->local == 1 && binding->clusterId == Clusters::OnOff::Id)
47
+ if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 && binding.clusterId .HasValue () &&
48
+ binding.clusterId .Value () == Clusters::OnOff::Id)
48
49
{
49
50
Clusters::OnOff::Commands::Toggle::Type toggleCommand;
50
- Controller::InvokeCommandRequest (peer_device->GetExchangeManager (), peer_device->GetSecureSession ().Value (),
51
- binding-> remote , toggleCommand, onSuccess, onFailure);
51
+ Controller::InvokeCommandRequest (peer_device->GetExchangeManager (), peer_device->GetSecureSession ().Value (), binding. remote ,
52
+ toggleCommand, onSuccess, onFailure);
52
53
}
53
54
}
54
55
} // namespace
0 commit comments