mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-10 16:43:35 +02:00
2018-06-23 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression that broke processing of the 'Serial Out' ['SO'] and 'UDP Out' ['UO'] RMLs.
This commit is contained in:
@@ -17512,3 +17512,6 @@
|
||||
switcher/gpio driver.
|
||||
2018-06-23 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in ripcd(8) that broke local RML processing.
|
||||
2018-06-23 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression that broke processing of the 'Serial Out' ['SO']
|
||||
and 'UDP Out' ['UO'] RMLs.
|
||||
|
@@ -1158,48 +1158,49 @@ bool RDModulesActive()
|
||||
return RDProcessActive(cmds);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
QByteArray RDStringToData(const QString &str)
|
||||
{
|
||||
QByteArray ret;
|
||||
#ifndef WIN32
|
||||
int istate=0;
|
||||
QString hexcode="";
|
||||
unsigned n;
|
||||
QString code;
|
||||
QByteArray ret;
|
||||
bool ok=false;
|
||||
|
||||
for(unsigned i=0;i<str.length();i++) {
|
||||
for(int i=0;i<str.length();i++) {
|
||||
switch(istate) {
|
||||
case 0:
|
||||
if((str.at(i)=='%')&&(i<(str.length()-2))) {
|
||||
hexcode="";
|
||||
if(str.at(i)==QChar('%')) {
|
||||
istate=1;
|
||||
}
|
||||
else {
|
||||
ret.resize(ret.size()+1);
|
||||
ret[ret.size()-1]=str.at(i);
|
||||
ret+=str.at(i);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
hexcode=str.at(i);
|
||||
n=str.mid(i,1).toUInt(&ok);
|
||||
if((!ok)||(n>9)) {
|
||||
istate=0;
|
||||
}
|
||||
code=str.mid(i,1);
|
||||
istate=2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
hexcode+=str.at(i);
|
||||
ret.resize(ret.size()+1);
|
||||
ret[ret.size()-1]=0xFF&hexcode.toUInt(NULL,16);
|
||||
istate=0;
|
||||
break;
|
||||
|
||||
default:
|
||||
n=str.mid(i,1).toUInt(&ok);
|
||||
if((!ok)||(n>9)) {
|
||||
istate=0;
|
||||
}
|
||||
code+=str.mid(i,1);
|
||||
ret+=code.toUInt(NULL,16);
|
||||
istate=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
QList<pid_t> RDGetPids(const QString &program)
|
||||
|
@@ -113,7 +113,7 @@ QColor RDGetTextColor(const QColor &background_color);
|
||||
bool RDProcessActive(const QString &cmd);
|
||||
bool RDProcessActive(const QStringList &cmds);
|
||||
bool RDModulesActive();
|
||||
//QByteArray RDStringToData(const QString &str);
|
||||
QByteArray RDStringToData(const QString &str);
|
||||
QList<pid_t> RDGetPids(const QString &program);
|
||||
|
||||
#endif // RDCONF_H
|
||||
|
@@ -671,7 +671,7 @@ void MainObject::RunLocalMacros(RDMacro *rml_in)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
|
||||
case RDMacro::SO:
|
||||
tty_port=rml->arg(0).toInt();
|
||||
if((tty_port<0)||(tty_port>MAX_TTYS)) {
|
||||
@@ -707,12 +707,12 @@ void MainObject::RunLocalMacros(RDMacro *rml_in)
|
||||
break;
|
||||
}
|
||||
data=RDStringToData(str);
|
||||
ripcd_tty_dev[tty_port]->writeBlock((const char *)data,data.size());
|
||||
ripcd_tty_dev[tty_port]->write(data);
|
||||
rml->acknowledge(true);
|
||||
sendRml(rml);
|
||||
return;
|
||||
break;
|
||||
*/
|
||||
|
||||
case RDMacro::CL:
|
||||
case RDMacro::FS:
|
||||
case RDMacro::GO:
|
||||
@@ -855,7 +855,7 @@ void MainObject::RunLocalMacros(RDMacro *rml_in)
|
||||
sendRml(rml);
|
||||
}
|
||||
break;
|
||||
/*
|
||||
|
||||
case RDMacro::UO:
|
||||
if(rml->argQuantity()<3) {
|
||||
if(rml->echoRequested()) {
|
||||
@@ -886,17 +886,14 @@ void MainObject::RunLocalMacros(RDMacro *rml_in)
|
||||
sprintf("Sending \"%s\" to %s:%d",(const char *)str,
|
||||
(const char *)addr.toString(),rml->arg(1).toInt()));
|
||||
data=RDStringToData(str);
|
||||
ripcd_rml_send->writeBlock((const char *)data,data.size(),addr,
|
||||
(Q_UINT16)(rml->arg(1).toInt()));
|
||||
ripcd_rml_send->writeDatagram(data,addr,(Q_UINT16)(rml->arg(1).toInt()));
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
sendRml(rml);
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
default:
|
||||
// LogLine(RDConfig::LogDebug,QString().sprintf("unhandled rml: \'%s\' from %s",
|
||||
// (const char *)logstr,(const char *)rml->address()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user