aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-03-09 18:49:24 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 15:41:45 +0100
commitadbc664125142c434294bfa795666c90c7608429 (patch)
tree15db66af5acd4422b5e66678dbe45a953b9dbdb0 /device.cc
parentc69604e8ba099b1421af86c34d904b0b380f996c (diff)
downloadlibnitrokey-adbc664125142c434294bfa795666c90c7608429.tar.gz
libnitrokey-adbc664125142c434294bfa795666c90c7608429.tar.bz2
Adjust for compilation on Visual Studio 2017
Building works however tests are not. Possibly linking with original hidapi solution would work.
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/device.cc b/device.cc
index d904fd9..0111572 100644
--- a/device.cc
+++ b/device.cc
@@ -2,7 +2,7 @@
#include <thread>
#include <cstddef>
#include <stdexcept>
-#include <hidapi/hidapi.h>
+#include "hidapi/hidapi.h"
#include "include/misc.h"
#include "include/device.h"
#include "include/log.h"
@@ -31,7 +31,7 @@ Device::Device(const uint16_t vid, const uint16_t pid, const DeviceModel model,
bool Device::disconnect() {
//called in object's destructor
- Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+ Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2);
std::lock_guard<std::mutex> lock(mex_dev_com);
Log::instance()(std::string(__FUNCTION__) + std::string(m_model==DeviceModel::PRO?"PRO":"STORAGE"), Loglevel::DEBUG_L2);
Log::instance()(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2);
@@ -45,7 +45,7 @@ bool Device::disconnect() {
return true;
}
bool Device::connect() {
- Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+ Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2);
std::lock_guard<std::mutex> lock(mex_dev_com);
Log::instance()(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2);
@@ -57,7 +57,7 @@ bool Device::connect() {
}
int Device::send(const void *packet) {
- Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+ Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2);
std::lock_guard<std::mutex> lock(mex_dev_com);
Log::instance()(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2);
@@ -71,7 +71,7 @@ int Device::send(const void *packet) {
}
int Device::recv(void *packet) {
- Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+ Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2);
std::lock_guard<std::mutex> lock(mex_dev_com);
Log::instance()(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2);
int status;
@@ -115,7 +115,7 @@ int Device::recv(void *packet) {
}
bool Device::is_connected() {
- Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2);
+ Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2);
std::lock_guard<std::mutex> lock(mex_dev_com);
if (mp_devhandle==nullptr){
return false;