14 #define WAIT_FOR_MUTEX_TIME_OUT (5000) 20 bool check(
const char * call, HRESULT hr,
bool to_throw =
true);
21 #define CHECK_HR(x) check(#x, x); 22 #define LOG_HR(x) check(#x, x, false); 28 std::vector<std::string>
tokenize(std::string
string,
char separator);
30 bool parse_usb_path(uint16_t & vid, uint16_t & pid, uint16_t & mi, std::string & unique_id,
const std::string & path);
32 bool get_usb_descriptors(uint16_t device_vid, uint16_t device_pid,
const std::string& device_uid,
33 std::string& location,
usb_spec& spec);
40 virtual bool wait(DWORD timeout)
const;
42 static event_base*
wait(
const std::vector<event_base*>& events,
bool waitAll,
int timeout);
87 bool try_lock()
const;
88 void lock()
const { acquire(); }
94 void update_id(
const char*
id);
100 HANDLE _winusb_mutex;