[usbproxy] Re: Modify Descriptors

  • From: Dominic Spill <dominicgs@xxxxxxxxx>
  • To: usbproxy@xxxxxxxxxxxxx
  • Date: Wed, 28 Oct 2015 13:47:05 +0000

On 28 October 2015 at 10:24, Rikkert ten Klooster
<hjtenklooster@xxxxxxxxx> wrote:


I’ve tried hardcoding changes in idVendor / idProduct. I've also tried
changes in so in other files such as DeviceProxy_LibUSB.cpp, without any
result.
Unless lsusb in linux is broke, it doesn’t give me the altered descriptor
information, but gives me the original idProduct / idVendor values.
Do you have any idea what I’m doing wrong? I’ve also added a line in the
constructor containing:
std::cerr << “My custom error\n”;
This error wasn’t printed to the terminal, So i’m wondering if the part
gets executed at all?

There are a number of constructors in these files, we don't use them
all. I think we need to remove any that aren't being called. This
should be fairly easy to identify (grep will do).

In the future we should definitely filter those packets, which
probably means having one of the proxies build the model rather than
the manager and passing the packets through the filters. There are a
few questions here, which proxy should build the model? Do we want the
model to represent the real device? Or the modified one?

I’m not sure about this, perhaps you would need a new model, containing
all the descriptor information, and create 2 objects, one for the original,
and one for the altered device?

Given that the DeviceProxy has access to the device (and most of the
time is using libusb), we can probably assume that it has a copy
anyway.

I think the HostProxy should hold a model of the device that it's
presenting to the host.

Other related posts: