20#include <radio_tool/radio/radio.hpp>
28#include <libusb-1.0/libusb.h>
35 const std::wstring manufacturer, product;
36 const uint16_t vid, pid, index;
39 const CreateRadioOps l,
40 const std::wstring& mfg,
41 const std::wstring& prd,
45 : manufacturer(mfg), product(prd), vid(vid), pid(pid), index(idx), loader(l) {}
47 auto ToString()
const ->
const std::wstring
override
49 std::wstringstream os;
51 << std::setfill(L
'0') << std::setw(4) << std::hex << vid
53 << std::setfill(L
'0') << std::setw(4) << std::hex << pid
54 << L
"]: idx=" << std::setfill(L
'0') << std::setw(3) << std::to_wstring(index) << L
", "
55 << manufacturer << L
" " << product;
65 const CreateRadioOps loader;
77 auto ListDevices(
const uint16_t& idx_offset)
const ->
const std::vector<RadioInfo*>
override;
78 auto HandleEvents() -> void;
80 auto GetDeviceString(
const uint8_t&, libusb_device_handle*)
const->std::wstring;
81 static auto OpenDevice(
const uint8_t& bus,
const uint8_t& port)->libusb_device_handle*;
82 static auto CreateContext()->libusb_context*;
84 libusb_context* usb_ctx;