Commit 9e996cf0 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

The read and write functions return 0 bytes read/written in case the device is...

The read and write functions return 0 bytes read/written in case the device is not configured instead of throwing an exception.
parent ef37873f
Pipeline #6990 passed with stages
in 36 seconds
......@@ -128,7 +128,8 @@ int CComm::read(unsigned char *data,int len)
}
else
{
throw CCommException(_HERE_,"The communication device is not configured yet.\n",this->comm_id);
return 0;
// throw CCommException(_HERE_,"The communication device is not configured yet.\n",this->comm_id);
}
}
return len;
......@@ -165,7 +166,8 @@ int CComm::write(unsigned char *data,int len)
else
{
this->access_comm.exit();
throw CCommException(_HERE_,"The communication device is not configured yet.\n",this->comm_id);
return 0;
// throw CCommException(_HERE_,"The communication device is not configured yet.\n",this->comm_id);
}
this->access_comm.exit();
return len;
......
Supports Markdown
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