Go to the documentation of this file.
40 #include <boost/function.hpp>
41 #include <boost/thread.hpp>
43 struct libusb_device_handle;
44 struct libusb_context;
61 UsbDevice(uint16_t vid, uint16_t pid, uint8_t mi);
75 Location(uint8_t _bus, uint8_t _port = 0, uint8_t _addr = 0, uint16_t _vid = 0, uint16_t _pid = 0) :
loc(0) {
89 return match(*
this, other);
121 static void listDevices(
const std::vector<UsbIds> &ids, std::vector<Location> &list);
122 static void listDevices(uint16_t vid, uint16_t pid, std::vector<Location> &list);
123 void listDevices(std::vector<Location> &list)
const;
125 void setDevceIds(uint16_t vid, uint16_t pid, uint8_t mi);
132 bool bulkWrite(
const void * data,
int size,
unsigned char endpoint,
int timeout);
133 int bulkRead(
void * data,
int size,
unsigned char endpoint,
int timeout);
134 bool interruptWrite(
const void * data,
int size,
unsigned char endpoint,
int timeout);
135 int interruptRead(
void * data,
int size,
unsigned char endpoint,
int timeout);
137 typedef boost::function<void(
const void *data,
int size)>
Callback;
bool bulkWrite(const void *data, int size, unsigned char endpoint, int timeout)
bool interruptWrite(const void *data, int size, unsigned char endpoint, int timeout)
void setDebugLevel(uint8_t level)
void bulkReadThread(Callback callback, unsigned char endpoint)
bool handleError(int err)
Location(uint8_t _bus, uint8_t _port=0, uint8_t _addr=0, uint16_t _vid=0, uint16_t _pid=0)
bool match(const Location &other) const
bool open(const Location &location=Location())
void stopBulkReadThread(unsigned char endpoint)
boost::thread bulk_threads_[128]
void startInterruptReadThread(Callback callback, unsigned char endpoint)
void interruptReadThread(Callback callback, unsigned char endpoint)
int getLastError(std::string &str) const
static bool match(const Location &a, const Location &b)
boost::thread interrupt_threads_[128]
void setDevceIds(uint16_t vid, uint16_t pid, uint8_t mi)
bool operator>=(const Location &other) const
bool operator==(const Location &other) const
UsbIds(uint16_t _vid, uint16_t _pid)
bool operator>(const Location &other) const
bool interrupt_threads_enable_[128]
libusb_device_handle * libusb_handle_
void startBulkReadThread(Callback callback, unsigned char endpoint)
void stopInterruptReadThread(unsigned char endpoint)
static void listDevices(const std::vector< UsbIds > &ids, std::vector< Location > &list)
boost::function< void(const void *data, int size)> Callback
bool bulk_threads_enable_[128]
int bulkRead(void *data, int size, unsigned char endpoint, int timeout)
bool operator<(const Location &other) const
Location getLocation() const
bool operator<=(const Location &other) const
UsbDeviceException(int code, const char *msg)
bool operator!=(const Location &other) const
int interruptRead(void *data, int size, unsigned char endpoint, int timeout)
lusb
Author(s): Kevin Hallenbeck
autogenerated on Wed Mar 2 2022 00:29:32