Skip to content

Commit

Permalink
PR #12785 from Nir-Az: relax enumeration logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Mar 22, 2024
2 parents cd1eb72 + dea67c9 commit 55239bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/win/win-helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ namespace librealsense
if(tokens.size() < 1 || (tokens[0] != R"(\\?\usb)" && tokens[0] != R"(\\?\hid)")) return false; // Not a USB device
if(tokens.size() < 3)
{
LOG_ERROR("malformed usb device path: " << name);
LOG_WARNING( "malformed usb device path: " << name );
return false;
}

auto ids = tokenize(tokens[1], '&');
if(ids[0].size() != 8 || ids[0].substr(0,4) != "vid_" || !(std::istringstream(ids[0].substr(4,4)) >> std::hex >> vid))
{
LOG_ERROR("malformed vid string: " << tokens[1]);
LOG_DEBUG("malformed vid string: " << tokens[1]);
return false;
}

if(ids[1].size() != 8 || ids[1].substr(0,4) != "pid_" || !(std::istringstream(ids[1].substr(4,4)) >> std::hex >> pid))
{
LOG_ERROR("malformed pid string: " << tokens[1]);
LOG_DEBUG( "malformed pid string: " << tokens[1] );
return false;
}

if(ids.size() > 2 && (ids[2].size() != 5 || ids[2].substr(0,3) != "mi_" || !(std::istringstream(ids[2].substr(3,2)) >> mi)))
{
LOG_ERROR("malformed mi string: " << tokens[1]);
LOG_DEBUG( "malformed mi string: " << tokens[1] );
return false;
}

ids = tokenize(tokens[2], '&');
if(ids.size() == 0)
{
LOG_ERROR("malformed id string: " << tokens[2]);
LOG_DEBUG( "malformed id string: " << tokens[2] );
return false;
}

Expand Down

0 comments on commit 55239bd

Please sign in to comment.