mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
libicsneoc: Resolve DeviceCurrentlyClosed errors
This commit is contained in:
@@ -21,7 +21,8 @@ int Communication::messageCallbackIDCounter = 1;
|
|||||||
Communication::~Communication() {
|
Communication::~Communication() {
|
||||||
if(redirectingRead)
|
if(redirectingRead)
|
||||||
clearRedirectRead();
|
clearRedirectRead();
|
||||||
close();
|
if(isOpen())
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Communication::open() {
|
bool Communication::open() {
|
||||||
|
|||||||
+2
-1
@@ -78,7 +78,8 @@ bool Device::SerialStringIsNumeric(const std::string& serial) {
|
|||||||
Device::~Device() {
|
Device::~Device() {
|
||||||
if(isMessagePollingEnabled())
|
if(isMessagePollingEnabled())
|
||||||
disableMessagePolling();
|
disableMessagePolling();
|
||||||
close();
|
if(isOpen())
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Device::getTimestampResolution() const {
|
uint16_t Device::getTimestampResolution() const {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
typedef void(*fn_boolCallback)(bool success);
|
typedef void(*fn_boolCallback)(bool success);
|
||||||
|
|
||||||
VCP(const device_eventhandler_t& err, neodevice_t& forDevice);
|
VCP(const device_eventhandler_t& err, neodevice_t& forDevice);
|
||||||
~VCP() { close(); }
|
virtual ~VCP();
|
||||||
bool open() { return open(false); }
|
bool open() { return open(false); }
|
||||||
void openAsync(fn_boolCallback callback);
|
void openAsync(fn_boolCallback callback);
|
||||||
bool close();
|
bool close();
|
||||||
|
|||||||
@@ -196,6 +196,11 @@ VCP::VCP(const device_eventhandler_t& err, neodevice_t& forDevice) : Driver(err)
|
|||||||
detail = std::make_shared<Detail>();
|
detail = std::make_shared<Detail>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VCP::~VCP() {
|
||||||
|
if(isOpen())
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
bool VCP::IsHandleValid(neodevice_handle_t handle) {
|
bool VCP::IsHandleValid(neodevice_handle_t handle) {
|
||||||
if(handle < 1)
|
if(handle < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user