Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fabric-Sync] Add the IPC support between Fabric_Admin and Fabric_Bridge #33603

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add RpcClientProcessor
yufengwangca committed Jun 3, 2024
commit 40bf9848786c9d9ffd1f94ecbd0007253129a747
3 changes: 3 additions & 0 deletions examples/fabric-admin/BUILD.gn
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ config("config") {
include_dirs = [
".",
"${chip_root}/examples/common",
"${chip_root}/examples/platform/linux",
"${chip_root}/zzz_generated/app-common/app-common",
"${chip_root}/zzz_generated/chip-tool",
"${chip_root}/src/lib",
@@ -114,6 +115,8 @@ static_library("fabric-admin-utils") {
]

sources += [
"${chip_root}/examples/platform/linux/RpcClientProcessor.cpp",
"${chip_root}/examples/platform/linux/RpcClientProcessor.h",
"${chip_root}/examples/platform/linux/system_rpc_server.cc",
"rpc/RpcClient.cpp",
"rpc/RpcClient.h",
134 changes: 29 additions & 105 deletions examples/fabric-admin/rpc/RpcClient.cpp
Original file line number Diff line number Diff line change
@@ -17,149 +17,73 @@
*/

#include "RpcClient.h"
#include "RpcClientProcessor.h"

#include <string>
#include <thread>
#include <unistd.h>

#include "fabric_bridge_service/fabric_bridge_service.rpc.pb.h"
#include "pw_assert/check.h"
#include "pw_function/function.h"
#include "pw_hdlc/decoder.h"
#include "pw_hdlc/default_addresses.h"
#include "pw_hdlc/rpc_channel.h"
#include "pw_rpc/client.h"
#include "pw_stream/socket_stream.h"

namespace {

constexpr size_t kMaxTransmissionUnit = 256;
constexpr uint32_t kRpcTimeoutMs = 1000;
const char * rpcServerAddress = "127.0.0.1";

pw::stream::SocketStream rpcSocketStream;

// Set up the output channel for the pw_rpc client to use.
pw::hdlc::RpcChannelOutput hdlc_channel_output(rpcSocketStream, pw::hdlc::kDefaultRpcAddress, "HDLC channel");

// An array of RPC channels (channels) is created, each associated with an HDLC channel output.
// This sets up the communication channels for RPC calls.
pw::rpc::Channel channels[] = { pw::rpc::Channel::Create<1>(&hdlc_channel_output) };

// Initialize the RPC client with the channels.
pw::rpc::Client client(channels);
using namespace chip;

// Generated clients are namespaced with their proto library.
using FabricBridgeClient = chip::rpc::pw_rpc::nanopb::FabricBridge::Client;
namespace {

// RPC channel ID on which to make client calls. RPC calls cannot be made on
// channel 0 (Channel::kUnassignedChannelId).
// Constants
constexpr uint32_t kDefaultChannelId = 1;

// Function to process incoming packets
void ProcessPackets()
{
std::array<std::byte, kMaxTransmissionUnit> inputBuf;
pw::hdlc::Decoder decoder(inputBuf);
// Fabric Bridge Client
rpc::pw_rpc::nanopb::FabricBridge::Client fabricBridgeClient(rpc::client::GetDefaultRpcClient(), kDefaultChannelId);
pw::rpc::NanopbUnaryReceiver<::pw_protobuf_Empty> addSynchronizedDeviceCall;

while (true)
{
std::array<std::byte, kMaxTransmissionUnit> data;
auto ret = rpcSocketStream.Read(data);
if (!ret.ok())
{
if (ret.status() == pw::Status::OutOfRange())
{
// Handle remote disconnect
rpcSocketStream.Close();
return;
}
continue;
}

for (std::byte byte : ret.value())
{
auto result = decoder.Process(byte);
if (!result.ok())
{
// Wait for more bytes that form a complete packet
continue;
}
pw::hdlc::Frame & frame = result.value();
if (frame.address() != pw::hdlc::kDefaultRpcAddress)
{
// Wrong address; ignore the packet
continue;
}

client.ProcessPacket(frame.data()).IgnoreError();
}
}
}

template <typename CallType>
CHIP_ERROR WaitForResponse(CallType & call)
{
if (!call.active())
{
return CHIP_ERROR_INTERNAL;
}

// Wait for the response or timeout
uint32_t elapsedTimeMs = 0;
const uint32_t sleepTimeMs = 100;

while (call.active() && elapsedTimeMs < kRpcTimeoutMs)
{
usleep(sleepTimeMs * 1000);
elapsedTimeMs += sleepTimeMs;
}

if (elapsedTimeMs >= kRpcTimeoutMs)
{
fprintf(stderr, "RPC Response timed out!");
return CHIP_ERROR_TIMEOUT;
}

return CHIP_NO_ERROR;
}

void AddDeviceResponse(const pw_protobuf_Empty & response, pw::Status status)
// Callback function to be called when the RPC response is received
void OnAddDeviceResponseCompleted(const pw_protobuf_Empty & response, pw::Status status)
{
if (status.ok())
{
printf("RPC call succeeded\n");
ChipLogProgress(NotSpecified, "AddSynchronizedDevice RPC call succeeded!");
}
else
{
printf("RPC call failed with status: %d\n", status.code());
ChipLogProgress(NotSpecified, "AddSynchronizedDevice RPC call failed with status: %d\n", status.code());
}
}

} // namespace

CHIP_ERROR InitRpcClient(uint16_t rpcServerPort)
{
if (rpcSocketStream.Connect(rpcServerAddress, rpcServerPort) != PW_STATUS_OK)
{
return CHIP_ERROR_NOT_CONNECTED;
}

// Start a thread to process incoming packets
std::thread packet_processor(ProcessPackets);
packet_processor.detach();

return CHIP_NO_ERROR;
rpc::client::SetRpcServerPort(rpcServerPort);
return rpc::client::StartPacketProcessing();
}

CHIP_ERROR AddSynchronizedDevice(chip::NodeId nodeId)
{
ChipLogProgress(NotSpecified, "AddSynchronizedDevice");

FabricBridgeClient fabric_bridge_client(client, kDefaultChannelId);
if (addSynchronizedDeviceCall.active())
{
ChipLogError(NotSpecified, "OpenCommissioningWindow is in progress\n");
return CHIP_ERROR_BUSY;
}

chip_rpc_SynchronizedDevice device;
device.node_id = nodeId;

// The RPC will remain active as long as `call` is alive.
auto call = fabric_bridge_client.AddSynchronizedDevice(device, AddDeviceResponse);
return WaitForResponse(call);
// The RPC will remain active as long as `addSynchronizedDeviceCall` is alive.
addSynchronizedDeviceCall = fabricBridgeClient.AddSynchronizedDevice(device, OnAddDeviceResponseCompleted);

if (!addSynchronizedDeviceCall.active())
{
return CHIP_ERROR_INTERNAL;
}

return CHIP_NO_ERROR;
}
19 changes: 19 additions & 0 deletions examples/fabric-admin/rpc/RpcClient.h
Original file line number Diff line number Diff line change
@@ -22,6 +22,25 @@

constexpr uint16_t kFabricBridgeServerPort = 33002;

/**
* @brief Initializes the RPC client with the specified server port.
*
* This function sets the RPC server port and starts packet processing for the RPC client.
*
* @param rpcServerPort The port number on which the RPC server is running.
* @return CHIP_NO_ERROR on successful initialization, or an appropriate CHIP_ERROR on failure.
*/
CHIP_ERROR InitRpcClient(uint16_t rpcServerPort);

/**
* @brief Adds a synchronized device to the RPC client.
*
* This function attempts to add a device identified by its `nodeId` to the synchronized device list.
* It logs the progress and checks if an `OpenCommissioningWindow` operation is already in progress.
* If an operation is in progress, it returns `CHIP_ERROR_BUSY`.
*
* @param nodeId The Node ID of the device to be added.
* @return CHIP_NO_ERROR on success, `CHIP_ERROR_BUSY` if an operation is already in progress,
yufengwangca marked this conversation as resolved.
Show resolved Hide resolved
* or `CHIP_ERROR_INTERNAL` if there is an internal error while activating the RPC call.
*/
CHIP_ERROR AddSynchronizedDevice(chip::NodeId nodeId);
yufengwangca marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion examples/fabric-admin/rpc/RpcServer.cpp
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ class FabricAdmin final : public chip::rpc::FabricAdmin
pw::Status OpenCommissioningWindow(const chip_rpc_DeviceInfo & request, chip_rpc_OperationStatus & response) override
{
chip::NodeId nodeId = request.node_id;
printf("Received OpenCommissioningWindow request: 0x%lx\n", nodeId);
ChipLogProgress(NotSpecified, "Received OpenCommissioningWindow request: 0x%lx", nodeId);
response.success = false;

return pw::OkStatus();
9 changes: 7 additions & 2 deletions examples/fabric-bridge-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ executable("fabric-bridge-app") {
sources = [
"${chip_root}/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h",
"Device.cpp",
"include/Device.h",
"DeviceManager.cpp",
"include/Device.h",
"include/DeviceManager.h",
"main.cpp",
]
@@ -57,6 +57,8 @@ executable("fabric-bridge-app") {
]

sources += [
"${chip_root}/examples/platform/linux/RpcClientProcessor.cpp",
"${chip_root}/examples/platform/linux/RpcClientProcessor.h",
"${chip_root}/examples/platform/linux/system_rpc_server.cc",
"RpcClient.cpp",
"RpcServer.cpp",
@@ -81,7 +83,10 @@ executable("fabric-bridge-app") {

deps += pw_build_LINK_DEPS

include_dirs += [ "${chip_root}/examples/common" ]
include_dirs += [
"${chip_root}/examples/common",
"${chip_root}/examples/platform/linux",
]
}

output_dir = root_out_dir
135 changes: 29 additions & 106 deletions examples/fabric-bridge-app/linux/RpcClient.cpp
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
*/

#include "RpcClient.h"
#include "RpcClientProcessor.h"

#include <string>
#include <thread>
@@ -30,136 +31,58 @@
#include "pw_rpc/client.h"
#include "pw_stream/socket_stream.h"

namespace {

constexpr size_t kMaxTransmissionUnit = 256;
constexpr uint32_t kRpcTimeoutMs = 1000;
const char * rpcServerAddress = "127.0.0.1";

pw::stream::SocketStream rpcSocketStream;

// Set up the output channel for the pw_rpc client to use.
pw::hdlc::RpcChannelOutput hdlc_channel_output(rpcSocketStream, pw::hdlc::kDefaultRpcAddress, "HDLC channel");

// An array of RPC channels (channels) is created, each associated with an HDLC channel output.
// This sets up the communication channels for RPC calls.
pw::rpc::Channel channels[] = { pw::rpc::Channel::Create<1>(&hdlc_channel_output) };

// Initialize the RPC client with the channels.
pw::rpc::Client client(channels);
using namespace chip;

// Generated clients are namespaced with their proto library.
using FabricAdminClient = chip::rpc::pw_rpc::nanopb::FabricAdmin::Client;
namespace {

// RPC channel ID on which to make client calls. RPC calls cannot be made on
// channel 0 (Channel::kUnassignedChannelId).
// Constants
constexpr uint32_t kDefaultChannelId = 1;

// Function to process incoming packets
void ProcessPackets()
{
std::array<std::byte, kMaxTransmissionUnit> inputBuf;
pw::hdlc::Decoder decoder(inputBuf);
// Fabric Admin Client
rpc::pw_rpc::nanopb::FabricAdmin::Client fabricAdminClient(rpc::client::GetDefaultRpcClient(), kDefaultChannelId);
pw::rpc::NanopbUnaryReceiver<::chip_rpc_OperationStatus> openCommissioningWindowCall;

while (true)
{
std::array<std::byte, kMaxTransmissionUnit> data;
auto ret = rpcSocketStream.Read(data);
if (!ret.ok())
{
if (ret.status() == pw::Status::OutOfRange())
{
// Handle remote disconnect
rpcSocketStream.Close();
return;
}
continue;
}

for (std::byte byte : ret.value())
{
auto result = decoder.Process(byte);
if (!result.ok())
{
// Wait for more bytes that form a complete packet
continue;
}
pw::hdlc::Frame & frame = result.value();
if (frame.address() != pw::hdlc::kDefaultRpcAddress)
{
// Wrong address; ignore the packet
continue;
}

client.ProcessPacket(frame.data()).IgnoreError();
}
}
}

template <typename CallType>
CHIP_ERROR WaitForResponse(CallType & call)
{
if (!call.active())
{
return CHIP_ERROR_INTERNAL;
}

// Wait for the response or timeout
uint32_t elapsedTimeMs = 0;
const uint32_t sleepTimeMs = 100;

while (call.active() && elapsedTimeMs < kRpcTimeoutMs)
{
usleep(sleepTimeMs * 1000);
elapsedTimeMs += sleepTimeMs;
}

if (elapsedTimeMs >= kRpcTimeoutMs)
{
ChipLogError(NotSpecified, "RPC Response timed out!");
return CHIP_ERROR_TIMEOUT;
}

return CHIP_NO_ERROR;
}

void OperationStatusResponse(const chip_rpc_OperationStatus & response, pw::Status status)
// Callback function to be called when the RPC response is received
void OnOpenCommissioningWindowCompleted(const chip_rpc_OperationStatus & response, pw::Status status)
{
if (status.ok())
{
ChipLogProgress(NotSpecified, "Received operation status: %d", response.success);
ChipLogProgress(NotSpecified, "OpenCommissioningWindow received operation status: %d", response.success);
}
else
{
ChipLogProgress(NotSpecified, "RPC call failed with status: %d\n", status.code());
ChipLogProgress(NotSpecified, "OpenCommissioningWindow RPC call failed with status: %d\n", status.code());
}
}

} // namespace

CHIP_ERROR InitRpcClient(uint16_t rpcServerPort)
{
if (rpcSocketStream.Connect(rpcServerAddress, rpcServerPort) != PW_STATUS_OK)
{
return CHIP_ERROR_NOT_CONNECTED;
}

// Start a thread to process incoming packets
std::thread packet_processor(ProcessPackets);
packet_processor.detach();

return CHIP_NO_ERROR;
rpc::client::SetRpcServerPort(rpcServerPort);
return rpc::client::StartPacketProcessing();
}

CHIP_ERROR OpenCommissioningWindow(chip::NodeId nodeId)
CHIP_ERROR OpenCommissioningWindow(NodeId nodeId)
{
ChipLogProgress(NotSpecified, "OpenCommissioningWindow\n");

FabricAdminClient fabric_admin_client(client, kDefaultChannelId);
if (openCommissioningWindowCall.active())
{
ChipLogError(NotSpecified, "OpenCommissioningWindow is in progress\n");
return CHIP_ERROR_BUSY;
}

chip_rpc_DeviceInfo device;
device.node_id = nodeId;

// The RPC will remain active as long as `call` is alive.
auto call = fabric_admin_client.OpenCommissioningWindow(device, OperationStatusResponse);
return WaitForResponse(call);
// The RPC will remain active as long as `openCommissioningWindowCall` is alive.
openCommissioningWindowCall = fabricAdminClient.OpenCommissioningWindow(device, OnOpenCommissioningWindowCompleted);

if (!openCommissioningWindowCall.active())
{
return CHIP_ERROR_INTERNAL;
}

return CHIP_NO_ERROR;
}
17 changes: 17 additions & 0 deletions examples/fabric-bridge-app/linux/include/RpcClient.h
Original file line number Diff line number Diff line change
@@ -22,6 +22,23 @@

constexpr uint16_t kFabricAdminServerPort = 33001;

/**
* Initializes the RPC client by setting the server port and starting packet processing.
*
* @param rpcServerPort The port number of the RPC server.
* @return CHIP_ERROR An error code indicating the success or failure of the initialization process.
* - CHIP_NO_ERROR: Initialization was successful.
* - Other error codes indicating specific failure reasons.
*/
CHIP_ERROR InitRpcClient(uint16_t rpcServerPort);

/**
* Opens a commissioning window for a specified node.
*
* @param nodeId The identifier of the node for which the commissioning window should be opened.
* @return CHIP_ERROR An error code indicating the success or failure of the operation.
* - CHIP_NO_ERROR: The commissioning window was successfully opened.
yufengwangca marked this conversation as resolved.
Show resolved Hide resolved
* - CHIP_ERROR_BUSY: Another commissioning window is currently in progress.
* - CHIP_ERROR_INTERNAL: An internal error occurred.
*/
CHIP_ERROR OpenCommissioningWindow(chip::NodeId nodeId);
yufengwangca marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 9 additions & 9 deletions examples/fabric-bridge-app/linux/main.cpp
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
#include <app/AttributeAccessInterfaceRegistry.h>
#include <lib/support/ZclString.h>

#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE)
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
#include "RpcClient.h"
#include "RpcServer.h"
#endif
@@ -64,15 +64,16 @@ void BridgePollingThread()
ChipLogProgress(NotSpecified, "Exiting.....");
exit(0);
}
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE)
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
else if (ch == 'o')
{
if (OpenCommissioningWindow(0x1234) != CHIP_NO_ERROR)
CHIP_ERROR err = OpenCommissioningWindow(0x1234);
if (err != CHIP_NO_ERROR)
{
ChipLogError(NotSpecified, "Failed to call OpenCommissioningWindow RPC");
ChipLogError(NotSpecified, "Failed to call OpenCommissioningWindow RPC: %" CHIP_ERROR_FORMAT, err.Format());
}
}
#endif
#endif // defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
continue;
}

@@ -81,7 +82,7 @@ void BridgePollingThread()
}
}

#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE)
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState)
{
if (InitRpcClient(kFabricAdminServerPort) == CHIP_NO_ERROR)
@@ -94,17 +95,16 @@ void AttemptRpcClientConnect(System::Layer * systemLayer, void * appState)
systemLayer->StartTimer(System::Clock::Seconds16(kRetryIntervalS), AttemptRpcClientConnect, nullptr);
}
}
#endif
#endif // defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE

DeviceManager gDeviceManager;

} // namespace

void ApplicationInit()
{
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE)
#if defined(PW_RPC_FABRIC_BRIDGE_SERVICE) && PW_RPC_FABRIC_BRIDGE_SERVICE
InitRpcServer(kFabricBridgeServerPort);

AttemptRpcClientConnect(&DeviceLayer::SystemLayer(), nullptr);
#endif

124 changes: 124 additions & 0 deletions examples/platform/linux/RpcClientProcessor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "RpcClientProcessor.h"

#include <string>
#include <thread>

#include "pw_hdlc/decoder.h"
#include "pw_hdlc/default_addresses.h"
#include "pw_hdlc/rpc_channel.h"
#include "pw_stream/socket_stream.h"

namespace chip {
namespace rpc {
namespace client {
namespace {

// Constants
constexpr size_t kMaxTransmissionUnit = 256;
constexpr uint32_t kDefaultChannelId = 1;
const char * kDefaultRpcServerAddress = "127.0.0.1";

// RPC Stream and Channel Setup
pw::stream::SocketStream rpcSocketStream;
pw::hdlc::RpcChannelOutput hdlcChannelOutput(rpcSocketStream, pw::hdlc::kDefaultRpcAddress, "HDLC channel");
pw::rpc::Channel channels[] = { pw::rpc::Channel::Create<1>(&hdlcChannelOutput) };
pw::rpc::Client rpcClient(channels);

// RPC Stream and Channel Setup
uint16_t rpcServerPort = 0;
const char * rpcServerAddress = kDefaultRpcServerAddress;

// Function to process incoming packets
void ProcessPackets()
{
std::array<std::byte, kMaxTransmissionUnit> inputBuf;
pw::hdlc::Decoder decoder(inputBuf);

while (true)
{
std::array<std::byte, kMaxTransmissionUnit> data;
auto ret = rpcSocketStream.Read(data);
if (!ret.ok())
{
if (ret.status() == pw::Status::OutOfRange())
{
// Handle remote disconnect
rpcSocketStream.Close();
return;
}
continue;
}

for (std::byte byte : ret.value())
{
auto result = decoder.Process(byte);
if (!result.ok())
{
// Wait for more bytes that form a complete packet
continue;
}
pw::hdlc::Frame & frame = result.value();
if (frame.address() != pw::hdlc::kDefaultRpcAddress)
{
// Wrong address; ignore the packet
continue;
}

rpcClient.ProcessPacket(frame.data()).IgnoreError();
}
}
}

} // namespace

void SetRpcServerAddress(const char * address)
{
rpcServerAddress = address;
}

void SetRpcServerPort(uint16_t port)
{
rpcServerPort = port;
}

pw::rpc::Client & GetDefaultRpcClient()
{
return rpcClient;
}

CHIP_ERROR StartPacketProcessing()
{
if (rpcSocketStream.Connect(rpcServerAddress, rpcServerPort) != PW_STATUS_OK)
{
// Handle connection error
return CHIP_ERROR_NOT_CONNECTED;
}

// Start a thread to process incoming packets
std::thread packet_processor(ProcessPackets);
packet_processor.detach();

return CHIP_NO_ERROR;
}

} // namespace client
} // namespace rpc
} // namespace chip
36 changes: 36 additions & 0 deletions examples/platform/linux/RpcClientProcessor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "pw_rpc/client.h"
#include <platform/CHIPDeviceLayer.h>
#include <unistd.h>

namespace chip {
namespace rpc {
namespace client {

void SetRpcServerAddress(const char * address);
void SetRpcServerPort(uint16_t port);
pw::rpc::Client & GetDefaultRpcClient();
CHIP_ERROR StartPacketProcessing();

} // namespace client
} // namespace rpc
} // namespace chip