Skip to content
Snippets Groups Projects

High blue rec

Closed Pierre Mahe requested to merge pierre.mahe/highblueparsers:HighBlueRec into main
2 files
+ 6
2
Compare changes
  • Side-by-side
  • Inline

Files

+ 5
0
@@ -44,6 +44,7 @@ JasonRecorder::JasonRecorder() {
JasonRecorder::~JasonRecorder() {
// free handle
if (handle) {
libusb_release_interface(handle, 0);
libusb_close(handle);
}
// free devices
@@ -60,6 +61,7 @@ size_t JasonRecorder::get_device_count() {
void JasonRecorder::set_device(size_t number) {
if (handle) {
libusb_release_interface(handle, 0);
libusb_close(handle);
handle = NULL;
}
@@ -69,6 +71,9 @@ void JasonRecorder::set_device(size_t number) {
if (libusb_open(devices[number], &handle) < 0) {
throw std::runtime_error("could not open USB device (try again as root)");
}
if (libusb_claim_interface(handle, 0) < 0) {
throw std::runtime_error("could not claim USB interface");
}
}
void JasonRecorder::send_message(std::uint8_t cmd) {
Loading