Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Self-review fixes
Browse files Browse the repository at this point in the history
tehampson committed Aug 7, 2024
1 parent dd94a5e commit 2d88a17
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/fabric-admin/rpc/RpcClient.cpp
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ void OnRemoveDeviceResponseCompleted(const pw_protobuf_Empty & response, pw::Sta
}
}

void GenericResponseCompletedWithNoParameters(const pw_protobuf_Empty & response, pw::Status status)
void RpcCompletedWithEmptyResponse(const pw_protobuf_Empty & response, pw::Status status)
{
std::lock_guard<std::mutex> lock(responseMutex);
responseReceived = true;
@@ -180,7 +180,7 @@ CHIP_ERROR ActiveChanged(chip::NodeId nodeId, uint32_t promisedActiveDuration)

// The RPC call is kept alive until it completes. When a response is received, it will be logged by the handler
// function and the call will complete.
auto call = fabricBridgeClient.ActiveChanged(parameters, GenericResponseCompletedWithNoParameters);
auto call = fabricBridgeClient.ActiveChanged(parameters, RpcCompletedWithEmptyResponse);

if (!call.active())
{
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ static void ActiveChangeEventWork(intptr_t arg)
event.promisedActiveDuration = data->mPromisedActiveDuration;
chip::EventNumber eventNumber = 0;

// TODO DNS this is not called from Matter event loop so it will crash
CHIP_ERROR err = chip::app::LogEvent(event, data->mEndpointId, eventNumber);
if (err != CHIP_NO_ERROR)
{
4 changes: 2 additions & 2 deletions examples/fabric-bridge-app/linux/RpcClient.cpp
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ void OnOpenCommissioningWindowCompleted(const chip_rpc_OperationStatus & respons
}

// Callback function to be called when the RPC response is received for generic empty response.
void GenericRpcCompletedWithPwStatus(const pw_protobuf_Empty & response, pw::Status status)
void RpcCompletedWithEmptyResponse(const pw_protobuf_Empty & response, pw::Status status)
{
std::lock_guard<std::mutex> lock(responseMutex);
responseReceived = true;
@@ -170,7 +170,7 @@ CHIP_ERROR KeepActive(chip::NodeId nodeId, uint32_t stayActiveDuration)

// The RPC call is kept alive until it completes. When a response is received, it will be logged by the handler
// function and the call will complete.
auto call = fabricAdminClient.KeepActive(params, GenericRpcCompletedWithPwStatus);
auto call = fabricAdminClient.KeepActive(params, RpcCompletedWithEmptyResponse);

if (!call.active())
{

0 comments on commit 2d88a17

Please sign in to comment.