aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/device.cc b/device.cc
index e1a5615..e4ec8bd 100644
--- a/device.cc
+++ b/device.cc
@@ -16,11 +16,19 @@ Device::Device()
m_retry_timeout(50),
mp_devhandle(NULL) {}
+bool Device::disconnect() {
+ Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+
+ hid_exit();
+ mp_devhandle = NULL;
+ return true;
+}
bool Device::connect() {
Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
hid_init();
mp_devhandle = hid_open(m_vid, m_pid, NULL);
+ hid_init();
return mp_devhandle != NULL;
}