Skip to content

Commit

Permalink
Merge pull request IntelRealSense#4310 from matkatz/win7-fw-update
Browse files Browse the repository at this point in the history
Fix Windows 7 firmware update
  • Loading branch information
ev-mp authored Jun 27, 2019
2 parents 3eecfe1 + d9ee412 commit 7ce0710
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
23 changes: 2 additions & 21 deletions src/win7/win7-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "win7-usb.h"
#include "win7-hid.h"
#include "../types.h"
#include "usb/usb-enumerator.h"
#include <mfapi.h>
#include <ks.h>
#include <chrono>
Expand Down Expand Up @@ -72,27 +73,7 @@ namespace librealsense

std::vector<usb_device_info> win7_backend::query_usb_devices() const
{
const std::vector<std::string> usb_interfaces = {
"{175695CD-30D9-4F87-8BE3-5A8270F49A31}",
"{08090549-CE78-41DC-A0FB-1BD66694BB0C}"
};

std::vector<usb_device_info> result;
for (auto&& interface_id : usb_interfaces)
{
for (auto&& id : usb_enumerate::query_by_interface(interface_id, "", ""))
{
std::string path(id.begin(), id.end());
uint16_t vid, pid, mi; std::string unique_id, device_guid;
if (!parse_usb_path_multiple_interface(vid, pid, mi, unique_id, path, device_guid)) continue;

usb_device_info info{ path, vid, pid, mi, unique_id, "", usb_undefined };

result.push_back(info);
}
}

return result;
return usb_enumerator::query_devices_info();
}

std::shared_ptr<hid_device> win7_backend::create_hid_device(hid_device_info info) const
Expand Down
6 changes: 3 additions & 3 deletions src/winusb/enumerator-winusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace librealsense

if (std::regex_search(device_str, matches, regex_camera_interface) && matches.size() == 11)
{
rv.id = matches[0];
rv.id = device_str;
std::stringstream vid; vid << std::hex << matches[2]; vid >> rv.vid;
std::stringstream pid; pid << std::hex << matches[4]; pid >> rv.pid;
std::stringstream mi; mi << std::hex << matches[6]; mi >> rv.mi;
Expand All @@ -97,15 +97,15 @@ namespace librealsense
}
if (std::regex_search(device_str, matches, regex_usb_interface) && matches.size() == 9)
{
rv.id = matches[0];
rv.id = device_str;
std::stringstream vid; vid << std::hex << matches[2]; vid >> rv.vid;
std::stringstream pid; pid << std::hex << matches[4]; pid >> rv.pid;
std::stringstream uid; uid << std::hex << matches[6]; uid >> rv.unique_id;
return rv;
}
if (std::regex_search(device_str, matches, regex_dfu_interface))
{
rv.id = matches[0];
rv.id = device_str;
std::stringstream vid; vid << std::hex << matches[2]; vid >> rv.vid;
std::stringstream pid; pid << std::hex << matches[4]; pid >> rv.pid;
std::stringstream uid; uid << std::hex << matches[6]; uid >> rv.unique_id;
Expand Down

0 comments on commit 7ce0710

Please sign in to comment.