Definition at line 166 of file StateMachineDimControl.cc.
References Converter::GetVector(), kBlue, DimClient::sendCommand(), and Tools::Trim().
Referenced by RemoteControl< Shell >::SendDimCommand().
168 const lock_guard<mutex> guard(
fMutex);
171 throw runtime_error(
"SendDimCommand - Server '"+server+
"' not online.");
176 size_t p0 =
str.find_first_of(
' ');
177 if (p0==string::npos)
181 const string name =
str.substr(0, p0);
186 if (
str.empty() && is->server==server)
189 if (is->server!=server || is->service!=name)
193 throw runtime_error(
"'"+server+
"/"+name+
" not a command.");
202 const Converter conv(sout, is->format,
false);
204 const Converter conv(lout, is->format,
false);
207 throw runtime_error(
"Couldn't properly parse the format... ignored.");
210 lout <<
kBlue << server <<
'/' << name;
212 const vector<char> v = conv.GetVector(
str.substr(p0));
214 lout <<
kBlue <<
" [" << v.size() <<
"]" << endl;
216 const string cmd = server +
'/' + name;
219 throw runtime_error(
"ERROR - Sending command "+cmd+
" failed.");
225 throw runtime_error(
"SendDimCommand - Format information for "+server+
"/"+name+
" not yet available.");
static int sendCommand(const char *name, int data)
std::set< Service > fServiceList
A compiler for the DIM data format string.
std::set< std::string > fServerList