aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.cpp9
-rw-r--r--apps/apps.h17
-rw-r--r--apps/ble-inspect-device.cpp2
-rw-r--r--apps/sample-convert.cpp1
-rw-r--r--apps/sm-db-insert.cpp2
-rw-r--r--apps/sm-db-select.cpp2
-rw-r--r--apps/sm-serial-read-all.cpp6
-rw-r--r--apps/sm-serial-read.cpp2
8 files changed, 17 insertions, 24 deletions
diff --git a/apps/apps.cpp b/apps/apps.cpp
index 916b0e0..5ff8bf1 100644
--- a/apps/apps.cpp
+++ b/apps/apps.cpp
@@ -1,7 +1,12 @@
#include "apps.h"
-#include <netdb.h>
#include <log4cplus/consoleappender.h>
-#include <log4cplus/configurator.h>
+#include <log4cplus/hierarchy.h>
+#include <boost/program_options.hpp>
+#include <netdb.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
namespace trygvis {
namespace apps {
diff --git a/apps/apps.h b/apps/apps.h
index e9338a4..d54110b 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -1,10 +1,12 @@
#pragma once
-#include <boost/program_options.hpp>
#include <log4cplus/logger.h>
-#include <log4cplus/loggingmacros.h>
-#include "json.hpp"
-#include <exception>
+#include <boost/program_options/errors.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/variables_map.hpp>
+#include <stdexcept>
+#include <iosfwd>
+#include <json.hpp>
namespace trygvis {
namespace apps {
@@ -32,13 +34,6 @@ T get(json j, std::string key) {
return ref;
}
-class unknown_app : public std::runtime_error {
-public:
- unknown_app(const std::string &app_name) : runtime_error("Unknown application: " + app_name), app_name(app_name) {}
-
- const std::string app_name;
-};
-
class app_execution {
public:
app_execution(po::options_description desc, po::variables_map vm, Logger logger)
diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp
index 763dd9a..6330512 100644
--- a/apps/ble-inspect-device.cpp
+++ b/apps/ble-inspect-device.cpp
@@ -1,4 +1,4 @@
-#include <exception>
+#include <stdexcept>
#include <iostream>
#include <vector>
#include <boost/uuid/uuid_io.hpp>
diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp
index f592291..81c08ca 100644
--- a/apps/sample-convert.cpp
+++ b/apps/sample-convert.cpp
@@ -1,6 +1,5 @@
#include "trygvis/sensor.h"
#include "trygvis/sensor/io.h"
-#include "json.hpp"
#include "apps.h"
#include <fstream>
#include <boost/tokenizer.hpp>
diff --git a/apps/sm-db-insert.cpp b/apps/sm-db-insert.cpp
index b93be09..d42807e 100644
--- a/apps/sm-db-insert.cpp
+++ b/apps/sm-db-insert.cpp
@@ -2,7 +2,7 @@
#include <boost/lexical_cast.hpp>
#include <pqxx/connection.hxx>
#include <pqxx/transaction.hxx>
-#include "json.hpp"
+#include <json.hpp>
#include "apps.h"
#include <fstream>
diff --git a/apps/sm-db-select.cpp b/apps/sm-db-select.cpp
index 2390733..d9d7166 100644
--- a/apps/sm-db-select.cpp
+++ b/apps/sm-db-select.cpp
@@ -2,7 +2,7 @@
#include <boost/lexical_cast.hpp>
#include <pqxx/connection.hxx>
#include <pqxx/transaction.hxx>
-#include "json.hpp"
+#include <json.hpp>
#include "apps.h"
namespace trygvis {
diff --git a/apps/sm-serial-read-all.cpp b/apps/sm-serial-read-all.cpp
index bf5ef11..a81a016 100644
--- a/apps/sm-serial-read-all.cpp
+++ b/apps/sm-serial-read-all.cpp
@@ -1,7 +1,7 @@
#include "trygvis/sensor.h"
#include "trygvis/sensor/io.h"
-#include "json.hpp"
#include "apps.h"
+#include <dirent.h>
#include <thread>
#include <boost/asio/serial_port.hpp>
@@ -15,7 +15,6 @@ using namespace trygvis::apps;
using namespace trygvis::sensor;
using namespace trygvis::sensor::io;
namespace po = boost::program_options;
-using json = nlohmann::json;
namespace sm_serial_read_all_utils {
@@ -58,9 +57,6 @@ private:
// This only supports Linux
#if 1
-#include <sys/types.h>
-#include <dirent.h>
-
vector<string> &&find_ports() {
DIR *dir = opendir("/dev");
vector<string> ports;
diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp
index 5005554..980a3f6 100644
--- a/apps/sm-serial-read.cpp
+++ b/apps/sm-serial-read.cpp
@@ -1,6 +1,5 @@
#include "trygvis/sensor.h"
#include "trygvis/sensor/io.h"
-#include "json.hpp"
#include "apps.h"
#include <chrono>
#include <thread>
@@ -16,7 +15,6 @@ using namespace trygvis::apps;
using namespace trygvis::sensor;
using namespace trygvis::sensor::io;
namespace po = boost::program_options;
-using json = nlohmann::json;
namespace sm_serial_read_utils {