WO2012129848A1 - Method and apparatus for simulating universal serial bus device - Google Patents

Method and apparatus for simulating universal serial bus device Download PDF

Info

Publication number
WO2012129848A1
WO2012129848A1 PCT/CN2011/075829 CN2011075829W WO2012129848A1 WO 2012129848 A1 WO2012129848 A1 WO 2012129848A1 CN 2011075829 W CN2011075829 W CN 2011075829W WO 2012129848 A1 WO2012129848 A1 WO 2012129848A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
descriptor
bluetooth
terminal side
terminal
Prior art date
Application number
PCT/CN2011/075829
Other languages
French (fr)
Chinese (zh)
Inventor
李幸远
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012129848A1 publication Critical patent/WO2012129848A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/105Program control for peripheral devices where the programme performs an input/output emulation function
    • G06F13/107Terminal emulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

A method for simulating USB devices is disclosed, used to implement simulation on compound USB device. The said method includes: through the USB interface, a terminal side receives USB device enumeration instructions sent by a personal computer (PC) side; the terminal side queries local device descriptors and configuration descriptors according to the USB device enumeration instructions, wherein the device descriptors and the configuration descriptors are set according to Bluetooth features; the terminal side returns the queried device descriptor and configuration descriptor to the PC side through the USB interface. An apparatus for implementing the said method is also disclosed. According to the technical solution, a simulation on the USB compound device can be realized.

Description

一种模拟通用串行总线设备的方法及装置 技术领域  Method and device for simulating universal serial bus device
本发明涉及通信及计算机领域, 尤其涉及一种模拟通用串行总线设备 的方法及装置。 背景技术  The present invention relates to the field of communications and computers, and more particularly to a method and apparatus for simulating a universal serial bus device. Background technique
随着无线通信技术的高速发展, 第三代无线通信网络技术的逐渐普及, 移动终端所提供的功能越来越多样化。 移动终端一般釆用 USB ( Universal Serial Bus, 通用串行总线)复合设备实现功能接口。 所谓 USB复合设备是 指在一个 USB主设备下挂有多个 USB子设备, 每个 USB子设备使用几个 USB端点分别与 PC (个人计算机)侧进行通信。 通常这些 USB子设备包 括 Modem(调制解调 殳备、多个虚拟串口和 NDIS( Network Driver Interface Specification, 网络设备接口规范) 网卡设备。  With the rapid development of wireless communication technologies, the third generation of wireless communication network technologies have become more and more popular, and the functions provided by mobile terminals have become more and more diverse. Mobile terminals generally use a USB (Universal Serial Bus) composite device to implement a functional interface. The so-called USB composite device refers to a plurality of USB sub-devices hung under one USB host device, and each USB sub-device uses several USB terminals to communicate with the PC (personal computer) side. Usually, these USB sub-devices include Modem (modulation and demodulation equipment, multiple virtual serial ports, and NDIS (Network Device Interface Specification) network card devices.
然而, USB端点属于硬件资源, 其个数是有限的。 USB协议规定了一 个 USB控制器最多有一个双向控制端点和 15对数据传输端点, 且一般的 USB设备控制器由于成本上的原因,所实现的 USB端点都比最多端点数少 很多。 因此硬件资源的限制造成了 USB复合设备子设备个数的限制, 无法 进一步扩展 USB子设备个数和增加 USB子设备的功能。  However, USB endpoints are hardware resources and their number is limited. The USB protocol stipulates that a USB controller has at most one bidirectional control endpoint and 15 pairs of data transmission endpoints, and the general USB device controller achieves a much lower number of USB endpoints than the maximum number of endpoints for cost reasons. Therefore, the limitation of hardware resources has caused the limitation of the number of USB composite device sub-devices, and the number of USB sub-devices and the function of adding USB sub-devices cannot be further expanded.
另外, USB复合设备在 PC侧的驱动程序非常复杂, 且主流的操作系 统对其支持并不好。 一般来说 USB 复合设备及其子设备驱动程序均需要 USB设备的提供者自行开发。 USB设备驱动的开发复杂, 成本较高, 延长 了产品的开发周期。 发明内容 In addition, the driver of the USB composite device on the PC side is very complicated, and the mainstream operating system does not support it well. In general, USB composite devices and their sub-device drivers require the development of the USB device provider. The development of USB device drivers is complex and costly, extending the product development cycle. Summary of the invention
本发明实施例提供一种模拟 USB设备的方法及装置,用于实现对 USB 复合设备的模拟。  Embodiments of the present invention provide a method and apparatus for simulating a USB device, which are used to implement simulation of a USB composite device.
一种模拟 USB设备的方法, 应用于终端侧, 该方法包括:  A method for simulating a USB device is applied to a terminal side, and the method includes:
终端侧通过 USB接口接收个人计算机 PC侧发送的 USB设备枚举指令; 终端侧根据 USB设备枚举指令查询本地的设备描述符和配置描述符, 其中, 设备描述符和配置描述符是依据蓝牙特征设置的;  The terminal side receives the USB device enumeration command sent by the PC side of the personal computer through the USB interface; the terminal side queries the local device descriptor and the configuration descriptor according to the USB device enumeration instruction, wherein the device descriptor and the configuration descriptor are based on the Bluetooth feature Set
终端侧通过 USB接口向 PC侧返回查询到的设备描述符和配置描述符。 一种模拟 USB设备的方法, 应用于 PC侧, 该方法包括:  The terminal side returns the queried device descriptor and configuration descriptor to the PC side through the USB interface. A method of simulating a USB device, applied to a PC side, the method comprising:
PC侧向终端侧发送 USB设备枚举指令;  The PC sends a USB device enumeration instruction to the terminal side;
PC侧接收 USB设备返回的设备描述符和配置描述符;  The PC side receives the device descriptor and the configuration descriptor returned by the USB device;
PC 侧通过设备描述符和配置描述符对虚拟蓝牙控制器进行枚举和识 别。  The PC side enumerates and recognizes the virtual Bluetooth controller through device descriptors and configuration descriptors.
一种终端设备, 该终端设备包括:  A terminal device, the terminal device comprising:
包括 USB接口的接口模块,用于通过 USB接口接收个人计算机 PC侧 发送的 USB设备枚举指令;  An interface module including a USB interface, configured to receive, by using a USB interface, a USB device enumeration instruction sent by a PC side of the personal computer;
虚拟蓝牙主机模块, 用于根据 USB设备枚举指令查询本地的设备描述 符和配置描述符, 其中, 设备描述符和配置描述符是依据蓝牙特征设置的; 以及, 指示接口模块通过 USB接口向 PC侧返回查询到的设备描述符和配 置描述符。  a virtual Bluetooth host module, configured to query a local device descriptor and a configuration descriptor according to the USB device enumeration instruction, where the device descriptor and the configuration descriptor are set according to the Bluetooth feature; and, the interface module is instructed to the PC through the USB interface The side returns the queried device descriptor and configuration descriptor.
一种计算机设备, 该计算机设备包括:  A computer device, the computer device comprising:
接口模块,用于向终端侧发送 USB设备枚举指令; 以及接收 USB设备 返回的设备描述符和配置描述符;  An interface module, configured to send a USB device enumeration instruction to the terminal side; and receive a device descriptor and a configuration descriptor returned by the USB device;
蓝牙控制模块, 用于通过设备描述符和配置描述符对虚拟蓝牙控制器 进行枚举和识别。 本发明实施例中预先依据蓝牙特征对设备描述符和配置描述符进行设 置, 使得 PC侧在需要对 USB设备进行枚举时, 将 USB设备识别为蓝牙设 备, 并对蓝牙设备进行枚举, 从而实现了用蓝牙设备模拟 USB设备, 因此 在后续通信时可依据蓝牙协议, 不受 USB端点个数的限制, 可支持更多的 USB子设备。 并且, 由于是釆用蓝牙协议通信, 所以加载的是蓝牙驱动, 不需要加载 USB驱动, 避免了 USB驱动所带来的问题。 附图说明 A Bluetooth control module for enumerating and identifying virtual Bluetooth controllers through device descriptors and configuration descriptors. In the embodiment of the present invention, the device descriptor and the configuration descriptor are set in advance according to the Bluetooth feature, so that the PC side recognizes the USB device as a Bluetooth device when enumerating the USB device, and enumerates the Bluetooth device, thereby It realizes the simulation of the USB device with the Bluetooth device, so it can support more USB sub-devices according to the Bluetooth protocol in the subsequent communication, without being limited by the number of USB endpoints. Moreover, since the Bluetooth protocol is used for communication, the Bluetooth driver is loaded, and the USB driver does not need to be loaded, thereby avoiding the problems caused by the USB driver. DRAWINGS
图 1为本发明实施例中模拟 USB设备在终端侧的主要方法流程图; 图 2为本发明实施例中模拟 USB设备在 PC侧的主要方法流程图; 图 3为本发明实施例中模拟 USB设备的详细方法流程图;  1 is a flowchart of a main method for simulating a USB device on a terminal side according to an embodiment of the present invention; FIG. 2 is a flowchart of a main method for simulating a USB device on a PC side according to an embodiment of the present invention; FIG. 3 is a schematic diagram of a USB emulating USB according to an embodiment of the present invention; Detailed method flow chart of the device;
图 4为本发明实施例中蓝牙设备配对的方法流程图;  4 is a flowchart of a method for pairing Bluetooth devices according to an embodiment of the present invention;
图 5为本发明实施例中服务发现的方法流程图;  FIG. 5 is a flowchart of a method for service discovery according to an embodiment of the present invention;
图 6为本发明实施例中终端设备的主要结构图;  6 is a main structural diagram of a terminal device according to an embodiment of the present invention;
图 7为本发明实施例中终端设备的详细结构图  FIG. 7 is a detailed structural diagram of a terminal device according to an embodiment of the present invention;
图 8为本发明实施例中个人计算机的结构图;  FIG. 8 is a structural diagram of a personal computer according to an embodiment of the present invention; FIG.
图 9为本发明实施例中虚拟蓝牙控制器模块的结构图示意图。 具体实施方式  FIG. 9 is a schematic structural diagram of a virtual bluetooth controller module according to an embodiment of the present invention. detailed description
本发明实施例中预先依据蓝牙特征对设备描述符和配置描述符进行设 置, 使得 PC侧在需要对 USB设备进行枚举时, 将 USB设备识别为蓝牙设 备, 并对蓝牙设备进行枚举。 从而实现了用蓝牙设备模拟 USB设备, 因此 在后续通信时可依据蓝牙协议, 不受 USB端点个数的限制, 可支持更多的 USB子设备。 并且, 由于是釆用蓝牙协议通信, 所以加载的是蓝牙驱动, 不需要加载 USB驱动, 避免了 USB驱动所带来的问题。  In the embodiment of the present invention, the device descriptor and the configuration descriptor are set in advance according to the Bluetooth feature, so that the PC side recognizes the USB device as a Bluetooth device when enumerating the USB device, and enumerates the Bluetooth device. Therefore, the USB device is simulated by the Bluetooth device, so the subsequent communication can be based on the Bluetooth protocol, and is not limited by the number of USB terminals, and can support more USB sub-devices. Moreover, since the Bluetooth protocol is used for communication, the Bluetooth driver is loaded, and the USB driver does not need to be loaded, thereby avoiding the problems caused by the USB driver.
如图 1所示,本实施例中模拟 USB设备在终端侧的主要方法流程如下: 终端侧通过 USB接口与 PC侧连接后执行下面的过程。 As shown in FIG. 1 , the main method of simulating a USB device on the terminal side in this embodiment is as follows: After the terminal side is connected to the PC side through the USB interface, perform the following procedure.
步骤 101: 终端侧通过 USB接口接收个人计算机 PC侧发送的 USB设 备枚举指令。  Step 101: The terminal side receives the USB device enumeration instruction sent by the PC side of the personal computer through the USB interface.
步骤 102: 终端侧根据 USB设备枚举指令查询本地的设备描述符和配 置描述符; 其中, 设备描述符和配置描述符是依据蓝牙特征设置的, 设备 描述符和配置描述符的取值预先配置在终端侧中。  Step 102: The terminal side queries the local device descriptor and the configuration descriptor according to the USB device enumeration instruction. The device descriptor and the configuration descriptor are set according to the Bluetooth feature, and the value of the device descriptor and the configuration descriptor are pre-configured. In the terminal side.
步骤 103 : 终端侧通过 USB接口向 PC侧返回查询到的设备描述符和 配置描述符。  Step 103: The terminal side returns the queried device descriptor and the configuration descriptor to the PC side through the USB interface.
终端侧将设备描述符和配置描述符发给 PC侧后, PC侧便可将其识别 成蓝牙设备, 后续便可通过蓝牙协议进行通信, 实现对 USB设备的模拟。  After the terminal side sends the device descriptor and the configuration descriptor to the PC side, the PC side can recognize it as a Bluetooth device, and then can communicate through the Bluetooth protocol to implement simulation of the USB device.
如图 2所示,本实施例中模拟 USB设备在 PC侧的主要方法流程如下: 步骤 201: PC侧向终端侧发送 USB设备枚举指令。  As shown in FIG. 2, the main method of simulating a USB device on the PC side in this embodiment is as follows: Step 201: The PC side sends a USB device enumeration instruction to the terminal side.
步骤 202: PC侧接收 USB设备返回的设备描述符和配置描述符。  Step 202: The PC side receives the device descriptor and the configuration descriptor returned by the USB device.
步骤 203: PC侧通过设备描述符和配置描述符对虚拟蓝牙控制器进行 枚举和识别。  Step 203: The PC side enumerates and identifies the virtual Bluetooth controller by using the device descriptor and the configuration descriptor.
现有技术中终端与 PC是通过蓝牙硬件设备通信,本实施例中是为了通 过蓝牙来模拟 USB设备, 因此虚拟蓝牙控制器等虚拟出的与蓝牙有关的设 备均由软件实现。  In the prior art, the terminal and the PC communicate with each other through a Bluetooth hardware device. In this embodiment, the USB device is simulated by Bluetooth. Therefore, the virtual Bluetooth-related devices such as the virtual Bluetooth controller are implemented by software.
如图 3所示, 本实施例中模拟 USB设备的详细方法流程如下:  As shown in FIG. 3, the detailed method for simulating a USB device in this embodiment is as follows:
PC侧获得 USB接口的连接触发后开始下面的步骤。  After the PC side obtains the connection of the USB interface, the following steps are started.
步骤 301: PC侧通过 USB接口向终端侧发送 USB设备枚举指令。 步骤 302:终端侧通过 USB接口接收 PC侧发送的 USB类型的 USB设 备枚举指令。  Step 301: The PC side sends a USB device enumeration instruction to the terminal side through the USB interface. Step 302: The terminal side receives the USB type USB device enumeration instruction sent by the PC side through the USB interface.
步骤 303: 终端侧依据蓝牙协议返回蓝牙控制器类 USB设备的枚举数 据。 步骤 304: 终端侧根据 USB设备枚举指令查询本地的设备描述符和配 置描述符。 其中, 设备描述符和配置描述符是依据蓝牙特征设置的。 Step 303: The terminal side returns the enumerated data of the Bluetooth controller class USB device according to the Bluetooth protocol. Step 304: The terminal side queries the local device descriptor and the configuration descriptor according to the USB device enumeration instruction. The device descriptor and configuration descriptor are set according to the Bluetooth feature.
步骤 305: 终端侧依据 USB协议将查询到的蓝牙类型的设备描述符和 配置描述符转换为 USB类型的设备描述符和配置描述符。 本实施例中配置 描述符包括字符串描述符、 接口描述符和端点描述符。 例如, 将设备描述 符中的设备类字段(bDeviceClass )设置为 OxEO, 其含义为无线控制器设备 类; 设备子类字段(bDeviceSubClass )设置为 0x01 , 其含义为蓝牙、 超宽 带(UWB, Ultra Wideband ), Remote RNDIS (远程 NDIS )或者蓝牙 AMP 控制器子类; 设备协议字段(bDeviceProtocol )设置为 0x01 , 其含义为蓝 牙控制器接口协议。 将配置描述下的接口描述符中的接口类字段 ( blnterfaceClass )设置为 OxEO, 其含义为无线控制器设备类; 接口子类字 段( blnterfaceSubClass )设置为 0x01 ,其含义为蓝牙、 UWB、 Remote RNDIS 或者蓝牙 AMP控制器子类;接口协议字段(blnterfaceProtocol )设置为 0x01 , 其含义为蓝牙控制器接口协议。  Step 305: The terminal side converts the queried Bluetooth type device descriptor and the configuration descriptor into a USB type device descriptor and a configuration descriptor according to the USB protocol. The configuration descriptor in this embodiment includes a string descriptor, an interface descriptor, and an endpoint descriptor. For example, set the device class field (bDeviceClass) in the device descriptor to OxEO, which means the wireless controller device class; the device subclass field (bDeviceSubClass) is set to 0x01, which means Bluetooth, ultra wideband (UWB, Ultra Wideband) ), Remote RNDIS (Remote NDIS) or Bluetooth AMP controller subclass; Device Protocol field (bDeviceProtocol) is set to 0x01, which means Bluetooth Controller Interface Protocol. Set the interface class field ( blnterfaceClass ) in the interface descriptor under the configuration description to OxEO, which means the wireless controller device class; the interface subclass field ( blnterfaceSubClass ) is set to 0x01 , which means Bluetooth, UWB, Remote RNDIS or Bluetooth AMP controller subclass; interface protocol field (blnterfaceProtocol) is set to 0x01, which means Bluetooth controller interface protocol.
步骤 306: 终端侧通过 USB接口向 PC侧返回 USB类型的设备描述符 和配置描述符。  Step 306: The terminal side returns a USB type device descriptor and a configuration descriptor to the PC side through the USB interface.
步骤 307: PC侧通过解析设备描述符和配置描述符获知终端侧为蓝牙 设备, 并对虚拟蓝牙控制器进行枚举和识别。 PC侧还可以为该设备安装蓝 牙控制器设备驱动。  Step 307: The PC side learns that the terminal side is a Bluetooth device by parsing the device descriptor and the configuration descriptor, and enumerates and identifies the virtual Bluetooth controller. The PC side can also be equipped with a Bluetooth controller device driver for the device.
PC侧识别出蓝牙设备后, 便可以通过蓝牙协议与终端侧通信, 后续还 需要进行蓝牙设备的配对和服务发现过程, 参见下面的流程。  After the PC device recognizes the Bluetooth device, it can communicate with the terminal side through the Bluetooth protocol. The Bluetooth device pairing and service discovery process are also required. See the following procedure.
步骤 308: PC侧向终端侧发送配对请求, 并与终端侧完成配对过程。 步骤 309: PC侧向终端侧发送服务发现请求。  Step 308: The PC side sends a pairing request to the terminal side, and completes the pairing process with the terminal side. Step 309: The PC side sends a service discovery request to the terminal side.
步骤 310: 终端侧返回虚拟蓝牙主机支持的蓝牙规范标识。 蓝牙规范至 少包括 DUN ( Dial-up Networking, 拨号网络)、 串口和 PAN ( Personal Area Networking, 个人局 i或网)功能之一。 Step 310: The terminal side returns a Bluetooth specification identifier supported by the virtual bluetooth host. The Bluetooth specification includes at least DUN (Dial-up Networking), serial port and PAN (Personal Area) Networking, personal office i or network) one of the features.
步骤 311 : PC侧根据 DU 、 串口和 PAN功能标识进行功能枚举。 即, PC侧根据 DU 标识、 串口标识和 PAN功能标识枚举出 Modem口、 虚拟 串口和 NDIS网卡设备等 USB子设备。  Step 311: The PC side performs function enumeration according to the DU, the serial port, and the PAN function identifier. That is, the PC side enumerates USB sub-devices such as a Modem port, a virtual serial port, and an NDIS network card device according to the DU identifier, the serial port identifier, and the PAN function identifier.
PC通过配对过程可获得终端侧内虚拟蓝牙主机的详细信息, 以及通过 服务发现过程枚举出 USB子设备。 下面针对这两个过程进行详细介绍。  The PC obtains the detailed information of the virtual Bluetooth host in the terminal side through the pairing process, and enumerates the USB sub-device through the service discovery process. The two processes are described in detail below.
如图 4所示, 本实施例中蓝牙设备配对的方法流程如下:  As shown in FIG. 4, the method for pairing Bluetooth devices in this embodiment is as follows:
步骤 401: PC侧通过 HCI ( Host Controller Interface, 主机控制器接口) 命令向终端侧发送 Inquiry Scan (查询扫描)命令。 PC侧以广播方式发送 Inquiry Scan命令,以扫描附近的蓝牙主机,但本实施例中终端侧是通过 USB 接口与 PC侧连接的, 因此终端侧通过 USB接口接收 Inquiry Scan命令。  Step 401: The PC side sends an Inquiry Scan command to the terminal side through an HCI (Host Controller Interface) command. The PC side sends the Inquiry Scan command in a broadcast mode to scan the nearby Bluetooth host. However, in this embodiment, the terminal side is connected to the PC side through the USB interface. Therefore, the terminal side receives the Inquiry Scan command through the USB interface.
步骤 402: 终端侧向 PC侧返回携带有虚拟蓝牙主机的 MAC ( (Media Step 402: The terminal side returns to the PC side the MAC carrying the virtual bluetooth host ( (Media
Access Control, 媒体接入控制)地址的 Inquiry Result HCI (查询结果 HCI ) 事件。 由于终端侧中的蓝牙主机是由软件虚拟出的蓝牙主机, 不存在蓝牙 硬件设备, 因此 MAC地址可以是预先配置给终端的默认的 MAC地址。 Inquiry Control HCI of the Access Control, Media Access Control) address. Since the Bluetooth host in the terminal side is a Bluetooth host virtualized by software, there is no Bluetooth hardware device, so the MAC address can be a default MAC address pre-configured to the terminal.
步骤 403: 终端侧向 PC侧返回 Inquiry Complete HCI (查询完成 HCI ) 事件。  Step 403: The terminal side returns an Inquiry Complete HCI event to the PC side.
扫描过程结束。 PC侧还可以进一步获得终端侧虚拟蓝牙主机的详细信 息, 参见下面的流程。  The scanning process ends. The PC side can further obtain detailed information of the terminal side virtual Bluetooth host, see the following process.
步骤 404: PC侧发出 Remote Name Request HCI (远程名称请求 HCI ) 命令, 请求终端侧返回蓝牙主机的详细信息。  Step 404: The PC side issues a Remote Name Request HCI (remote name request HCI) command, and requests the terminal side to return the detailed information of the Bluetooth host.
步骤 405 : 终端侧返回带有虚拟蓝牙主机详细信息的 Remote Name Request Complete HCI (远程名称请求完成 HCI )事件。 虚拟蓝牙主机详细 信息包括主机名等信息。  Step 405: The terminal side returns a Remote Name Request Complete HCI event with virtual Bluetooth host details. The virtual Bluetooth host details include information such as the host name.
出于安全考虑, PC侧还可以对终端侧的虚拟蓝牙主机进行认证, 参见 下面的流程。 For security reasons, the PC side can also authenticate the virtual Bluetooth host on the terminal side. The process below.
步骤 406: PC侧通过 HCI命令发送配对认证密码。  Step 406: The PC side sends the pairing authentication password by using the HCI command.
步骤 407: 终端侧返回认证成功的 HCI事件。  Step 407: The terminal side returns an HCI event with successful authentication.
参见图 5 , 本实施例中服务发现的方法流程如下:  Referring to FIG. 5, the method for service discovery in this embodiment is as follows:
步骤 501 : PC侧发出创建 ACL (访问控制列表)数据连接请求。  Step 501: The PC side issues an ACL (Access Control List) data connection request.
步骤 502: 终端侧返回创建连接成功 HCI事件, 并返回新建 ACL连接 的句柄号。  Step 502: The terminal side returns to create a connection successful HCI event, and returns a handle number of the newly created ACL connection.
步骤 503: PC侧在 ACL连接上发出请求查询设备功能的请求。  Step 503: The PC side sends a request for querying the function of the device on the ACL connection.
步骤 504: 终端侧在 ACL连接上返回设备支持的功能的标识。 功能包 括 DUN (拨号网络), 串口功能和 PAN (个人局域网) 功能等。  Step 504: The terminal side returns an identifier of a function supported by the device on the ACL connection. Features include DUN (Dial-up Networking), serial port functionality, and PAN (Personal Area Network) features.
步骤 505: PC侧根据终端侧返回的功能标识枚举出 USB子设备。 如枚 举出 Modem口、 虚拟串口和 NDIS网卡设备等。  Step 505: The PC side enumerates the USB sub-device according to the function identifier returned by the terminal side. For example, the Modem port, virtual serial port and NDIS network card device are listed.
本实施例中 ACL数据使用一个端点 Bulk(主体) OUT和一个 Bulk IN 端点传输。 HCI命令使用控制端点传输。 HCI事件使用 Interrupt IN (终端 输入)端点传输。  In this embodiment, the ACL data is transmitted using an endpoint Bulk (body) OUT and a Bulk IN endpoint. The HCI command uses control endpoint transfers. HCI events are transmitted using Interrupt IN endpoints.
通过以上描述了解了用蓝牙模拟 USB设备的实现过程, 该过程主要由 终端设备和 PC来实现, 下面对这两个设备的内部结构和功能进行介绍。  Through the above description, the implementation process of simulating a USB device with Bluetooth is understood. The process is mainly implemented by a terminal device and a PC. The internal structure and functions of the two devices are described below.
如图 6所示, 本实施例中终端设备包括: 接口模块 601和虚拟蓝牙主 机模块 602。  As shown in FIG. 6, the terminal device in this embodiment includes: an interface module 601 and a virtual Bluetooth host module 602.
包括 USB接口的接口模块 601用于与 PC侧进行各种数据、 命令和事 件的传输,如通过 USB接口接收个人计算机 PC侧发送的 USB设备枚举指 令。  The interface module 601 including the USB interface is used for transmitting various data, commands, and events with the PC side, such as receiving a USB device enumeration instruction sent by the PC side of the personal computer through the USB interface.
虚拟蓝牙主机模块 602用于根据 USB设备枚举指令查询本地的设备描 述符和配置描述符, 其中, 设备描述符和配置描述符是依据蓝牙特征设置 的; 以及, 指示接口模块通过 USB接口向 PC侧返回查询到的设备描述符 和配置描述符。 虚拟蓝牙主机模块 602还用于生成各种消息和事件等。 具体的, 接口模块通过 USB接口接收 PC侧发送的 USB类型的 USB 设备枚举指令。 所述终端设备还包括: 虚拟蓝牙控制器模块 603 , 如图 7所 示, 虚拟蓝牙控制器模块 603用于依据蓝牙协议返回蓝牙控制器类 USB设 备的枚举数据; 以及, 依据 USB协议将查询到的蓝牙类型的设备描述符和 配置描述符转换为 USB 类型的设备描述符和配置描述符。 接口模块通过 USB接口向 PC侧返回 USB类型的设备描述符和配置描述符。 The virtual Bluetooth host module 602 is configured to query a local device descriptor and a configuration descriptor according to the USB device enumeration instruction, where the device descriptor and the configuration descriptor are set according to the Bluetooth feature; and, the indication interface module transmits the PC to the PC through the USB interface. Side return the queried device descriptor And configuration descriptors. The virtual Bluetooth host module 602 is also used to generate various messages, events, and the like. Specifically, the interface module receives the USB type USB device enumeration instruction sent by the PC side through the USB interface. The terminal device further includes: a virtual bluetooth controller module 603, as shown in FIG. 7, the virtual bluetooth controller module 603 is configured to return the enumerated data of the Bluetooth controller class USB device according to the Bluetooth protocol; and, according to the USB protocol, the query is performed. The Bluetooth type device descriptor and configuration descriptor to be converted to a USB type device descriptor and configuration descriptor. The interface module returns a USB type device descriptor and a configuration descriptor to the PC side through the USB interface.
接口模块 601还用于接收 PC侧发送的配对请求, 并与 PC侧完成配对 过程。具体的,接口模块 601通过 HCI命令接收 PC侧发送的查询扫描 Inquiry Scan命令;向 PC侧返回携带有虚拟蓝牙主机的媒体接入控制 MAC地址的 查询结果 HCI Inquiry Result HCI事件; 向 PC侧返回查询完成 HCI Inquiry Complete HCI事件。  The interface module 601 is further configured to receive a pairing request sent by the PC side and complete the pairing process with the PC side. Specifically, the interface module 601 receives the query scan Inquiry Scan command sent by the PC side through the HCI command, and returns a query result HCI Inquiry Result HCI event of the media access control MAC address carrying the virtual bluetooth host to the PC side; and returns a query to the PC side. Complete the HCI Inquiry Complete HCI event.
接口模块 601还用于接收 PC侧发送的服务发现请求,并返回虚拟蓝牙 主机支持的 DUN、 串口和 PAN功能标识。  The interface module 601 is further configured to receive a service discovery request sent by the PC side, and return a DUN, a serial port, and a PAN function identifier supported by the virtual Bluetooth host.
本实施例中虚拟蓝牙主机模块 602构成通信系统中的一个蓝牙主机。 向终端设备的应用层提供 Modem,串口和 NIDS网卡数据传输接口。 Modem 和串口上的数据使用蓝牙的 RFCOMM ( Radio Frequency Communication, 线缆替代协议)协议实现复用, 可以支持 63个 Modem口或者串口。 NDIS 网卡数据传输由蓝牙的 BENP ( Bluetooth Network Encapsulation Protocol, 蓝牙以太网封装协议)协议封装。 所有的数据收发最终使用蓝牙 L2CAP ( Logical link control and adaptation protocol, 链路控制及适西己协议 ) 装在 ACL数据帧中进行传输。  In this embodiment, the virtual Bluetooth host module 602 constitutes a Bluetooth host in the communication system. Provides modem, serial port and NIDS network card data transmission interface to the application layer of the terminal device. The data on the modem and the serial port are multiplexed using the RFCOMM (Wireless Frequency Communication) protocol of Bluetooth. It can support 63 Modem ports or serial ports. NDIS NIC data transmission is encapsulated by Bluetooth's BENP (Bluetooth Network Encapsulation Protocol) protocol. All data is sent and received in the ACL data frame for transmission using Bluetooth L2CAP (Logical Link Control and Adaptation Protocol).
虚拟蓝牙控制器模块 603通过设置 USB设备描述符和 USB配置描述 符, 使 PC侧为 USB设备安装蓝牙设备驱动程序。 以及, 虚拟蓝牙控制器 模块 603提供传输 HCI命令、 HCI事件及 ACL数据包的接口。 ACL数据 使用一个端点 Bulk OUT和一个 Bulk IN端点传输。 HCI命令使用控制端点 传输。 HCI事件使用 Interrupt IN端点传输。 The virtual Bluetooth controller module 603 causes the PC side to install the Bluetooth device driver for the USB device by setting the USB device descriptor and the USB configuration descriptor. And, the virtual Bluetooth controller module 603 provides an interface for transmitting HCI commands, HCI events, and ACL packets. ACL data Use an endpoint Bulk OUT and a Bulk IN endpoint to transmit. The HCI command uses control endpoint transfers. HCI events are transmitted using the Interrupt IN endpoint.
虚拟蓝牙控制器模块 603的内部结构参见图 9所示。 HCI命令处理模 块, 完成接收 PC侧蓝牙主机发出的 HCI命令, 执行后将命令的执行结果 通过 HCI事件返回给 PC侧蓝牙主机。 SDP协议模块, 完成对 PC侧蓝牙主 机 SDP协议请求的处理。 串口 /Modem应用接口, 为无线终端的应用层提 供访问串口及 Modem。 上层收发的数据首先通过 RFCOMM协议模块对多 个串口、 Modem口的数据进行复用 /解复用处理, 然后发送到 L2CAP协议 实现模块, 最后封装在 ACL数据包中与 PC侧端口进行通信。 网卡应用接 口, 为无线终端的应用层提供收发以太网帧的接口。 上层收发的以太网帧 首先通过 BENP协议模块对以太网帧处理后,发送到然后发送到 L2CAP协 议实现模块, 最后封装在 ACL数据包中与 PC侧端口进行通信。  The internal structure of the virtual Bluetooth controller module 603 is shown in Figure 9. The HCI command processing module completes receiving the HCI command sent by the Bluetooth host on the PC side, and after execution, returns the execution result of the command to the Bluetooth host on the PC side through the HCI event. The SDP protocol module completes the processing of the SDP protocol request of the Bluetooth side of the PC side. The serial port/Modem application interface provides access to the serial port and modem for the application layer of the wireless terminal. The data sent and received by the upper layer is first multiplexed/demultiplexed by the RFCOMM protocol module for multiple serial port and modem ports, and then sent to the L2CAP protocol implementation module, and finally encapsulated in the ACL data packet to communicate with the PC side port. The NIC application interface provides an interface for transmitting and receiving Ethernet frames to the application layer of the wireless terminal. The Ethernet frame sent and received by the upper layer is first processed by the BENP protocol module, then sent to the L2CAP protocol implementation module, and finally encapsulated in the ACL packet to communicate with the PC side port.
如图 8所示, 本实施例中计算机设备包括:  As shown in FIG. 8, the computer device in this embodiment includes:
接口模块 801用于向终端侧发送 USB设备枚举指令; 以及接收 USB 设备返回的设备描述符和配置描述符。  The interface module 801 is configured to send a USB device enumeration instruction to the terminal side; and receive the device descriptor and the configuration descriptor returned by the USB device.
蓝牙控制模块 802用于通过设备描述符和配置描述符对虚拟蓝牙控制 器进行枚举和识别。 蓝牙控制模块 802包括蓝牙主机驱动和蓝牙协议栈。  The Bluetooth Control Module 802 is used to enumerate and identify the virtual Bluetooth controller through device descriptors and configuration descriptors. The Bluetooth Control Module 802 includes a Bluetooth host driver and a Bluetooth protocol stack.
具体的, 接口模块 801 包括 USB接口, 通过 USB接口向终端侧发送 USB设备枚举指令; 以及, 通过 USB接口接收 USB设备返回的设备描述 符和配置描述符。 蓝牙控制模块 802通过解析设备描述符和配置描述符获 知终端侧为蓝牙设备, 并对虚拟蓝牙控制器进行枚举和识别。  Specifically, the interface module 801 includes a USB interface, and sends a USB device enumeration instruction to the terminal side through the USB interface; and receives the device descriptor and the configuration descriptor returned by the USB device through the USB interface. The Bluetooth control module 802 learns that the terminal side is a Bluetooth device by parsing the device descriptor and the configuration descriptor, and enumerates and recognizes the virtual Bluetooth controller.
接口模块 801 还用于向终端侧发送配对请求, 并与终端侧完成配对过 程。 具体的, 接口模块 801通过 HCI命令向终端侧发送 Inquiry Scan命令; 接收终端侧返回的携带有虚拟蓝牙主机的 MAC地址的 HCI Inquiry Result HCI事件; 接收终端侧返回的 HCI Inquiry Complete HCI事件。 接口模块 801 还用于向终端侧发送服务发现请求; 接收终端侧返回的 虚拟蓝牙主机支持的 DUN、 串口和 PAN功能标识。蓝牙控制模块 802还用 于根据 DUN, 串口和 PAN功能标识进行功能枚举。 The interface module 801 is further configured to send a pairing request to the terminal side, and complete the pairing process with the terminal side. Specifically, the interface module 801 sends an Inquiry Scan command to the terminal side through the HCI command, and receives an HCI Inquiry Result HCI event that carries the MAC address of the virtual Bluetooth host returned by the terminal side, and receives an HCI Inquiry Complete HCI event returned by the terminal side. The interface module 801 is further configured to send a service discovery request to the terminal side, and receive a DUN, a serial port, and a PAN function identifier supported by the virtual bluetooth host returned by the terminal side. The Bluetooth Control Module 802 is also used to enumerate functions based on DUN, serial port and PAN function identification.
本发明实施例中预先依据蓝牙特征对设备描述符和配置描述符进行设 置, 使得 PC (个人计算机)侧在需要对 USB设备进行枚举时, 将 USB设 备识别为蓝牙设备, 并对蓝牙设备进行枚举。 从而实现了用蓝牙设备模拟 USB设备,因此在后续通信时可依据蓝牙协议,不受 USB端点个数的限制, 可支持更多的 USB子设备。 并且, 由于是釆用蓝牙协议通信, 所以加载的 是蓝牙驱动, 不需要加载 USB驱动,避免了 USB驱动所带来的问题。 本发 明实施例还提供了配对和服务发现的实现方案, 实现从连接到服务传输的 完整过程。  In the embodiment of the present invention, the device descriptor and the configuration descriptor are set in advance according to the Bluetooth feature, so that the PC (personal computer) side recognizes the USB device as a Bluetooth device when the USB device needs to be enumerated, and performs the Bluetooth device on the Bluetooth device. enumerate. Therefore, the USB device is simulated by the Bluetooth device, so the subsequent communication can be based on the Bluetooth protocol, and is not limited by the number of USB endpoints, and can support more USB sub-devices. Moreover, since the Bluetooth protocol is used for communication, the Bluetooth driver is loaded, and the USB driver does not need to be loaded, thereby avoiding the problems caused by the USB driver. Embodiments of the present invention also provide an implementation of pairing and service discovery to implement a complete process from connection to service delivery.
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 系统、 或计算机程序产品。 因此, 本发明可釆用完全硬件实施例、 完全软件实施 例、 或结合软件和硬件方面的实施例的形式。 而且, 本发明可釆用在一个 或多个其中包含有计算机可用程序代码的计算机可用存储介质 (包括但不 限于磁盘存储器和光学存储器等 )上实施的计算机程序产品的形式。  Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can be embodied in the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、 设备(系统)、 和计算机程序 产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流 程图和 /或方框图中的每一流程和 /或方框、 以及流程图和 /或方框图中 的流程和 /或方框的结合。 可提供这些计算机程序指令到通用计算机、 专 用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一个 机器, 使得通过计算机或其他可编程数据处理设备的处理器执行的指令产 生用于实现在流程图一个流程或多个流程和 /或方框图一个方框或多个方 框中指定的功能的装置。  The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中, 使得存储在该计算机可读存 储器中的指令产生包括指令装置的制造品, 该指令装置实现在流程图一个 流程或多个流程和 /或方框图一个方框或多个方框中指定的功能。 These computer program instructions can also be stored in a bootable computer or other programmable data processing The apparatus is readable in a computer readable memory in a particular manner, such that instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备 上, 使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机 实现的处理, 从而在计算机或其他可编程设备上执行的指令提供用于实现 在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的 功能的步骤。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。  These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram. The spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims

权利要求书 Claim
1、 一种模拟通用串行总线(USB )设备的方法, 其特征在于, 该方法 包括:  A method of simulating a universal serial bus (USB) device, the method comprising:
终端侧通过 USB接口接收个人计算机 PC侧发送的 USB设备枚举指令; 终端侧根据 USB设备枚举指令查询本地的设备描述符和配置描述符, 其中, 设备描述符和配置描述符是依据蓝牙特征设置的;  The terminal side receives the USB device enumeration command sent by the PC side of the personal computer through the USB interface; the terminal side queries the local device descriptor and the configuration descriptor according to the USB device enumeration instruction, wherein the device descriptor and the configuration descriptor are based on the Bluetooth feature Set
终端侧通过 USB接口向 PC侧返回查询到的设备描述符和配置描述符。  The terminal side returns the queried device descriptor and configuration descriptor to the PC side through the USB interface.
2、 如权利要求 1所述的方法, 其特征在于, 所述终端侧通过 USB接 口接收个人计算机 PC侧发送的 USB设备枚举指令为: 终端侧通过 USB接 口接收 PC侧发送的 USB类型的 USB设备枚举指令; 终端侧依据蓝牙协议 返回蓝牙控制器类 USB设备的枚举数据;  2. The method according to claim 1, wherein the terminal side receives the USB device enumeration command sent by the PC side of the personal computer through the USB interface: the terminal side receives the USB type USB sent by the PC side through the USB interface. The device enumerates the instruction; the terminal side returns the enumerated data of the Bluetooth controller class USB device according to the Bluetooth protocol;
所述终端侧通过 USB接口向 PC侧返回查询到的设备描述符和配置描 述符为: 终端侧依据 USB协议将查询到的蓝牙类型的设备描述符和配置描 述符转换为 USB类型的设备描述符和配置描述符;终端侧通过 USB接口向 PC侧返回 USB类型的设备描述符和配置描述符。  The terminal side returns the queried device descriptor and the configuration descriptor to the PC side through the USB interface as follows: The terminal side converts the queried Bluetooth type device descriptor and configuration descriptor into a USB type device descriptor according to the USB protocol. And a configuration descriptor; the terminal side returns a USB type device descriptor and a configuration descriptor to the PC side through the USB interface.
3、 如权利要求 1所述的方法, 其特征在于, 该方法还包括: 终端侧接 收 PC侧发送的配对请求, 并与 PC侧完成配对过程。  3. The method according to claim 1, wherein the method further comprises: receiving, by the terminal side, a pairing request sent by the PC side, and completing a pairing process with the PC side.
4、 如权利要求 3所述的方法, 其特征在于, 所述终端侧接收 PC侧发 送的配对请求, 并与 PC侧完成配对过程为:  4. The method according to claim 3, wherein the terminal side receives the pairing request sent by the PC side, and completes the pairing process with the PC side as:
终端侧通过主机控制器接口 (HCI )命令接收 PC 侧发送的查询扫描 The terminal side receives the query scan sent by the PC side through the Host Controller Interface (HCI) command.
( Inquiry Scan )命令; (Invest Scan) command;
终端侧向 PC侧返回携带有虚拟蓝牙主机的媒体接入控制 MAC地址的 查询结果 HCI事件;  The terminal side returns to the PC side the query result of the media access control MAC address carrying the virtual bluetooth host, the HCI event;
终端侧向 PC侧返回查询完成 HCI事件。  The terminal side returns the query completion HCI event to the PC side.
5、 如权利要求 3所述的方法, 其特征在于, 该方法还包括: 终端侧接 收 PC侧发送的服务发现请求, 并返回虚拟蓝牙主机支持的蓝牙规范标识。5. The method according to claim 3, wherein the method further comprises: terminating the terminal The service discovery request sent by the PC side is received, and the Bluetooth specification identifier supported by the virtual bluetooth host is returned.
6、 一种模拟 USB设备的方法, 其特征在于, 该方法包括: 6. A method of simulating a USB device, the method comprising:
PC侧向终端侧发送 USB设备枚举指令;  The PC sends a USB device enumeration instruction to the terminal side;
PC侧接收 USB设备返回的设备描述符和配置描述符;  The PC side receives the device descriptor and the configuration descriptor returned by the USB device;
PC 侧通过设备描述符和配置描述符对虚拟蓝牙控制器进行枚举和识 别。  The PC side enumerates and recognizes the virtual Bluetooth controller through device descriptors and configuration descriptors.
7、 如权利要求 6所述的方法, 其特征在于, 所述 PC侧向终端侧发送 USB设备枚举指令为: PC侧通过 USB接口向终端侧发送 USB设备枚举指 令;  The method of claim 6, wherein the PC sends a USB device enumeration command to the terminal side: the PC side sends the USB device enumeration instruction to the terminal side through the USB interface;
PC侧接收 USB设备返回的设备描述符和配置描述符的步骤包括: PC 侧通过 USB接口接收 USB设备返回的设备描述符和配置描述符;  The step of receiving, by the PC side, the device descriptor and the configuration descriptor returned by the USB device includes: receiving, by the PC side, a device descriptor and a configuration descriptor returned by the USB device through the USB interface;
PC侧通过设备描述符和配置描述符对虚拟蓝牙控制器进行枚举和识别 的步骤包括: PC侧通过解析设备描述符和配置描述符获知终端侧为蓝牙设 备, 并对虚拟蓝牙控制器进行枚举和识别。  The step of enumerating and identifying the virtual bluetooth controller by using the device descriptor and the configuration descriptor on the PC side includes: the PC side knows that the terminal side is a Bluetooth device by parsing the device descriptor and the configuration descriptor, and the virtual bluetooth controller is enumerated Lift and identify.
8、 如权利要求 6所述的方法, 其特征在于, 该方法还包括: PC侧向 终端侧发送配对请求, 并与终端侧完成配对过程。  8. The method according to claim 6, wherein the method further comprises: the PC side sends a pairing request to the terminal side, and completes the pairing process with the terminal side.
9、 如权利要求 8所述的方法, 其特征在于, 所述 PC侧向终端侧发送 配对请求, 并与终端侧完成配对过程为:  The method according to claim 8, wherein the PC side sends a pairing request to the terminal side, and completes the pairing process with the terminal side as:
PC侧通过 HCI命令向终端侧发送 Inquiry Scan命令;  The PC side sends an Inquiry Scan command to the terminal side through the HCI command.
PC侧接收终端侧返回的携带有虚拟蓝牙主机的 MAC地址的查询结果 The PC side receives the query result of the MAC address carrying the virtual Bluetooth host returned by the terminal side.
HCI ( Inquiry Result HCI ) 事件; HCI (INVEST Result HCI) event;
PC侧接收终端侧返回的查询完成 HCI ( Inquiry Complete HCI ) 事件。 The PC side receives the query returned by the terminal side to complete the HCI (Investigation Complete HCI) event.
10、 如权利要求 8所述的方法, 其特征在于, 该方法还包括: PC侧向 终端侧发送服务发现请求; PC侧接收终端侧返回的虚拟蓝牙主机支持的蓝 牙规范标识; PC侧根据蓝牙规范标识进行功能枚举。 The method according to claim 8, wherein the method further comprises: the PC side sends a service discovery request to the terminal side; the PC side receives the Bluetooth specification identifier supported by the virtual bluetooth host returned by the terminal side; and the PC side according to the Bluetooth side The specification identifier performs a function enumeration.
11、 一种终端设备, 其特征在于, 该终端设备包括: A terminal device, the terminal device comprising:
包括 USB接口的接口模块,用于通过 USB接口接收个人计算机 PC侧 发送的 USB设备枚举指令;  An interface module including a USB interface, configured to receive, by using a USB interface, a USB device enumeration instruction sent by a PC side of the personal computer;
虚拟蓝牙主机模块, 用于根据 USB设备枚举指令查询本地的设备描述 符和配置描述符, 其中, 设备描述符和配置描述符是依据蓝牙特征设置的; 以及, 指示接口模块通过 USB接口向 PC侧返回查询到的设备描述符和配 置描述符。  a virtual Bluetooth host module, configured to query a local device descriptor and a configuration descriptor according to the USB device enumeration instruction, where the device descriptor and the configuration descriptor are set according to the Bluetooth feature; and, the interface module is instructed to the PC through the USB interface The side returns the queried device descriptor and configuration descriptor.
12、 如权利要求 11所述的终端设备, 其特征在于, 所述接口模块通过 USB接口接收 PC侧发送的 USB类型的 USB设备枚举指令;  The terminal device according to claim 11, wherein the interface module receives a USB type USB device enumeration command sent by the PC side through the USB interface;
所述终端设备还包括: 虚拟蓝牙控制器模块, 用于依据蓝牙协议返回 蓝牙控制器类 USB设备的枚举数据; 以及,依据 USB协议将查询到的蓝牙 类型的设备描述符和配置描述符转换为 USB类型的设备描述符和配置描述 付;  The terminal device further includes: a virtual bluetooth controller module, configured to return the enumerated data of the Bluetooth controller class USB device according to the Bluetooth protocol; and convert the queried Bluetooth type device descriptor and the configuration descriptor according to the USB protocol Pay for USB type device descriptors and configuration descriptions;
所述接口模块还用于通过 USB接口向 PC侧返回 USB类型的设备描述 符和配置描述符。  The interface module is further configured to return a USB type device descriptor and a configuration descriptor to the PC side through the USB interface.
13、 如权利要求 11所述的终端设备, 其特征在于, 所述接口模块还用 于接收 PC侧发送的配对请求, 并与 PC侧完成配对过程。  The terminal device according to claim 11, wherein the interface module is further configured to receive a pairing request sent by the PC side, and complete a pairing process with the PC side.
14、 如权利要求 13所述的终端设备, 其特征在于, 所述接口模块通过 HCI命令接收 PC侧发送的查询扫描 Inquiry Scan命令; 向 PC侧返回携带 有虚拟蓝牙主机的媒体接入控制 MAC地址的查询结果 HCI事件;向 PC侧 返回查询完成 HCI事件。  The terminal device according to claim 13, wherein the interface module receives an inquiry scan Inquiry Scan command sent by the PC side through an HCI command, and returns a media access control MAC address carrying the virtual bluetooth host to the PC side. The query results in the HCI event; returning the query to the PC side to complete the HCI event.
15、 如权利要求 13所述的终端设备, 其特征在于, 所述接口模块还用 于接收 PC侧发送的服务发现请求,并返回虚拟蓝牙主机支持的蓝牙规范标 识。  The terminal device according to claim 13, wherein the interface module is further configured to receive a service discovery request sent by the PC side, and return a Bluetooth specification identifier supported by the virtual bluetooth host.
16、 一种计算机设备, 其特征在于, 该计算机设备包括: 接口模块,用于向终端侧发送 USB设备枚举指令; 以及接收 USB设备 返回的设备描述符和配置描述符; 16. A computer device, characterized in that the computer device comprises: An interface module, configured to send a USB device enumeration instruction to the terminal side; and receive a device descriptor and a configuration descriptor returned by the USB device;
蓝牙控制模块, 用于通过设备描述符和配置描述符对虚拟蓝牙控制器 进行枚举和识别。  A Bluetooth control module for enumerating and identifying virtual Bluetooth controllers through device descriptors and configuration descriptors.
17、 如权利要求 16所述的计算机设备, 其特征在于, 所述接口模块包 括 USB接口, 通过 USB接口向终端侧发送 USB设备枚举指令; 以及, 通 过 USB接口接收 USB设备返回的设备描述符和配置描述符;  The computer device according to claim 16, wherein the interface module comprises a USB interface, and the USB device enumeration instruction is sent to the terminal side through the USB interface; and the device descriptor returned by the USB device is received through the USB interface. And configuration descriptors;
所述蓝牙控制模块通过解析设备描述符和配置描述符获知终端侧为蓝 牙设备, 并对虚拟蓝牙控制器进行枚举和识别。  The Bluetooth control module learns that the terminal side is a Bluetooth device by parsing the device descriptor and the configuration descriptor, and enumerates and identifies the virtual Bluetooth controller.
18、 如权利要求 16所述的计算机设备, 其特征在于, 所述接口模块还 用于向终端侧发送配对请求, 并与终端侧完成配对过程。  The computer device according to claim 16, wherein the interface module is further configured to send a pairing request to the terminal side, and complete the pairing process with the terminal side.
19、 如权利要求 18所述的计算机设备, 其特征在于, 所述接口模块通 过 HCI命令向终端侧发送 Inquiry Scan命令;接收终端侧返回的携带有虚拟 蓝牙主机的 MAC地址的 Inquiry Result HCI事件;接收终端侧返回的 Inquiry Complete HCI事件。  The computer device according to claim 18, wherein the interface module sends an Inquiry Scan command to the terminal side through an HCI command; and receives an Inquiry Result HCI event that carries a MAC address of the virtual Bluetooth host returned by the terminal side; Receives the Inquiry Complete HCI event returned by the terminal side.
20、 如权利要求 18所述的计算机设备, 其特征在于, 所述接口模块还 用于向终端侧发送服务发现请求; 接收终端侧返回的虚拟蓝牙主机支持的 蓝牙规范标识;  The computer device according to claim 18, wherein the interface module is further configured to send a service discovery request to the terminal side; and receive a Bluetooth specification identifier supported by the virtual bluetooth host returned by the terminal side;
蓝牙控制模块还用于根据 DUN, 串口和 PAN功能标识进行功能枚举。  The Bluetooth Control Module is also used to enumerate functions based on DUN, serial port and PAN function identification.
PCT/CN2011/075829 2011-04-01 2011-06-16 Method and apparatus for simulating universal serial bus device WO2012129848A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110082228.6A CN102737003B (en) 2011-04-01 2011-04-01 A kind of method and device of simulating USB device
CN201110082228.6 2011-04-01

Publications (1)

Publication Number Publication Date
WO2012129848A1 true WO2012129848A1 (en) 2012-10-04

Family

ID=46929367

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/075829 WO2012129848A1 (en) 2011-04-01 2011-06-16 Method and apparatus for simulating universal serial bus device

Country Status (2)

Country Link
CN (1) CN102737003B (en)
WO (1) WO2012129848A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281542B (en) * 2014-09-26 2017-12-05 中兴通讯股份有限公司 Adaptation method, the apparatus and system of Multifunctional USB terminal device
CN106452838A (en) * 2016-08-31 2017-02-22 广州视睿电子科技有限公司 USB (Universal Serial Bus) equipment simulation device and method
CN108337209B (en) * 2017-01-19 2021-05-04 深圳兆日科技股份有限公司 Security authentication method and device and corresponding mobile terminal
CN111147476B (en) * 2019-12-23 2022-04-29 上海乐普云智科技股份有限公司 Data analysis method
CN114218138A (en) * 2021-11-30 2022-03-22 山东云海国创云计算装备产业创新中心有限公司 USB equipment simulation device and test system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030041205A1 (en) * 2001-07-13 2003-02-27 Wen-Jen Wu USB compound device and the method for implementation thereof
CN101004660A (en) * 2006-11-30 2007-07-25 北京飞天诚信科技有限公司 Method for realizing USB compound device
CN200947207Y (en) * 2006-05-11 2007-09-12 北京飞天诚信科技有限公司 Combined USB concentrator equipment
CN101170451A (en) * 2007-12-03 2008-04-30 华为技术有限公司 A device management method and a device proxy system
CN201490492U (en) * 2009-08-10 2010-05-26 上海通用汽车有限公司 Vehicle data transmission device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030041205A1 (en) * 2001-07-13 2003-02-27 Wen-Jen Wu USB compound device and the method for implementation thereof
CN200947207Y (en) * 2006-05-11 2007-09-12 北京飞天诚信科技有限公司 Combined USB concentrator equipment
CN101004660A (en) * 2006-11-30 2007-07-25 北京飞天诚信科技有限公司 Method for realizing USB compound device
CN101170451A (en) * 2007-12-03 2008-04-30 华为技术有限公司 A device management method and a device proxy system
CN201490492U (en) * 2009-08-10 2010-05-26 上海通用汽车有限公司 Vehicle data transmission device

Also Published As

Publication number Publication date
CN102737003A (en) 2012-10-17
CN102737003B (en) 2015-09-16

Similar Documents

Publication Publication Date Title
US8401588B2 (en) Dual mode human interface device
JP5529080B2 (en) Method and system enabling multiple virtual machines to individually configure and access physical resources
US8856290B2 (en) Method and apparatus for exchanging configuration information in a wireless local area network
KR100960835B1 (en) Device interface architecture and protocol
JP3805725B2 (en) Gateway, home network system, and message passing method enabling message passing between devices on home network using different middleware
US20060068760A1 (en) System and method for pairing dual mode wired/wireless devices
EP1553746A1 (en) Configuring network settings of thin client devices using portable storage media
CN101882116A (en) Method for realizing audio transmission and mobile terminal
TW200821857A (en) Dynamic power cycling
WO2012129848A1 (en) Method and apparatus for simulating universal serial bus device
KR101996896B1 (en) Method for sharing resource using a virtual device driver and electronic device thereof
WO2014169633A1 (en) Method for establishing wireless local area network by mobile terminal, and mobile terminal
JP2013512516A (en) Method and apparatus for correcting USB device drive and matching information
WO2013135000A1 (en) Dual-protocol-stack access method and system
WO2020181486A1 (en) Information processing method, apparatus, and system
WO2012174917A1 (en) Data card and activation method thereof
CN105391719A (en) Intelligent equipment remote control system based on TCP/IP network and interaction method thereof
WO2016150267A1 (en) Method for actively connecting to and communicating with apple device and apple device attachment
WO2014127619A1 (en) Method and system for supporting access of different types of sensors
WO2011097843A1 (en) Smart card authentication device and method
JP5698366B2 (en) Control method, apparatus, and system
TWI484806B (en) Data transmission method, data reception method, and non-transitory machine readable medium
EP2670107B1 (en) Communication method for wireless terminal and host device, and wireless terminal and host device
WO2014169589A1 (en) Intelligent terminal synchronous operation method and device
JP6665190B2 (en) Network sharing implementation method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11862287

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11862287

Country of ref document: EP

Kind code of ref document: A1