Skip to content

Commit

Permalink
fixup! refactor: modernize bulksupport allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Sep 5, 2024
1 parent 14f0ea8 commit 7b712fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/controllers/bulk/bulkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ int BulkController::open() {

/* Look up endpoint addresses in supported database */

const bulk_supported_t* device = std::find_if(
std::begin(bulk_supported), std::end(bulk_supported), [this](const auto& dev) {
const bulk_supported_t* pDevice = std::find_if(
std::cbegin(bulk_supported), std::cend(bulk_supported), [this](const auto& dev) {
return dev.vendor_id == m_vendorId && dev.product_id == m_productId;
});
if (!device) {
if (pDevice == std::cend(bulk_supported)) {
qCWarning(m_logBase) << "USB Bulk device" << getName() << "unsupported";
return -1;
}
m_inEndpointAddr = device->in_epaddr;
m_outEndpointAddr = device->out_epaddr;
m_inEndpointAddr = pDevice->in_epaddr;
m_outEndpointAddr = pDevice->out_epaddr;
#if defined(__WINDOWS__) || defined(__APPLE__)
m_interfaceNumber = device->interface_number;
m_interfaceNumber = pDevice->interface_number;
#endif

// XXX: we should enumerate devices and match vendor, product, and serial
Expand Down

0 comments on commit 7b712fa

Please sign in to comment.