42 process(
const EMANERemoteControlPortAPI::Request::Query::Configuration & configuration,
43 std::uint32_t u32Sequence,
44 std::uint32_t u32Reference)
46 std::vector<std::string> names;
48 for(
int i = 0; i < configuration.names_size(); ++i)
50 names.push_back(configuration.names(i));
57 auto configurationValues =
61 response.set_type(EMANERemoteControlPortAPI::Response::TYPE_RESPONSE_QUERY);
63 auto pQuery = response.mutable_query();
67 auto pConfiguration = pQuery->mutable_configuration();
69 pConfiguration->set_buildid(configuration.buildid());
71 for(
const auto & value : configurationValues)
73 auto pParameter = pConfiguration->add_parameters();
75 pParameter->set_name(value.first);
77 for(
const auto & any : value.second)
79 auto pValue = pParameter->add_values();
87 response.set_type(EMANERemoteControlPortAPI::Response::TYPE_RESPONSE_ERROR);
89 auto pError = response.mutable_error();
91 pError->set_type(EMANERemoteControlPortAPI::Response::Error::TYPE_ERROR_PARAMETER);
93 pError->set_description(exp.
what());
96 response.set_reference(u32Reference);
98 response.set_sequence(u32Sequence);
100 std::string sSerialization;
102 if(!response.SerializeToString(&sSerialization))
107 return sSerialization;
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
std::vector< std::pair< std::string, std::vector< Any > > > queryConfiguration(BuildId buildId, const std::vector< std::string > &names={}) const
const char * what() const
static std::string process(const EMANERemoteControlPortAPI::Request::Query::Configuration &configuration, std::uint32_t u32Sequence, std::uint32_t u32Reference)
RegistrarException is thrown when an exception occurs during registration.
void convertToAny(EMANERemoteControlPortAPI::Any *pAny, const EMANE::Any &any)
static ConfigurationService * instance()
int TYPE_QUERY_CONFIGURATION