OpenHantek
finddevices.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QString>
6 #include <memory>
7 #include <map>
8 #include <list>
9 
10 #include "usbdevice.h"
11 
12 struct libusb_context;
13 
24  public:
25  typedef std::map<UniqueUSBid, std::unique_ptr<USBDevice>> DeviceList;
26  explicit FindDevices( libusb_context *context );
29  int updateDeviceList();
30  const DeviceList *getDevices();
36  std::unique_ptr<USBDevice> takeDevice(UniqueUSBid id);
37  private:
38  libusb_context *context;
40  unsigned findIteration = 0;
41 };
int updateDeviceList()
Definition: finddevices.cpp:26
unsigned findIteration
Definition: finddevices.h:40
Search for Hantek devices. Use usually want to call updateDeviceList and then retrieve the list via g...
Definition: finddevices.h:23
libusb_context * context
The usb context used for this device.
Definition: finddevices.h:38
std::unique_ptr< USBDevice > takeDevice(UniqueUSBid id)
takeDevice
Definition: finddevices.cpp:95
std::map< UniqueUSBid, std::unique_ptr< USBDevice > > DeviceList
Definition: finddevices.h:25
DeviceList devices
Definition: finddevices.h:39
uint64_t UniqueUSBid
Definition: usbdevice.h:16
FindDevices(libusb_context *context)
Definition: finddevices.cpp:22
const DeviceList * getDevices()
Definition: finddevices.cpp:89