diff --git a/src/USB2.cpp b/src/USB2.cpp index 791e01beaa0bf361d63e258332dba9cfa841363b..e469894e27c720dd005a1516df456d4356c95538 100644 --- a/src/USB2.cpp +++ b/src/USB2.cpp @@ -384,6 +384,12 @@ void USB2::always_executed_hook() return; } + if (! timeout) { + set_state(Tango::FAULT); + set_status("Invalid timeout"); + return; + } + try { if (! dev_handle) { open(); @@ -504,12 +510,6 @@ void USB2::write(const Tango::DevVarCharArray *argin) check_init(); - if(!timeout) { - Tango::Except::throw_exception( "", - "Invalid timeout", - "USB2::write()"); - } - unsigned char *argin_data = new unsigned char[argin->length()]; for(unsigned int i=0; i<argin->length(); ++i) { @@ -561,12 +561,6 @@ Tango::DevVarCharArray *USB2::read(Tango::DevLong argin) check_init(); - if(!timeout) { - Tango::Except::throw_exception( "", - "Invalid timeout", - "USB2::write()"); - } - if (argin < 0) { Tango::Except::throw_exception("", @@ -619,12 +613,6 @@ Tango::DevVarCharArray *USB2::read_until(const Tango::DevVarCharArray *argin) check_init(); - if(!timeout) { - Tango::Except::throw_exception( "", - "Invalid timeout", - "USB2::write()"); - } - if (argin->length() != 1) { Tango::Except::throw_exception("",