阅读:1926回复:3
初始化WDM时的一些参数设置
我用Driverwork写的USB驱动,在初始化设备时用到KUsbInterface::Initialize,其中有三个参数
UCHAR InterfaceNumber, UCHAR ConfigurationValue, UCHAR InitialAlternateSetting 怎样来设置? InterfaceNumber Value that identifies the interface belonging to the specified device which is to be abstracted by this instance. The constructor uses this value to locate an interface descriptor for the object. The value must compare to field bInterfaceNumber in the interface descriptor. ConfigurationValue Value that identifies which configuration on the device that is to be abstracted by this instance. InitialAlternateSetting Value that indicates which alternate setting (if any) is to be initially configured for the device. If the interface supports multiple alternate settings, this value will be used to select the initial alternate setting to configure. For instance, some interfaces may have an alternate setting with zero endpoints or reduced isochronous bandwidth. This can allow the device to try to configure the device for maximum use but also have the ability to configure limited functionality if competing USB devices claim bandwidth. 我用Driverwork生成的代码中有一段注释为: // Initialize the interface object. The wizard generates code to support a single interface. You may create and add additional interfaces. By default, the wizard uses InterfaceNumber 0 (the first interface descriptor), ConfigurationValue 1 (the first configuration descriptor), and initial interface alternate setting of 0. If your device has multiple interfaces or alternate settings for an interface, you can add additional KUsbInterface objects or adjust the parameters passed to this function. 那位仁兄给翻译解释一下? 怎样理解这三个值(0,1,0)当我开发多个相同的设备时,是否需要设置这三个值,我要散分了。 |
|
|
沙发#
发布于:2001-09-29 10:27
你得去看device端的firmware设置。
而且,说明里面也说的很清楚: InterfaceNumber 0 (the first interface descriptor), ConfigurationValue 1 (the first configuration descriptor), and initial interface alternate setting of 0. 一般的设备都是只有一个interface的。如果你有2个,就要把另外的interface加上来。 |
|
|
板凳#
发布于:2001-09-29 11:08
用DDK真好!
|
|
|
地板#
发布于:2001-09-30 09:10
[QUOTE]原本由 DK-boy 发表
[B]用DDK真好! [/B][/QUOTE] 那也不见的噢!如果你的电源处理不好,也会让你死的很难看... |
|
|