Our device declares itself as a CDC device and has a CDC interfaces to make it look like a modem. We use for this for development. This works with the built in drivers on Linux and Mac OS. On Windows we use a .inf file that someone created a long time ago for a different product, but it seems to work if you know how to point Windows to the .inf file, and a COM port is created. Windows is pretty much a mystery to me, I'm just happy it works.
Recently I added another interface to the device. This is a vendor specific interface with a bulk in pipe used for logging. By my reading of the CDC spec, this is legal. Mac OS and Linux have no problem with this extra interface, the CDC still works and I can read from the vendor specific bulk interface. On Windows, after updating the driver and pointing Windows towards the same .inf file, a COM port appears again. However, the CDC driver is now trying to read from the bulk pipe in the vendor specific interface, not from the bulk pipe in the CDC data interface. This disables our interface, (but we do get the logging over the other interface, which I wasn't expecting.)
Is there anyway I can persuade the Windows CDC driver to read from its own interface?
I tried putting the vendor specific interface first in the configuration, which I don't think is a legal configuration. I was hoping the CDC driver would just take the last bulk pipe, but the Mac OS CDC driver stopped working.
I'm testing this on Windows 7 Home Premium SP1. Our factory may be using a different version of Windows.
The .inf file looks like this:
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ProviderName%
DriverVer=04/26/2012,1.1.0.0
[MANUFACTURER]
%ProviderName%=DeviceList, NTx86, NTamd64
[DeviceList.NTx86]
%OurCDC%=DriverInstall,USB\VID_1234&PID_0001&MI_01&Class_02&SubClass_02
%AnotherCDC%=DriverInstall,USB\VID_1234&PID_0002&MI_01&Class_02&SubClass_02
[DeviceList.NTamd64]
%OurCDC%=DriverInstall,USB\VID_1234&PID_0001&MI_01&Class_02&SubClass_02
%AnotherCDC%=DriverInstall,USB\VID_1234&PID_0002&MI_01&Class_02&SubClass_02
[DriverInstall]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=LowerFilterAddReg,SerialPropPageAddReg
[DriverInstall.Services]
include = mdmcpq.inf
AddService = usbser, 0x00000002, LowerFilter_Service_Inst
; This adds the serial port property tab to the device properties dialog
[SerialPropPageAddReg]
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[Strings]
ProviderName = "OurName"
OurCDC = "Our Product"
AnotherCDC = "Our Product"
And descriptor dump of the device.
Full Speed device @ 11 (0x1D115000): ............................................. Communication device: "Our Device"
Port Information: 0x0018
Not Captive
External Device
Connected
Enabled
Number Of Endpoints (includes EP0):
Total Endpoints for Configuration 1 (current): 5
Device Descriptor
Descriptor Version Number: 0x0110
Device Class: 2 (Communication)
Device Subclass: 0
Device Protocol: 0
Device MaxPacketSize: 64
Device VendorID/ProductID: 0x1234/0x0006 (unknown vendor)
Device Version Number: 0x0000
Number of Configurations: 1
Manufacturer String: 1 "Company"
Product String: 2 "Our Device"
Serial Number String: 3 "0123456789ABCDEF"
Configuration Descriptor (current config)
Length (and contents): 83
Raw Descriptor (hex) 0000: 09 02 53 00 03 01 00 C0 32 09 04 00 00 01 02 02
Raw Descriptor (hex) 0010: 01 01 05 24 00 10 01 05 24 01 00 01 04 24 02 00
Raw Descriptor (hex) 0020: 05 24 06 00 01 07 05 83 03 20 00 02 09 04 01 00
Raw Descriptor (hex) 0030: 02 0A 00 00 01 07 05 84 02 20 00 00 07 05 05 02
Raw Descriptor (hex) 0040: 20 00 00 09 04 02 00 01 FF 01 00 00 07 05 87 02
Raw Descriptor (hex) 0050: 40 00 00
Number of Interfaces: 3
Configuration Value: 1
Attributes: 0xC0 (self-powered)
MaxPower: 100 mA
Interface #0 - Communications-Control .............................................. "Company"
Alternate Setting 0
Number of Endpoints 1
Interface Class: 2 (Communications-Control)
Interface Subclass; 2
Interface Protocol: 1
Comm Class Header Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 00 10 01
Comm Class Call Management Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 01 00 01
Comm Class Abstract Control Management Functional Descriptor
Raw Descriptor (hex) 0000: 04 24 02 00
Comm Class Union Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 06 00 01
Endpoint 0x83 - Interrupt Input
Address: 0x83 (IN)
Attributes: 0x03 (Interrupt)
Max Packet Size: 32
Polling Interval: 2 ms
Interface #1 - Communications-Data/Unknown Comm Class Model .............................................. "Company"
Alternate Setting 0
Number of Endpoints 2
Interface Class: 10 (Communications-Data)
Interface Subclass; 0 (Unknown Comm Class Model)
Interface Protocol: 0
Endpoint 0x84 - Bulk Input
Address: 0x84 (IN)
Attributes: 0x02 (Bulk)
Max Packet Size: 32
Polling Interval: 0 ms
Endpoint 0x05 - Bulk Output
Address: 0x05 (OUT)
Attributes: 0x02 (Bulk)
Max Packet Size: 32
Polling Interval: 0 ms
Interface #2 - Vendor-specific
Alternate Setting 0
Number of Endpoints 1
Interface Class: 255 (Vendor-specific)
Interface Subclass; 1 (Vendor-specific)
Interface Protocol: 0
Endpoint 0x87 - Bulk Input
Address: 0x87 (IN)
Attributes: 0x02 (Bulk)
Max Packet Size: 64
Polling Interval: 0 ms