Skip to content

Commit

Permalink
Pushing through clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
nekomona committed Jul 4, 2023
1 parent 431da72 commit 77d1cb1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 41 deletions.
21 changes: 7 additions & 14 deletions src/logging/RemoteLogHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#include <Arduino.h>

#include "GlobalVars.h"

namespace SlimeVR
{
namespace Logging
{
bool getRemoteCmdConncted()
{
return networkRemoteCmd.isConnected();
}
namespace SlimeVR {
namespace Logging {
bool getRemoteCmdConncted() { return networkRemoteCmd.isConnected(); }

Stream & getRemoteCmdStream()
{
return networkRemoteCmd.getStream();
}
}
}
Stream& getRemoteCmdStream() { return networkRemoteCmd.getStream(); }
} // namespace Logging
} // namespace SlimeVR
16 changes: 7 additions & 9 deletions src/logging/RemoteLogHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

#include <Arduino.h>

namespace SlimeVR
{
namespace Logging
{
bool getRemoteCmdConncted();
Stream & getRemoteCmdStream();
}
}
namespace SlimeVR {
namespace Logging {
bool getRemoteCmdConncted();
Stream& getRemoteCmdStream();
} // namespace Logging
} // namespace SlimeVR

#endif // LOGGING_RETOMELOGHELPER_H
#endif // LOGGING_RETOMELOGHELPER_H
21 changes: 8 additions & 13 deletions src/network/remotecmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
namespace SlimeVR {
namespace Network {

void RemoteCmd::reset()
{
void RemoteCmd::reset() {
rcmdClient = WiFiClient();
rcmdServer.begin();
}

void RemoteCmd::update()
{
void RemoteCmd::update() {
// Check for new connections to remote command
if (rcmdServer.hasClient()) {
if (rcmdClient.connected()) {
Expand All @@ -19,20 +17,17 @@ void RemoteCmd::update()
r_Logger.info("Remote command multi-connection dropped");
} else {
rcmdClient = rcmdServer.accept();
r_Logger.info("Remote command from %s connected", rcmdClient.remoteIP().toString().c_str());
r_Logger.info(
"Remote command from %s connected",
rcmdClient.remoteIP().toString().c_str()
);
}
}
}

bool RemoteCmd::isConnected()
{
return rcmdClient.connected();
}
bool RemoteCmd::isConnected() { return rcmdClient.connected(); }

Stream & RemoteCmd::getStream()
{
return rcmdClient;
}
Stream& RemoteCmd::getStream() { return rcmdClient; }

} // namespace Network
} // namespace SlimeVR
11 changes: 6 additions & 5 deletions src/network/remotecmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
#ifndef SLIMEVR_NETWORK_REMOTECMD_H_
#define SLIMEVR_NETWORK_REMOTECMD_H_

#include <WiFiClient.h>
#include <WiFiServer.h>

#include "globals.h"
#include "logging/Logger.h"
#include <WiFiServer.h>
#include <WiFiClient.h>

namespace SlimeVR {
namespace Network {
Expand All @@ -37,13 +38,13 @@ class RemoteCmd {
void update();

bool isConnected();
Stream & getStream();
Stream& getStream();

private:
SlimeVR::Logging::Logger r_Logger = SlimeVR::Logging::Logger("RemoteCmd");

WiFiServer rcmdServer = WiFiServer(23);
WiFiClient rcmdClient;
WiFiServer rcmdServer = WiFiServer(23);
WiFiClient rcmdClient;
};

} // namespace Network
Expand Down

0 comments on commit 77d1cb1

Please sign in to comment.