阅读:1563回复:5
Endpoint和Interface的联系
我用DriverStudio框架生成的USB驱动,
支持四个EndPoint m_Endpoint1IN.Initialize(m_Lower, 0x81, 4096); m_Endpoint1OUT.Initialize(m_Lower, 0x1, 4096); m_Endpoint2IN.Initialize(m_Lower, 0x82, 4096); m_Endpoint2OUT.Initialize(m_Lower, 0x2, 4096); m_Interface.Initialize( m_Lower, //KUsbLowerDevice 0, //InterfaceNumber 1, //ConfigurationValue 0 //Initial Interface Alternate Setting ); 从上面的代码我知道Configure 1 和 Interface 0 是联系在一起的。 问题:我怎么知道 Interface O 用哪一个Endpoint?或者说,框架是怎样把具体的EndPoint和具体的interface联系在一起的?谢谢! |
|
沙发#
发布于:2003-10-22 19:35
接口和端点不是这么理解的.
数据是传输给端点的,和接口没有关系. 接口是和功能联系在一起的. 你看看这方面的书就知道了. [编辑 - 10/22/03 by wangxin_china] |
|
板凳#
发布于:2003-10-23 09:34
--------------------------------------------------------
我用DriverStudio框架生成的USB驱动, 支持四个EndPoint m_Endpoint1IN.Initialize(m_Lower, 0x81, 4096); m_Endpoint1OUT.Initialize(m_Lower, 0x1, 4096); m_Endpoint2IN.Initialize(m_Lower, 0x82, 4096); m_Endpoint2OUT.Initialize(m_Lower, 0x2, 4096); m_Interface.Initialize( m_Lower, //KUsbLowerDevice 0, //InterfaceNumber 1, //ConfigurationValue 0 //Initial Interface Alternate Setting ); 从上面的代码我知道Configure 1 和 Interface 0 是联系在一起的。 --------------------------------------------------------------- 问题:我怎么知道 Interface O 用哪一个Endpoint?或者说,框架是怎样把具体的EndPoint和具体的interface联系在一起的?谢谢! ------------------------------------------------------------ 我的理解如下: DEVICE>CONFIGURATION>INTERFACE>ENDPOINT 从上面的代码你怎么知道Configure 1 和 Interface 0 是联系在一起的???? EndPoint和具体的interface联系由你自己决定。你可以设几个interface方案,每个interface有它自己个性的endpoint设置,但每次工作时只能使用一个Interface方案,具体使用哪一个由host通过SetConfiguration命令来指定,你只能提供选项。 |
|
|
地板#
发布于:2003-10-23 09:41
不过如果你只有一个configuration,一个interface,那么这个唯一的configuration的设置值就为1,这个唯一interface的设置值就为0。当host通过SetConfiguration命令和SetInterface命令的时候就会分别以1和0来选中这个唯一的configuration和interface。
|
|
|
地下室#
发布于:2003-10-23 10:04
m_Interface.Initialize(
m_Lower, //KUsbLowerDevice 0, //InterfaceNumber 1, //ConfigurationValue 0 //Initial Interface Alternate Setting ); 从上面的InterfaceNumber(0)和ConfigurationValue(1)中可以知道, 她们是联系在一起的 |
|
5楼#
发布于:2003-10-23 10:43
我看书上是这么说的,看对你是否有帮助。
USB设备可以有多个配置(用于不同系统),每个配置可以有多个接口(提供应用程序访问),接口露出多个端点作为通信管道的一个终点。 |
|