Skip to content
Snippets Groups Projects
Commit b00ce4fe authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Consolidate checks for timeout

parent 58dbad39
No related branches found
No related tags found
No related merge requests found
......@@ -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("",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment