aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan.zalega@gmail.com>2016-02-20 15:23:05 +0100
committerSzczepan Zalega <szczepan.zalega@gmail.com>2016-02-20 15:23:05 +0100
commita0db16048f81313604a06509cc6afeb5cdbf740d (patch)
treeeff23c3e2963928c0e95dd65b7aedfcda0c8748f /device.cc
parent6a8151c3a25b09a12118343342fdd87b3d429a83 (diff)
downloadlibnitrokey-a0db16048f81313604a06509cc6afeb5cdbf740d.tar.gz
libnitrokey-a0db16048f81313604a06509cc6afeb5cdbf740d.tar.bz2
compiling own version of lib hid_libusb (copied from nitroapp) and linking it statically with debug messages
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;
}