Update rpiConfigServer formatting
This commit is contained in:
+3
-3
@@ -5,8 +5,8 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WPIUTIL_DATAHISTORY_H_
|
||||
#define WPIUTIL_DATAHISTORY_H_
|
||||
#ifndef RPICONFIGSERVER_DATAHISTORY_H_
|
||||
#define RPICONFIGSERVER_DATAHISTORY_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -53,4 +53,4 @@ class DataHistory {
|
||||
size_t m_qty = 0;
|
||||
};
|
||||
|
||||
#endif // WPIUTIL_DATAHISTORY_H_
|
||||
#endif // RPICONFIGSERVER_DATAHISTORY_H_
|
||||
|
||||
+3
-2
@@ -7,9 +7,10 @@
|
||||
|
||||
#include "MyHttpConnection.h"
|
||||
|
||||
#include <wpi/UrlParser.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "WebSocketHandlers.h"
|
||||
#include "wpi/UrlParser.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
|
||||
// static resources
|
||||
namespace wpi {
|
||||
|
||||
+6
-6
@@ -5,14 +5,14 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WPIUTIL_MYHTTPCONNECTION_H_
|
||||
#define WPIUTIL_MYHTTPCONNECTION_H_
|
||||
#ifndef RPICONFIGSERVER_MYHTTPCONNECTION_H_
|
||||
#define RPICONFIGSERVER_MYHTTPCONNECTION_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/HttpServerConnection.h"
|
||||
#include "wpi/WebSocketServer.h"
|
||||
#include "wpi/uv/Stream.h"
|
||||
#include <wpi/HttpServerConnection.h>
|
||||
#include <wpi/WebSocketServer.h>
|
||||
#include <wpi/uv/Stream.h>
|
||||
|
||||
class MyHttpConnection : public wpi::HttpServerConnection,
|
||||
public std::enable_shared_from_this<MyHttpConnection> {
|
||||
@@ -25,4 +25,4 @@ class MyHttpConnection : public wpi::HttpServerConnection,
|
||||
wpi::WebSocketServerHelper m_websocketHelper;
|
||||
};
|
||||
|
||||
#endif // WPIUTIL_MYHTTPCONNECTION_H_
|
||||
#endif // RPICONFIGSERVER_MYHTTPCONNECTION_H_
|
||||
|
||||
+6
-6
@@ -7,12 +7,12 @@
|
||||
|
||||
#include "SystemStatus.h"
|
||||
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/json.h"
|
||||
#include "wpi/raw_istream.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/raw_istream.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
std::shared_ptr<SystemStatus> SystemStatus::GetInstance() {
|
||||
static auto sysStatus = std::make_shared<SystemStatus>(private_init{});
|
||||
|
||||
+5
-4
@@ -5,13 +5,14 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WPIUTIL_SYSTEMSTATUS_H_
|
||||
#define WPIUTIL_SYSTEMSTATUS_H_
|
||||
#ifndef RPICONFIGSERVER_SYSTEMSTATUS_H_
|
||||
#define RPICONFIGSERVER_SYSTEMSTATUS_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <wpi/Signal.h>
|
||||
|
||||
#include "DataHistory.h"
|
||||
#include "wpi/Signal.h"
|
||||
|
||||
namespace wpi {
|
||||
class json;
|
||||
@@ -57,4 +58,4 @@ class SystemStatus {
|
||||
DataHistory<NetworkData, 6> m_network;
|
||||
};
|
||||
|
||||
#endif // WPIUTIL_SYSTEMSTATUS_H_
|
||||
#endif // RPICONFIGSERVER_SYSTEMSTATUS_H_
|
||||
|
||||
+8
-14
@@ -7,24 +7,22 @@
|
||||
|
||||
#include "VisionStatus.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/json.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include "wpi/uv/Buffer.h"
|
||||
#include "wpi/uv/Pipe.h"
|
||||
#include "wpi/uv/Process.h"
|
||||
#include "wpi/uv/Work.h"
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/uv/Buffer.h>
|
||||
#include <wpi/uv/Pipe.h>
|
||||
#include <wpi/uv/Process.h>
|
||||
#include <wpi/uv/Work.h>
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
@@ -37,7 +35,6 @@ std::shared_ptr<VisionStatus> VisionStatus::GetInstance() {
|
||||
|
||||
void VisionStatus::RunSvc(const char* cmd,
|
||||
std::function<void(wpi::StringRef)> onFail) {
|
||||
#ifndef _WIN32
|
||||
struct SvcWorkReq : public uv::WorkReq {
|
||||
SvcWorkReq(const char* cmd_, std::function<void(wpi::StringRef)> onFail_)
|
||||
: cmd(cmd_), onFail(onFail_) {}
|
||||
@@ -69,7 +66,6 @@ void VisionStatus::RunSvc(const char* cmd,
|
||||
});
|
||||
|
||||
uv::QueueWork(m_loop, workReq);
|
||||
#endif
|
||||
}
|
||||
|
||||
void VisionStatus::Up(std::function<void(wpi::StringRef)> onFail) {
|
||||
@@ -93,7 +89,6 @@ void VisionStatus::Kill(std::function<void(wpi::StringRef)> onFail) {
|
||||
}
|
||||
|
||||
void VisionStatus::UpdateStatus() {
|
||||
#ifndef _WIN32
|
||||
struct StatusWorkReq : public uv::WorkReq {
|
||||
bool enabled = false;
|
||||
wpi::SmallString<128> status;
|
||||
@@ -178,7 +173,6 @@ void VisionStatus::UpdateStatus() {
|
||||
});
|
||||
|
||||
uv::QueueWork(m_loop, workReq);
|
||||
#endif
|
||||
}
|
||||
|
||||
void VisionStatus::ConsoleLog(uv::Buffer& buf, size_t len) {
|
||||
|
||||
+5
-5
@@ -5,14 +5,14 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WPIUTIL_VISIONSTATUS_H_
|
||||
#define WPIUTIL_VISIONSTATUS_H_
|
||||
#ifndef RPICONFIGSERVER_VISIONSTATUS_H_
|
||||
#define RPICONFIGSERVER_VISIONSTATUS_H_
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/Signal.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include <wpi/Signal.h>
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
namespace wpi {
|
||||
class json;
|
||||
@@ -54,4 +54,4 @@ class VisionStatus {
|
||||
std::shared_ptr<wpi::uv::Loop> m_loop;
|
||||
};
|
||||
|
||||
#endif // WPIUTIL_VISIONSTATUS_H_
|
||||
#endif // RPICONFIGSERVER_VISIONSTATUS_H_
|
||||
|
||||
+9
-8
@@ -9,16 +9,17 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/WebSocket.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Pipe.h>
|
||||
#include <wpi/uv/Process.h>
|
||||
|
||||
#include "SystemStatus.h"
|
||||
#include "VisionStatus.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/WebSocket.h"
|
||||
#include "wpi/json.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include "wpi/raw_uv_ostream.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
#include "wpi/uv/Pipe.h"
|
||||
#include "wpi/uv/Process.h"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
|
||||
+4
-4
@@ -5,10 +5,10 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WPIUTIL_WEBSOCKETHANDLERS_H_
|
||||
#define WPIUTIL_WEBSOCKETHANDLERS_H_
|
||||
#ifndef RPICONFIGSERVER_WEBSOCKETHANDLERS_H_
|
||||
#define RPICONFIGSERVER_WEBSOCKETHANDLERS_H_
|
||||
|
||||
#include "wpi/StringRef.h"
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
namespace wpi {
|
||||
class WebSocket;
|
||||
@@ -17,4 +17,4 @@ class WebSocket;
|
||||
void InitWs(wpi::WebSocket& ws);
|
||||
void ProcessWsText(wpi::WebSocket& ws, wpi::StringRef msg);
|
||||
|
||||
#endif // WPIUTIL_WEBSOCKETHANDLERS_H_
|
||||
#endif // RPICONFIGSERVER_WEBSOCKETHANDLERS_H_
|
||||
|
||||
+11
-10
@@ -8,19 +8,20 @@
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
#include <wpi/ArrayRef.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/timestamp.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Process.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
#include <wpi/uv/Udp.h>
|
||||
|
||||
#include "MyHttpConnection.h"
|
||||
#include "SystemStatus.h"
|
||||
#include "VisionStatus.h"
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/StringRef.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include "wpi/raw_uv_ostream.h"
|
||||
#include "wpi/timestamp.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
#include "wpi/uv/Process.h"
|
||||
#include "wpi/uv/Tcp.h"
|
||||
#include "wpi/uv/Timer.h"
|
||||
#include "wpi/uv/Udp.h"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user