Skip to content

Commit

Permalink
Call callback with context (self)
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed Dec 11, 2023
1 parent a552052 commit 8a7ba72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controller/python/ChipDeviceController-ScriptBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,14 +745,14 @@ struct GetDeviceCallbacks
{
auto * self = static_cast<GetDeviceCallbacks *>(context);
auto * operationalDeviceProxy = new OperationalDeviceProxy(&exchangeMgr, sessionHandle);
self->mCallback(operationalDeviceProxy, ToPyChipError(CHIP_NO_ERROR));
self->mCallback(context, operationalDeviceProxy, ToPyChipError(CHIP_NO_ERROR));
delete self;
}

static void OnConnectionFailureFn(void * context, const ScopedNodeId & peerId, CHIP_ERROR error)
{
auto * self = static_cast<GetDeviceCallbacks *>(context);
self->mCallback(nullptr, ToPyChipError(error));
self->mCallback(context, nullptr, ToPyChipError(error));
delete self;
}

Expand Down

0 comments on commit 8a7ba72

Please sign in to comment.