mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-14 22:51:13 +02:00
2019-07-23 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions that made serial device operation unreliable.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Rivendell switcher driver for the BroadcastTools 16x2
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -148,7 +148,7 @@ void Bt16x2::processCommand(RDMacro *cmd)
|
||||
}
|
||||
if(cmd->arg(1).lower()=="o") {
|
||||
sprintf(str,"*%dOR%02dF",BT16X2_UNIT_ID,cmd->arg(2).toInt());
|
||||
bt_device->writeBlock(str,6);
|
||||
bt_device->write(str,6);
|
||||
emit gpoChanged(bt_matrix,cmd->arg(2).toInt()-1,false);
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ void Bt16x2::processCommand(RDMacro *cmd)
|
||||
else {
|
||||
if(cmd->arg(3).toInt()==-1) { // Clear input
|
||||
bt_gpi_mask[cmd->arg(2).toInt()-1]=false;
|
||||
bt_device->writeBlock("*0SPA",5);
|
||||
bt_device->write("*0SPA",5);
|
||||
}
|
||||
else {
|
||||
if(cmd->arg(4).toInt()==0) { // Turn ON
|
||||
@@ -176,7 +176,7 @@ void Bt16x2::processCommand(RDMacro *cmd)
|
||||
}
|
||||
if(cmd->arg(1).lower()=="o") {
|
||||
sprintf(str,"*%dOR%02dL",BT16X2_UNIT_ID,cmd->arg(2).toInt());
|
||||
bt_device->writeBlock(str,6);
|
||||
bt_device->write(str,6);
|
||||
emit gpoChanged(bt_matrix,cmd->arg(2).toInt()-1,true);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void Bt16x2::processCommand(RDMacro *cmd)
|
||||
}
|
||||
if(cmd->arg(1).lower()=="o") {
|
||||
sprintf(str,"*%dOR%02dP",BT16X2_UNIT_ID,cmd->arg(2).toInt());
|
||||
bt_device->writeBlock(str,6);
|
||||
bt_device->write(str,6);
|
||||
emit gpoChanged(bt_matrix,cmd->arg(2).toInt()-1,true);
|
||||
bt_gpo_oneshot->start(cmd->arg(2).toInt()-1,500);
|
||||
}
|
||||
@@ -213,12 +213,12 @@ void Bt16x2::processCommand(RDMacro *cmd)
|
||||
}
|
||||
if(cmd->arg(1).toInt()==0) {
|
||||
sprintf(str,"*%dM%d",BT16X2_UNIT_ID,cmd->arg(2).toInt());
|
||||
bt_device->writeBlock(str,4);
|
||||
bt_device->write(str,4);
|
||||
}
|
||||
else {
|
||||
sprintf(str,"*%d%02d%d",BT16X2_UNIT_ID,
|
||||
cmd->arg(1).toInt(),cmd->arg(2).toInt());
|
||||
bt_device->writeBlock(str,5);
|
||||
bt_device->write(str,5);
|
||||
}
|
||||
cmd->acknowledge(true);
|
||||
emit rmlEcho(cmd);
|
||||
@@ -238,7 +238,7 @@ void Bt16x2::processStatus()
|
||||
int n;
|
||||
int gpi;
|
||||
|
||||
while((n=bt_device->readBlock(buffer,255))>0) {
|
||||
while((n=bt_device->read(buffer,255))>0) {
|
||||
for(int i=0;i<n;i++) {
|
||||
switch(bt_istate) {
|
||||
case 0:
|
||||
@@ -352,7 +352,7 @@ void Bt16x2::processStatus()
|
||||
void Bt16x2::gpiOneshotData(int value)
|
||||
{
|
||||
bt_gpi_mask[value]=false;
|
||||
bt_device->writeBlock("*0SPA",5);
|
||||
bt_device->write("*0SPA",5);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user