diff --git a/ChangeLog b/ChangeLog index 79a43634..f5683581 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14769,3 +14769,7 @@ * Fixed a bug in 'lib/rdmatrix.cpp' that caused the configuration for 'Software Authority Protocol' to grey out the 'IP Address' field when creating a new matrix. +2015-02-21 Fred Gleason + * Added support for selecting router number when using Software + Authority Protocol in 'ripcd/swauthority.cpp' and + 'ripcd/swauthority.h'. diff --git a/ripcd/swauthority.cpp b/ripcd/swauthority.cpp index 130a2982..50fd5f1f 100644 --- a/ripcd/swauthority.cpp +++ b/ripcd/swauthority.cpp @@ -42,6 +42,7 @@ SoftwareAuthority::SoftwareAuthority(RDMatrix *matrix,QObject *parent,const char swa_porttype=matrix->portType(RDMatrix::Primary); swa_ipaddress=matrix->ipAddress(RDMatrix::Primary); swa_ipport=matrix->ipPort(RDMatrix::Primary); + swa_card=matrix->card(); swa_inputs=0; swa_outputs=0; swa_gpis=matrix->gpis(); @@ -124,7 +125,7 @@ void SoftwareAuthority::processCommand(RDMacro *cmd) emit rmlEcho(cmd); return; } - SendCommand(QString().sprintf("activateroute 1 %d %d", + SendCommand(QString().sprintf("activateroute %d %d %d",swa_card, cmd->arg(2).toInt(),cmd->arg(1).toInt())); cmd->acknowledge(true); emit rmlEcho(cmd); @@ -294,9 +295,9 @@ void SoftwareAuthority::DispatchCommand() // Startup Sequence. Get the input and output lists. // if(section=="login successful") { - sprintf(buffer,"sourcenames 1\x0D\x0A"); // Request Input List + sprintf(buffer,"sourcenames %d\x0D\x0A",swa_card); // Request Input List SendCommand(buffer); - sprintf(buffer,"destnames 1\x0D\x0A"); // Request Output List + sprintf(buffer,"destnames %d\x0D\x0A",swa_card); // Request Output List SendCommand(buffer); return; } @@ -311,12 +312,12 @@ void SoftwareAuthority::DispatchCommand() switch(swa_istate) { case 0: // No section selected - if(section=="begin sourcenames - 1") { + if(section==QString().sprintf("begin sourcenames - %d",swa_card)) { swa_istate=1; swa_inputs=0; return; } - if(section=="begin destnames - 1") { + if(section==QString().sprintf("begin destnames - %d",swa_card)) { swa_istate=2; swa_outputs=0; return; @@ -324,7 +325,7 @@ void SoftwareAuthority::DispatchCommand() break; case 1: // Source List - if(section=="end sourcenames - 1") { + if(section==QString().sprintf("end sourcenames - %d",swa_card)) { swa_istate=0; sql=QString("update MATRICES set ")+ QString().sprintf("INPUTS=%d ",swa_inputs)+ @@ -367,7 +368,7 @@ void SoftwareAuthority::DispatchCommand() break; case 2: // Destinations List - if(section=="end destnames - 1") { + if(section==QString().sprintf("end destnames - %d",swa_card)) { swa_istate=0; sql=QString("update MATRICES set ")+ QString().sprintf("OUTPUTS=%d ",swa_outputs)+ diff --git a/ripcd/swauthority.h b/ripcd/swauthority.h index f8f3db5c..5fc87db1 100644 --- a/ripcd/swauthority.h +++ b/ripcd/swauthority.h @@ -67,6 +67,7 @@ class SoftwareAuthority : public Switcher QString swa_username; QString swa_password; int swa_matrix; + int swa_card; int swa_ipport; int swa_inputs; int swa_outputs;