Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and pan-apple committed Jun 29, 2020
1 parent df36dd7 commit 07eb5c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions examples/lock-app/nrf5/main/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ServerCallback : public SecureSessionMgrCallback
{
public:
virtual void OnMessageReceived(const MessageHeader & header, Transport::PeerConnectionState * state,
System::PacketBuffer * buffer)
System::PacketBuffer * buffer)
{
const size_t data_len = buffer->DataLength();
char src_addr[PeerAddress::kMaxToStringSize];
Expand All @@ -89,13 +89,14 @@ class ServerCallback : public SecureSessionMgrCallback
}
}

virtual void OnNewConnection(Transport::PeerConnectionState * state) {
virtual void OnNewConnection(Transport::PeerConnectionState * state)
{
CHIP_ERROR err;

NRF_LOG_INFO("Received a new connection.");

err = state->GetSecureSession().TemporaryManualKeyExchange(remote_public_key, sizeof(remote_public_key), local_private_key,
sizeof(local_private_key));
sizeof(local_private_key));
VerifyOrExit(err == CHIP_NO_ERROR, NRF_LOG_INFO("Failed to setup encryption"));

exit:
Expand All @@ -111,7 +112,6 @@ static ServerCallback gCallbacks;
void SetupTransport(IPAddressType type, SecureSessionMgr * transport)
{
CHIP_ERROR err = CHIP_NO_ERROR;


err = transport->Init(EXAMPLE_SERVER_NODEID, &DeviceLayer::InetLayer, UdpListenParameters().SetAddressType(type));
SuccessOrExit(err);
Expand Down
10 changes: 6 additions & 4 deletions examples/wifi-echo/server/esp32/main/EchoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class EchoServerCallback : public SecureSessionMgrCallback
{
public:
virtual void OnMessageReceived(const MessageHeader & header, Transport::PeerConnectionState * state,
System::PacketBuffer * buffer)
System::PacketBuffer * buffer)
{
CHIP_ERROR err;
const size_t data_len = buffer->DataLength();
Expand Down Expand Up @@ -197,20 +197,22 @@ class EchoServerCallback : public SecureSessionMgrCallback
statusLED.BlinkOnError();
}

virtual void OnNewConnection(Transport::PeerConnectionState * state) {
virtual void OnNewConnection(Transport::PeerConnectionState * state)
{
CHIP_ERROR err;

ESP_LOGI(TAG, "Received a new connection.");

err = state->GetSecureSession().TemporaryManualKeyExchange(remote_public_key, sizeof(remote_public_key), local_private_key,
sizeof(local_private_key));
sizeof(local_private_key));
VerifyOrExit(err == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to setup encryption"));

exit:
return;
}

SecureSessionMgr * mTransport = nullptr;

private:
/**
* A data model message has nonzero length and always has a first byte whose
Expand Down Expand Up @@ -242,7 +244,7 @@ static EchoServerCallback gCallbacks_v4, gCallbacks_v6;
} // namespace

// The echo server assumes the platform's networking has been setup already
void setupTransport(IPAddressType type, SecureSessionMgr * transport, EchoServerCallback* cb)
void setupTransport(IPAddressType type, SecureSessionMgr * transport, EchoServerCallback * cb)
{
CHIP_ERROR err = CHIP_NO_ERROR;
struct netif * netif = NULL;
Expand Down

0 comments on commit 07eb5c2

Please sign in to comment.