updated networking
This commit is contained in:
@@ -221,21 +221,20 @@ boost::optional<Poco::JSON::Object> OutputRequestHandler::parseSound(const std::
|
||||
return response;
|
||||
}
|
||||
|
||||
boost::optional<Poco::JSON::Object> OutputRequestHandler::parseDisplay(const std::string& item_name, const std::string& action, const std::string& score)
|
||||
boost::optional<Poco::JSON::Object> OutputRequestHandler::parseDisplay(const std::string& display_name, const std::string& action, const std::string& score)
|
||||
{
|
||||
Poco::JSON::Object response;
|
||||
if(item_name == "")
|
||||
if(display_name == "")
|
||||
{
|
||||
response.set("displays", this->output_driver->get_displays());
|
||||
return response;
|
||||
}
|
||||
|
||||
uint8_t display_number = std::stoi(item_name);
|
||||
auto opt_display = this->output_driver->get_display(display_number);
|
||||
auto opt_display = this->output_driver->get_display(display_name);
|
||||
|
||||
if(!opt_display)
|
||||
{
|
||||
throw new Poco::NotFoundException("No display with number \"" + item_name + "\"!");
|
||||
throw new Poco::NotFoundException("No display with name \"" + display_name + "\"!");
|
||||
}
|
||||
|
||||
auto display = opt_display->get();
|
||||
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
boost::optional<Poco::JSON::Object> parseSolenoid(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseLamp(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseSound(const std::string& item_name, const std::string& action);
|
||||
boost::optional<Poco::JSON::Object> parseDisplay(const std::string& item_name, const std::string& action, const std::string& score);
|
||||
boost::optional<Poco::JSON::Object> parseDisplay(const std::string& display_name, const std::string& action, const std::string& score);
|
||||
boost::optional<Poco::JSON::Object> parseFlipper(const std::string& item_name, const std::string& action);
|
||||
|
||||
std::vector<std::string> getPathSegments(Poco::URI uri);
|
||||
|
||||
Reference in New Issue
Block a user