OpenHantek
FindDevices Class Reference

Search for Hantek devices. Use usually want to call updateDeviceList and then retrieve the list via getDevices. You can call updateDeviceList as often as you want. If you have found your favorite device, you want to call takeDevice. The device will not be available in getDevices anymore and this will not change with calls to updateDeviceList. More...

#include <finddevices.h>

Public Types

typedef std::map< UniqueUSBid, std::unique_ptr< USBDevice > > DeviceList
 

Public Member Functions

 FindDevices (libusb_context *context)
 
int updateDeviceList ()
 
const DeviceListgetDevices ()
 
std::unique_ptr< USBDevicetakeDevice (UniqueUSBid id)
 takeDevice More...
 

Private Attributes

libusb_context * context
 The usb context used for this device. More...
 
DeviceList devices
 
unsigned findIteration = 0
 

Detailed Description

Search for Hantek devices. Use usually want to call updateDeviceList and then retrieve the list via getDevices. You can call updateDeviceList as often as you want. If you have found your favorite device, you want to call takeDevice. The device will not be available in getDevices anymore and this will not change with calls to updateDeviceList.

Do not close the given usb context before this class object is destroyed.

Member Typedef Documentation

◆ DeviceList

typedef std::map<UniqueUSBid, std::unique_ptr<USBDevice> > FindDevices::DeviceList

Constructor & Destructor Documentation

◆ FindDevices()

FindDevices::FindDevices ( libusb_context *  context)
explicit

Member Function Documentation

◆ getDevices()

const FindDevices::DeviceList * FindDevices::getDevices ( )

◆ takeDevice()

std::unique_ptr< USBDevice > FindDevices::takeDevice ( UniqueUSBid  id)

takeDevice

Parameters
idThe unique usb id for the current bus layout
Returns
A shared reference to the

◆ updateDeviceList()

int FindDevices::updateDeviceList ( )

Updates the device list. To clear the list, just dispose this object

Returns
If negative it represents a libusb error code otherwise the amount of updates

Field Documentation

◆ context

libusb_context* FindDevices::context
private

The usb context used for this device.

◆ devices

DeviceList FindDevices::devices
private

◆ findIteration

unsigned FindDevices::findIteration = 0
private

The documentation for this class was generated from the following files: