Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aroffringa committed Aug 3, 2023
1 parent cae45f7 commit 1c73a76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 11 additions & 8 deletions plugins/usbdmx/EuroliteProFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

#include "plugins/usbdmx/EuroliteProFactory.h"

#include <algorithm>

#include "libs/usb/LibUsbAdaptor.h"
#include "ola/Logging.h"
#include "ola/base/Flags.h"

#include <algorithm>

DECLARE_bool(use_async_libusb);

namespace ola {
Expand Down Expand Up @@ -56,7 +56,8 @@ EuroliteProFactory::EuroliteProFactory(ola::usb::LibUsbAdaptor *adaptor,
: BaseWidgetFactory<class EurolitePro>("EuroliteProFactory"),
m_adaptor(adaptor),
m_enable_eurolite_mk2(IsEuroliteMk2Enabled(preferences)) {
StringSplit(preferences->GetValue(EUROLITE_SERIALS_KEY), m_expected_eurolite_serials, ",");
StringSplit(preferences->GetValue(EUROLITE_SERIALS_KEY),
m_expected_eurolite_serials, ",");
}

bool EuroliteProFactory::IsEuroliteMk2Enabled(Preferences *preferences) {
Expand Down Expand Up @@ -93,16 +94,18 @@ bool EuroliteProFactory::DeviceAdded(
// Eurolite USB-DMX512-PRO MK2?
} else if (descriptor.idVendor == VENDOR_ID_MK2 &&
descriptor.idProduct == PRODUCT_ID_MK2) {

LibUsbAdaptor::DeviceInformation info;
if (!m_adaptor->GetDeviceInfo(usb_device, descriptor, &info)) {
return false;
}

const bool serial_matches = std::find(m_expected_eurolite_serials.begin(), m_expected_eurolite_serials.end(), info.serial) != m_expected_eurolite_serials.end();


const bool serial_matches = std::find(m_expected_eurolite_serials.begin(),
m_expected_eurolite_serials.end(), info.serial) !=
m_expected_eurolite_serials.end();

if (m_enable_eurolite_mk2 || serial_matches) {
OLA_INFO << "Found a possible new Eurolite USB-DMX512-PRO MK2 device with serial " << info.serial;
OLA_INFO << "Found a possible new Eurolite USB-DMX512-PRO MK2 device "
"with serial " << info.serial;

if (!m_adaptor->CheckManufacturer(EXPECTED_MANUFACTURER_MK2, info)) {
return false;
Expand Down
3 changes: 3 additions & 0 deletions plugins/usbdmx/EuroliteProFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#ifndef PLUGINS_USBDMX_EUROLITEPROFACTORY_H_
#define PLUGINS_USBDMX_EUROLITEPROFACTORY_H_

#include <string>
#include <vector>

#include "libs/usb/LibUsbAdaptor.h"
#include "ola/base/Macro.h"
#include "olad/Preferences.h"
Expand Down

0 comments on commit 1c73a76

Please sign in to comment.