diff --git a/src/ConexAgp.cpp b/src/ConexAgp.cpp index 4abf6801824be8552022d497e210a43154e25dd0..be39d1bfcc1480a2ae22ece85ea87274cbb83d02 100644 --- a/src/ConexAgp.cpp +++ b/src/ConexAgp.cpp @@ -217,8 +217,8 @@ void ConexAgp::init_device() { if(!legacySerial) { - Tango::DeviceAttribute dattrin1("Timeout",(Tango::DevLong)5); - device_proxy->write_attribute(dattrin1); + //Tango::DeviceAttribute dattrin1("Timeout",(Tango::DevLong)5); + //device_proxy->write_attribute(dattrin1); Tango::DevLong len = 500; Tango::DeviceData dintmp, douttmp; @@ -244,12 +244,27 @@ void ConexAgp::init_device() { try { - Tango::DeviceAttribute dattrin2("Timeout",(Tango::DevLong)1000); - device_proxy->write_attribute(dattrin2); +#if 0 + char cmd[64]; + memset(cmd,0,64); + sprintf(cmd, "%d%s",/*controllerAddr*/0/*broadcast to all*/,RESET_CONTROLLER_1); + Tango::DevVarCharArray dvca; + dvca.length(strlen(cmd)+2); + for (unsigned int i=0; i<strlen(cmd); ++i) + dvca[i] = cmd[i]; + dvca[strlen(cmd)] = '\r'; + dvca[strlen(cmd)+1] = '\n'; + + Tango::DeviceData din; + din << dvca; + device_proxy->command_inout("Write", din); +#endif + //Tango::DeviceAttribute dattrin2("Timeout",(Tango::DevLong)1000); + //device_proxy->write_attribute(dattrin2); } catch(Tango::DevFailed &e) { - DEBUG_STREAM << __func__<<": error setting timeout, err="<<e.errors[0].desc; + DEBUG_STREAM << __func__<<": error resetting controller address, err="<<e.errors[0].desc; set_state(Tango::FAULT); set_status(string(e.errors[0].desc)); } @@ -262,7 +277,7 @@ void ConexAgp::init_device() set_archive_event("State", true, true); mutex = new omni_mutex(); - + loop = new readthread(this); loop->start(); @@ -677,8 +692,8 @@ void ConexAgp::SendReceive(const string & command, string & response) { if(!legacySerial) { - Tango::DeviceAttribute dattrin("Timeout",(Tango::DevLong)5); - device_proxy->write_attribute(dattrin); + //Tango::DeviceAttribute dattrin("Timeout",(Tango::DevLong)5); + //device_proxy->write_attribute(dattrin); Tango::DevVarCharArray dvca; dvca.length(strlen(cmd)+2); @@ -706,8 +721,8 @@ void ConexAgp::SendReceive(const string & command, string & response) Tango::DeviceData din2, dout; if(!legacySerial) { - Tango::DeviceAttribute dattrin("Timeout",(Tango::DevLong)1); - device_proxy->write_attribute(dattrin); + //Tango::DeviceAttribute dattrin("Timeout",(Tango::DevLong)1); + //device_proxy->write_attribute(dattrin); Tango::DevVarCharArray *delim = new Tango::DevVarCharArray(); delim->length(1); //(*delim)[0] = '\n'; diff --git a/src/ConexAgp.h b/src/ConexAgp.h index bf40c7258001c0ba37f54cfedbdac1726e0430f8..38f452ceb24fdf3b70754c60552c08de82ad3ea5 100644 --- a/src/ConexAgp.h +++ b/src/ConexAgp.h @@ -54,6 +54,7 @@ #define STOP_MOTION "ST" #define HOMING "OR" #define RESET_CONTROLLER "RS" +#define RESET_CONTROLLER_1 "RS##" #define ENABLE "MM"