Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c++ wrapper for libusb, add try/catch to prevent app crashes #63

Closed
Closed
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d45082a
clean refLibusbDeviceByName(), usb_host.cpp mutex, mxid_cache
diablodale May 17, 2023
0811a8a
initial c++ wrapper for libusb; for libusb_get_device_list()
diablodale May 17, 2023
761fb22
add dai namespace to libusb wrappers
diablodale May 18, 2023
114eae6
add dai::libusb::usb_error exception class
diablodale May 18, 2023
987f212
add dai::libusb::config_descriptor wrapper class
diablodale May 18, 2023
c2dd35a
add dai::libusb::usb_device, dai::libusb::device_handle
diablodale May 18, 2023
31e856b
remove dai::device_list::create() factory
diablodale May 18, 2023
b64fe62
add dai::libusb::device_handle::claim_interface()
diablodale May 18, 2023
9374b5b
updates to enable C++11
diablodale May 18, 2023
265be7f
add dai::out_param to simplify use of wrappers with C-functions
diablodale May 19, 2023
6086999
fix test multiple_open_stream - uninitialized structs
diablodale May 20, 2023
526113a
refactor for dai::out_param, more RAII, some params now wrappers
diablodale May 19, 2023
1adf607
simplify libusb wrapper
diablodale May 20, 2023
3926426
change libusb wrap macros -> template function
diablodale May 20, 2023
9deed2a
add libusb::device_handle:: get/set_configuration
diablodale May 20, 2023
56dcf33
add libusb::device_handle::set_auto_detach_kernel_driver
diablodale May 20, 2023
c835049
add libusb::usb_context and automatic libusb_exit() on app close
diablodale May 20, 2023
5a7a050
add libusb::usb_device::get_config_descriptor()
diablodale May 20, 2023
6271d47
fix call_log_throw() exception specifier with tag dispatch
diablodale May 20, 2023
de46723
add usb_device:: {}, open, reset, get_device_descriptor
diablodale May 20, 2023
dae7906
refactor getUSBDevices(); more usb_device, exceptions, RAII
diablodale May 20, 2023
b0e3834
add usb_device::get_bus_number, get_port_numbers
diablodale May 20, 2023
d3c0cfe
fix thread-unsafe libusb_get_device_list(); add get_string_descriptor…
diablodale May 21, 2023
70fc4d9
send bcdUSB to usb_boot(); add set_max_packet_size()
diablodale May 22, 2023
987049a
add noexcept specs to libusb wrappers
diablodale May 22, 2023
d224375
update usb_open_device() to not update handle on errors
diablodale May 22, 2023
25eb61a
add bulk_transfer() and cleanup; not yet complete
diablodale May 24, 2023
533c22b
bulk_transfer work: containers, bugfixes, cleanup
diablodale May 24, 2023
b5fc5ad
fix bulk_transfer() and refactor usb_host.cpp to use it
diablodale May 25, 2023
39a5a44
refactor usb_boot(), usbLinkOpen() to use libusb wrappers
diablodale May 25, 2023
a60a6c4
add control_transfer() and use in usbLinkBootBootloader()
diablodale May 25, 2023
a546d38
change vidpid->state container to std::array
diablodale May 25, 2023
4cdadec
shorter lock for usb_mx_id_cache; minor tidy changes
diablodale May 26, 2023
48757aa
refactor usb open-ish functions for exception handling
diablodale May 26, 2023
47c4874
enable c++14 standard in cmake; remove backports for c++11
diablodale May 26, 2023
4cdd87f
add exception handling to usbInitialize()
diablodale May 26, 2023
766c483
add libusb wrapper license and change namespace to dp
diablodale May 26, 2023
efe8315
add getUSBDevices() exception handling
diablodale May 26, 2023
48a09af
add wrapper project name to (c)
diablodale May 26, 2023
78bf941
wrapper clarified noexcept and bulk_transfer return type
diablodale May 27, 2023
d5280e3
add exception handling for usbPlatform* functions
diablodale May 27, 2023
1ebdd66
return several log levels to production setting
diablodale May 27, 2023
ccfd20d
refactor ***PlatformDeviceFdFromKey(), exceptions, and race condition
diablodale May 27, 2023
ab44cf7
add ".0" to path for HCD's with no ports
diablodale May 27, 2023
7c60f00
libusb wrapper use constexpr array; persist usbBCD
diablodale May 28, 2023
d811294
refactor libusb wrapper device_handle move(s)
diablodale May 28, 2023
4e09f32
add logging to ***PlatformDeviceFdFromKey()
diablodale May 28, 2023
1e00dba
fix device_handle constructors, reset(), bcdUSB
diablodale May 28, 2023
bb4ae36
simplify device_handle::get_string_descriptor_ascii()
diablodale May 28, 2023
45bcb15
add debug log, comments, clearer var names
diablodale May 28, 2023
2e947aa
calc+persist chunkSize instead of bcdUSB
diablodale May 29, 2023
4054fc6
add getPlatformDeviceFdFromKeySimple(void*)
diablodale May 29, 2023
659678c
add RAII in usbPlatformConnect,Close,Read,Write
diablodale May 29, 2023
9cabf73
remove double-spaces in mvLog() calls
diablodale May 29, 2023
e99a13f
libusb wrapper workaround for Clang constexpr fails
diablodale May 29, 2023
147d61a
fix add_flag() to correctly add flags to C++ files
diablodale May 30, 2023
860699f
fix errant macro define of system reserved __attribute__
diablodale May 30, 2023
ab63c51
move some libusb wrapper headers to cpp file
diablodale May 30, 2023
ee3e53e
fix libusb bug in libusb_free_device_list(ptr, 1)
diablodale May 31, 2023
81d473c
libusb wrapper resources support nullptr as contents
diablodale May 31, 2023
eb7d4da
add doc for libusb wrappers
diablodale May 31, 2023
ae17b7a
more libusb wrapper container functions
diablodale Jun 1, 2023
6ad36b6
refactor libusb::span to be more std::span
diablodale Jun 1, 2023
d1e177b
libusb::device_list::iterator::operator*() -> usb_device
diablodale Jun 2, 2023
3313b16
use simplified libusb::device_list w/ its direct usb_device deref
diablodale Jun 2, 2023
fd73cfa
update ZLP test for libusb wrapper bulk_transfer
diablodale Jun 2, 2023
de53772
libusb wrapper doxygen and minor return value cleanup
diablodale Jun 4, 2023
b328c1a
debug assert usb device list contains only non-null devices
diablodale Jun 4, 2023
2ae8877
libusb wrapper constructor and doc cleanup
diablodale Jun 8, 2023
0aaf58a
mac clang workaround for inheriting base constructors
diablodale Jun 8, 2023
be19c74
add mermaid diagram to libusb wrapper docs
diablodale Jul 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
libusb::device_list::iterator::operator*() -> usb_device
- reduces risk that callers will use a raw libusb_device*
  without managing its ownership and lifetime
- simplifies 2-step (get iter, create usb_device)
  to 1-step (get usb_device)
diablodale committed Jun 8, 2023
commit d1e177bfc1fd7173d05f1feccda943f24d28cc38
Loading