Thor Johnson
Thor Johnson

Reputation: 31

Is there a way to force windows to re-read the USB DeviceDescriptor?

I need 8 bits of out of band data (configuration / noise reading) on my CDC USB device, and I figured I could return that in the LSB of the bcdDevice in the DeviceDescriptor... but it seems that Windows only reads that on "Plug In Event" -- even if you use DeviceIOCtl on the hub to "re-read" the DeviceDescriptor (it doesn't hit the breakpoint in my device and it sticks with a constant bcdDevice after it's been plugged in -- I understand the MSB needs to be >2, but it all seems to be cached).

A. Is there a way to "force" Windows to re-read the bcdDevice (preferably while the port is opened)? Or any other string or byte (they all seem to be cached)?

B. Is there a way to "force" Windows to read (and accept what's given verbatim) the BaudRate (I figured I could use the MSB of the BaudRate for the status, but Windows doesn't believe that that's a valid number so it just reports "9600, I guess" -- and doesn't read it unless I close and reopen the port -- and then it tries to set the baud rate without being told to)?

C. Is there any other way to get 1 byte in/out of my device without Windows playing silly games? I don't really want my device to show up as 2 com ports (one for config, one for data), but then I'd have to figure out which is which and it would be confusing for the user -- Any other register/USB message -- DSR, CTS, RI, CD - but I need 4 more bits in and at least 3 bits out -- and it needs to be "raw" -- no "If CD, then DSR has to be OK" -- (once configured, the "UseTermination/InvertData/DriveStrength" is stored in flash in the device, so it's just a serial port, but I need to read the "noiselevel" [8 bits req'd], and set those registers --only when requested!-- when commissioning the device)...

Upvotes: 0

Views: 233

Answers (1)

David Grayson
David Grayson

Reputation: 87506

As an answer part C of your question, I suggest that when the serial port's baud rate is set to some special value like 123, you go into configuration mode, and allow configuration data to be transferred on the bulk IN and OUT endpoints.

It would also be fine (and probably more normal) to make a composite device with one USB serial port and one native USB interface that you talk to with WinUSB.

Upvotes: 1

Related Questions