Added options to server application and did some stuff for the application
This commit is contained in:
@@ -4,7 +4,12 @@
|
||||
|
||||
#ifndef FLIPPR_DRIVER_FLIPPRSERVER_H
|
||||
#define FLIPPR_DRIVER_FLIPPRSERVER_H
|
||||
|
||||
#include "output/OutputDriver.h"
|
||||
#include "input/InputDriver.h"
|
||||
|
||||
#include <Poco/Util/ServerApplication.h>
|
||||
#include <Poco/Net/HTTPServer.h>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -13,7 +18,43 @@ namespace networking
|
||||
|
||||
class FlippRServer : public Poco::Util::ServerApplication
|
||||
{
|
||||
public:
|
||||
FlippRServer();
|
||||
|
||||
int main(const std::vector<std::string>& args);
|
||||
|
||||
void initialize(Poco::Util::Application& self);
|
||||
|
||||
void defineOptions(Poco::Util::OptionSet& options);
|
||||
|
||||
void handle_set_input_port(const std::string &name, const std::string &port);
|
||||
void handle_set_output_port(const std::string &name, const std::string &port);
|
||||
void handle_help(const std::string &name, const std::string &port);
|
||||
void handle_config_file(const std::string &name, const std::string &value);
|
||||
|
||||
private:
|
||||
void initialize_output_driver();
|
||||
void parse_server_config_file();
|
||||
|
||||
Poco::Net::HTTPServer* build_output_server();
|
||||
|
||||
|
||||
private:
|
||||
int input_port;
|
||||
int output_port;
|
||||
|
||||
bool help_requested;
|
||||
|
||||
std::string input_config;
|
||||
std::string matrix_config;
|
||||
std::string output_pin_config;
|
||||
std::string lamp_config;
|
||||
std::string solenoid_config;
|
||||
std::string sound_config;
|
||||
std::string display_config;
|
||||
|
||||
std::shared_ptr<input::InputDriver> input_driver;
|
||||
std::shared_ptr<output::OutputDriver> output_driver;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user