WO2017132864A1 - Method and system for usb host-client mode switching of vr device - Google Patents

Method and system for usb host-client mode switching of vr device Download PDF

Info

Publication number
WO2017132864A1
WO2017132864A1 PCT/CN2016/073307 CN2016073307W WO2017132864A1 WO 2017132864 A1 WO2017132864 A1 WO 2017132864A1 CN 2016073307 W CN2016073307 W CN 2016073307W WO 2017132864 A1 WO2017132864 A1 WO 2017132864A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
slave
usb
master
bus
Prior art date
Application number
PCT/CN2016/073307
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 深圳多哚新技术有限责任公司
Priority to PCT/CN2016/073307 priority Critical patent/WO2017132864A1/en
Publication of WO2017132864A1 publication Critical patent/WO2017132864A1/en

Links

Images

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

Definitions

  • the present invention relates to the field of VR, and in particular, to a USB master-slave switching method and system for a VR device.
  • VR Virtual Reality
  • VR can communicate with the USB interface of the mobile phone through the USB interface, and the VR and the mobile phone can charge each other.
  • the mobile phone acts as a slave
  • the VR acts as a host
  • the mobile phone requires a specific usb protocol, so that the mobile phone and the VR can both communicate and charge, and realize the USB master-slave mode switching.
  • the communication and charging of the mobile phone and the VR are greatly limited, and the use and promotion of the VR are also restricted.
  • an object of the present invention is to provide a USB master-slave switching method for a VR device, including: a VR device and an electronic device;
  • the VR device determines its own state of charging the electronic device, the VR device acts as a host to perform master-slave switching with the electronic device through the HNP protocol;
  • the VR device After the master-slave switchover, when the electronic device starts enumerating the external device, the VR device reports that it is an external device that is standard human-computer interaction.
  • the master/slave switch between the VR device and the electronic device by using the HNP protocol as the host includes:
  • a VR device When a VR device communicates with an electronic device as a host, the VR device communicates with the HNP protocol.
  • the electronic device performs master-slave switching.
  • the VR device determines that charging the electronic device by itself comprises:
  • the detecting electronic device does not supply power to itself, and the VR device turns on the power supply capability;
  • the VR device When performing master-slave switching, the VR device sends a HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and after receiving the HNP enable descriptor, the electronic device returns an ACK, and after receiving the reply, the VR device suspends the bus. ;
  • the electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state
  • the VR device detects a low state on the bus, the VR device is pulled up, the level state is a high level, the VR device is connected to the electronic device, and the VR device becomes a USB slave;
  • the electronic device When the electronic device detects that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to use the bus;
  • the electronic device re-enumerates the VR device, the VR device acts as the slave device, the enumeration electronic device supports the standard protocol, completes the master-slave switchover, the VR device switches to the slave device, the electronic device switches to the host device, and the protocol supported by the electronic device is used to make the VR The device supplies power to the electronic device.
  • the electronic device functions as a master, and the VR device functions as a slave.
  • the electronic device sends a HNP enable descriptor to the VR device, indicating that the electronic device supports the HNP protocol, and the VR device receives the HNP.
  • the ACK is returned, and the electronic device suspends the bus after receiving the reply;
  • the VR device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state
  • the electronic device detects a low level state on the bus, the electronic device is pulled up, the level state is a high level, the electronic device is connected to the VR device, and the electronic device becomes a USB slave device;
  • the VR device When the VR device detects the connection of the electronic device, the VR device becomes a USB host, and sends a bus reset signal to use the bus;
  • the VR device re-enumerates the electronic device, the electronic device acts as a slave, enumerates the VR device to support the standard protocol, completes the master-slave switchover, switches the electronic device to the slave device, switches the VR device to the host, and uses the protocol supported by the VR device to make the electronic The device supplies power to the VR device.
  • the USB interface of the VR device when the USB interface of the VR device is not inserted into the connection line, the USB interface of the VR device is in a pull-up state by default, and the level state is a high level.
  • the USB interface When the VR device is a host, the USB interface is down. Pulled to ground, the level state is 0; when the VR device is a slave, the USB interface will maintain the pull-up and the level state is high.
  • the USB interface of the electronic device when the USB interface of the electronic device is not inserted into the connection line, the USB interface of the electronic device is in a pull-up state by default, and the level state is a high level.
  • the USB interface When the electronic device is the host, the USB interface is pulled down to the ground, and the level state is 0.
  • the USB interface When the electronic device is a slave, the USB interface will maintain the pull-up and the level is high.
  • the VR device switches to the slave device, and the electronic device switches to the host device.
  • the VR device powers the electronic device by using the protocol supported by the electronic device, if the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored.
  • the default state is in the pull-up state and the level state is high.
  • the electronic device is switched to the slave device, the VR device is switched to the host, and the protocol supported by the VR device is used to enable the electronic device to supply power to the VR device. If the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored.
  • the default state is in the pull-up state and the level state is high.
  • a VR device USB master-slave switching system includes: a VR device and an electronic device; the VR device includes: a VR device USB interface, and the electronic device includes: an electronic device USB interface;
  • the VR device further includes: a USB main control module, a USB slave control module, a master-slave switching control module, an instruction sending module, an instruction receiving module, and a detecting module;
  • the USB main control module is configured to control a VR device as a host
  • the USB slave control module is configured to control the VR device as a slave
  • the instruction sending module is configured to send a HNP enable descriptor to the electronic device
  • the instruction receiving module is configured to receive data information sent by an electronic device
  • the detecting module is configured to detect a state of the electronic device bus and detect a state of the bus low level
  • the VR device When the master-slave switching control module is used for master-slave switching of the VR device as the host, the VR device sends the HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and the electronic device receives the HNP enable descriptor and then replies ACK, after receiving the reply, the VR device suspends the bus; the electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state; the VR device detects a low state on the bus, VR The device is pulled up, the level state is high level, and the VR device is connected with the electronic device.
  • the VR device becomes a USB slave device;
  • the electronic device becomes a USB host, and sends a bus reset signal to start using the bus.
  • the electronic device starts to re-enumerate the VR device, and the master-slave switching control module makes the VR device act as a slave; otherwise, the VR device acts as a slave.
  • the master-slave switching control module makes the VR device act as the master.
  • the VR device adopts a HID protocol, a HNP protocol, and an OTG protocol;
  • the electronic device adopts the HID protocol, the HNP protocol, and the OTG protocol.
  • the present invention has the following advantages:
  • the VR device supports the HID protocol, the HNP protocol, and the OTG protocol.
  • the electronic device supports the HID protocol, the HNP protocol, and the OTG protocol, and implements the functions of communication and charging between the VR device and the electronic device, and provides a complete switching method and expands the VR device.
  • the function allows the VR device to be a master and a slave, avoiding the VR device having a single function.
  • FIG. 1 is a flow chart of a method for switching a VR device USB by a host switching slave
  • FIG. 2 is a flow chart of a method for switching a VR device USB by a slave to switch a host
  • FIG. 3 is a schematic diagram of a VR device USB master-slave switching system.
  • the embodiment provides a USB master-slave switching method for a VR device, including: a VR device and an electronic device;
  • the VR device determines its own state of charging the electronic device, the VR device acts as a host to perform master-slave switching with the electronic device through the HNP protocol;
  • the VR device After the master-slave switchover, when the electronic device starts enumerating the external device, the VR device reports that it is an external device that is standard human-computer interaction.
  • the VR device acting as a host to perform master-slave switching with the electronic device through the HNP protocol includes:
  • the VR device When the VR device communicates with the electronic device as the host, the VR device performs master-slave switching with the electronic device through the HNP protocol.
  • the VR device In the data communication state of the VR device and the electronic device, the VR device can charge the electronic device through the ID pin, and the electronic device can also charge the VR device through the VR device ID pin.
  • the function of mutual charging can also be realized.
  • the specific manner of switching the USB master-slave of the VR device is a switching method of the VR device USB by the host switching slave and a switching method of the VR device USB switching the host by the slave;
  • the switching method of the VR device USB by the host switching slave is:
  • the VR device acts as the master before the master-slave switchover, and the electronic device acts as the slave.
  • the VR device sends the HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol.
  • the electronic device replies with an ACK (Acknowledgement), that is, a confirmation character, in the data communication, a transmission type control character sent by the receiving station to the transmitting station. It indicates that the sent data has been confirmed to be received correctly, and the VR device suspends the bus after receiving the reply;
  • ACK Acknowledgement
  • S3 The electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
  • the VR device detects a low state on the bus, the VR device is pulled up, the level state is a high level, and the VR device is connected to the electronic device, and the VR device becomes a USB slave at this time;
  • the electronic device starts to re-enumerate the VR device, the VR device acts as a slave, enumerates the electronic device to support the standard protocol, completes the master-slave switchover, the VR device switches to the slave device, the electronic device switches to the host, and the protocol supported by the electronic device is adopted. To enable VR devices to supply power to electronic devices.
  • the HNP enable descriptor in the present invention is called a SetFeature b_hnp_enable descriptor.
  • the switching method of the VR device USB by the slave switching host is:
  • the electronic device acts as the master, and the VR device acts as the slave.
  • the electronic device sends the HNP enable descriptor to the VR device, indicating that the electronic device supports the HNP protocol, and the VR device receives the HNP.
  • the ACK is returned, and the electronic device suspends the bus after receiving the reply;
  • the VR device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
  • the electronic device detects a low level state on the bus, the electronic device is pulled up, the level state is a high level, and the electronic device is connected with the VR device, and the electronic device becomes a USB slave device;
  • the VR device starts to re-enumerate the electronic device, and the electronic device acts as a slave device, enumerates the VR device to support the standard protocol, completes the master-slave switchover, switches the electronic device to the slave device, switches the VR device to the host, and adopts a protocol supported by the VR device. To enable the electronic device to supply power to the VR device.
  • the VR device supports the HID protocol, the HNP protocol, and the OTG protocol.
  • the electronic device supports the HID protocol, the HNP protocol, and the OTG protocol, and implements the function of communication and charging between the VR device and the electronic device, and the embodiment provides a perfect switching method, and expands the function of the VR device, so that the VR device can do
  • the host can also be a slave to avoid the VR device function.
  • the VR device transmits the USB end-to-end interconnection with the electronic device, breaking through the mode that can only be dominated by the electronic device, and the VR device is more abundant. Due to the high speed, flexibility and scalability of the USB bus, VR devices are widely used in various fields.
  • the electronic device includes: an electronic device such as a mobile phone, a computer, a tablet, a smart terminal, and the like.
  • the USB interface of the VR device when the USB interface of the VR device is not inserted into the connection line, the USB interface of the VR device is in a pull-up state by default, and the level state is a high level.
  • the VR device When the VR device is the host, the USB interface is pulled down to the ground, and the level state is 0; when the VR device is a slave, the USB interface will maintain the pull-up and the level is high.
  • the USB interface of the electronic device when the USB interface of the electronic device is not inserted into the connection line, the USB interface of the electronic device is in a pull-up state by default, and the level state is a high level.
  • the USB interface When the electronic device is a host, the USB interface Will pull down to the ground, the level state is 0; when the electronic device is a slave, the USB interface will maintain the pull-up, the level state is high.
  • the VR device switches to the slave device, and the electronic device switches to the host device, and when the VR device supplies power to the electronic device by using the protocol supported by the electronic device, if the USB interface of the VR device is disconnected from the electronic device, the VR device USB The interface is restored to the default state, in the pull-up state, and the level state is high.
  • the VR device When the electronic device is switched to the slave device, the VR device is switched to the host, and the protocol supported by the VR device is used to enable the electronic device to supply power to the VR device. If the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored to the default state. In the pull-up state, the level state is high.
  • the present invention also provides a VR device USB master-slave switching system, as shown in FIG. 3, including: VR device 10 and electronic device 13; VR device 10 includes: VR device USB interface 11, electronic device 13 includes: electronic device USB interface 12;
  • the VR device 10 further includes: a USB main control module 1, a USB slave control module 2, a master-slave switching control module 3, an instruction sending module 4, an instruction receiving module 5, and a detecting module 6;
  • the USB main control module 1 is used to control the VR device as a host;
  • the USB slave control module 2 is used to control the VR device as a slave
  • the instruction sending module 4 is configured to send a HNP enable descriptor to the electronic device
  • the instruction receiving module 5 is configured to receive data information sent by the electronic device
  • the detecting module 6 is configured to detect a state of the electronic device bus and detect a state of the bus low level;
  • the VR device 10 When the master-slave switching control module 3 is used for the master/slave switchover of the VR device 10 as the master, the VR device 10 sends the HNP enable descriptor to the electronic device 13, indicating that the VR device 10 supports the HNP protocol, and the electronic device 13 receives the HNP enable description. After the ACK, the VR device 10 receives the reply and suspends the bus; the electronic device 13 detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state; the VR device 10 detects on the bus.
  • the VR device 10 In the low state, the VR device 10 is pulled up, the level state is high level, the VR device 10 is connected to the electronic device 13, and the VR device 10 becomes a USB slave device; when the electronic device 13 detects that the VR device 10 is connected, The electronic device 13 becomes a USB host, and sends a bus reset signal to start using the bus, the electronic device 13 starts to re-enumerate the VR device 10, and the master-slave switching control module makes the VR device 10 as a slave; otherwise, the VR device 10 acts as a slave.
  • the master-slave switching control module causes the VR device 10 to function as a host.
  • the VR device 10 adopts the HID protocol, the HNP protocol, and the OTG protocol; the electronic device 13 adopts the HID protocol, the HNP protocol, and the OTG protocol.
  • the USB master-slave switching system of the VR device realizes that the USB interface can work in the master device mode and the slave device mode as needed, which not only facilitates the user but also performs data exchange through the USB interface. Provide a more convenient and fast way.

Landscapes

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

Abstract

A method for USB host-client mode switching of a VR device. The method comprises: a VR device sends an HNP-enabled descriptor to an electronic device to indicate that the VR device supports the HNP, the electronic device receives the HNP-enabled descriptor and then responds with ACK, and the VR device suspends a bus upon receiving of the response (S11); the electronic device disconnects the connection and initiates the HNP, and the bus is discharged to be in a low voltage level state (S12); the VR device performs a pull-up operation such that the voltage level state becomes a high voltage level, and the VR device connects to the electronic device, wherein the VR device becomes a USB client (S13); when the electronic device detects the connection of the VR device, the electronic device becomes a USB host, and sends a bus reset signal to start using the bus (S14); and the electronic device starts to re-enumerate the VR device (S15). The present invention enables communication and charging functions between a VR device and an electronic device, and provides the comprehensive switching method to broaden functionality of a VR device, enabling a VR device to act as a host or a client.

Description

一种VR设备USB主从切换方法以及***USB master-slave switching method and system for VR device 技术领域Technical field
本发明涉及VR领域,尤其涉及一种VR设备USB主从切换方法以及***。The present invention relates to the field of VR, and in particular, to a USB master-slave switching method and system for a VR device.
背景技术Background technique
众所周知,目前,不少电子装置通过USB接口和不同外部电子设备进行连接以交换数据时,需要根据所接入的外部电子装置的类型选择工作在主设备模式或从设备模式状态。As is well known, at present, when many electronic devices are connected through a USB interface and different external electronic devices to exchange data, it is necessary to select whether to operate in the master device mode or the slave device mode state according to the type of the external electronic device that is accessed.
在VR(Virtual Reality,即虚拟现实,简称VR)领域,VR能通过USB接口与手机USB接口通信,并且VR与手机可以相互充电。但是,在手机被VR设备充电时,手机作为从机,VR作为主机,手机要求有特定的usb协议,才能使手机与VR既通信又能充电的功能,并实现USB的主从设备模式切换,这样使手机与VR的通信和充电受到了很大的局限性,也制约了VR的使用和推广。In the field of VR (Virtual Reality, VR for short), VR can communicate with the USB interface of the mobile phone through the USB interface, and the VR and the mobile phone can charge each other. However, when the mobile phone is charged by the VR device, the mobile phone acts as a slave, the VR acts as a host, and the mobile phone requires a specific usb protocol, so that the mobile phone and the VR can both communicate and charge, and realize the USB master-slave mode switching. In this way, the communication and charging of the mobile phone and the VR are greatly limited, and the use and promotion of the VR are also restricted.
发明内容Summary of the invention
为了克服上述现有技术中的不足,本发明的目的在于,提供一种VR设备USB主从切换方法,包括:VR设备和电子设备;In order to overcome the above deficiencies in the prior art, an object of the present invention is to provide a USB master-slave switching method for a VR device, including: a VR device and an electronic device;
VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换;When the VR device determines its own state of charging the electronic device, the VR device acts as a host to perform master-slave switching with the electronic device through the HNP protocol;
进行主从切换后,电子设备开始枚举外部设备时,VR设备报告其自身是标准人机交互的外部设备。After the master-slave switchover, when the electronic device starts enumerating the external device, the VR device reports that it is an external device that is standard human-computer interaction.
优选地,VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换具体包括:Preferably, when the VR device determines the state of charging the electronic device by itself, the master/slave switch between the VR device and the electronic device by using the HNP protocol as the host includes:
根据检测VR设备ID引脚不同的电平,判断VR设备ID引脚和电子设备ID引脚的电平,根据电平来确定供电主体;Determining the level of the VR device ID pin and the electronic device ID pin according to detecting different levels of the VR device ID pin, and determining the power supply body according to the level;
根据检测VR设备AD口不同的电平,判断VR设备AD口和电子设备AD口的电位差大小,根据电位差大小确定供电主体;According to detecting different levels of the AD port of the VR device, determining the potential difference between the AD port of the VR device and the AD port of the electronic device, and determining the power supply body according to the magnitude of the potential difference;
VR设备作为主机与电子设备进行通信时,VR设备通过HNP协议与 电子设备进行主从切换。When a VR device communicates with an electronic device as a host, the VR device communicates with the HNP protocol. The electronic device performs master-slave switching.
优选地,VR设备确定自身给所述电子设备进行充电具体包括:Preferably, the VR device determines that charging the electronic device by itself comprises:
检测电子设备未给自身供电,VR设备打开供电能力;The detecting electronic device does not supply power to itself, and the VR device turns on the power supply capability;
当进行主从切换时,VR设备发送HNP使能描述符给电子设备,表示VR设备支持HNP协议,电子设备收到HNP使能描述符后,回复ACK,VR设备接到回复后,挂起总线;When performing master-slave switching, the VR device sends a HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and after receiving the HNP enable descriptor, the electronic device returns an ACK, and after receiving the reply, the VR device suspends the bus. ;
电子设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;The electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
VR设备在总线上检测到低电平状态,VR设备上拉,电平状态为高电平,VR设备与电子设备连接,VR设备成为USB从机;The VR device detects a low state on the bus, the VR device is pulled up, the level state is a high level, the VR device is connected to the electronic device, and the VR device becomes a USB slave;
电子设备检测到VR设备连接时,电子设备成为USB主机,并发送总线复位信号使用总线;When the electronic device detects that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to use the bus;
电子设备重新枚举VR设备,VR设备作为从机,枚举电子设备支持标准协议,完成主从切换,VR设备切换到从机,电子设备切换到主机,且采用电子设备支持的协议,使VR设备给电子设备供电。The electronic device re-enumerates the VR device, the VR device acts as the slave device, the enumeration electronic device supports the standard protocol, completes the master-slave switchover, the VR device switches to the slave device, the electronic device switches to the host device, and the protocol supported by the electronic device is used to make the VR The device supplies power to the electronic device.
优选地,进行主从切换前电子设备作为主机,VR设备作为从机,当进行主从切换时,电子设备发送HNP使能描述符给VR设备,表示电子设备支持HNP协议,VR设备收到HNP使能描述符后,回复ACK,电子设备接到回复后,挂起总线;Preferably, before the master-slave switchover, the electronic device functions as a master, and the VR device functions as a slave. When the master-slave switchover is performed, the electronic device sends a HNP enable descriptor to the VR device, indicating that the electronic device supports the HNP protocol, and the VR device receives the HNP. After the descriptor is enabled, the ACK is returned, and the electronic device suspends the bus after receiving the reply;
VR设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;The VR device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
电子设备在总线上检测到低电平状态,电子设备上拉,电平状态为高电平,电子设备与VR设备连接,电子设备成为USB从机;The electronic device detects a low level state on the bus, the electronic device is pulled up, the level state is a high level, the electronic device is connected to the VR device, and the electronic device becomes a USB slave device;
VR设备检测到电子设备连接时,VR设备成为USB主机,并发送总线复位信号使用总线;When the VR device detects the connection of the electronic device, the VR device becomes a USB host, and sends a bus reset signal to use the bus;
VR设备重新枚举电子设备,电子设备作为从机,枚举VR设备支持标准协议,完成主从切换,电子设备切换到从机,VR设备切换到主机,且采用VR设备支持的协议,使电子设备给VR设备供电。The VR device re-enumerates the electronic device, the electronic device acts as a slave, enumerates the VR device to support the standard protocol, completes the master-slave switchover, switches the electronic device to the slave device, switches the VR device to the host, and uses the protocol supported by the VR device to make the electronic The device supplies power to the VR device.
优选地,VR设备USB接口未***连接线时,VR设备USB接口默认处于上拉状态,电平状态为高电平,当VR设备做主机时,USB接口会下 拉到地,电平状态为0;当VR设备做从机时,USB接口会维持上拉,电平状态为高电平。Preferably, when the USB interface of the VR device is not inserted into the connection line, the USB interface of the VR device is in a pull-up state by default, and the level state is a high level. When the VR device is a host, the USB interface is down. Pulled to ground, the level state is 0; when the VR device is a slave, the USB interface will maintain the pull-up and the level state is high.
优选地,电子设备USB接口未***连接线时,电子设备USB接口默认处于上拉状态,电平状态为高电平,当电子设备做主机时,USB接口会下拉到地,电平状态为0;当电子设备做从机时,USB接口会维持上拉,电平状态为高电平。Preferably, when the USB interface of the electronic device is not inserted into the connection line, the USB interface of the electronic device is in a pull-up state by default, and the level state is a high level. When the electronic device is the host, the USB interface is pulled down to the ground, and the level state is 0. When the electronic device is a slave, the USB interface will maintain the pull-up and the level is high.
优选地,VR设备切换到从机,电子设备切换到主机,采用电子设备支持的协议,使VR设备给电子设备供电时,如果VR设备USB接口与电子设备断开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。Preferably, the VR device switches to the slave device, and the electronic device switches to the host device. When the VR device powers the electronic device by using the protocol supported by the electronic device, if the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored. The default state is in the pull-up state and the level state is high.
优选地,电子设备切换到从机,VR设备切换到主机,采用VR设备支持的协议,使电子设备给VR设备供电时,如果VR设备USB接口与电子设备断开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。Preferably, the electronic device is switched to the slave device, the VR device is switched to the host, and the protocol supported by the VR device is used to enable the electronic device to supply power to the VR device. If the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored. The default state is in the pull-up state and the level state is high.
一种VR设备USB主从切换***,包括:VR设备和电子设备;VR设备包括:VR设备USB接口,电子设备包括:电子设备USB接口;A VR device USB master-slave switching system includes: a VR device and an electronic device; the VR device includes: a VR device USB interface, and the electronic device includes: an electronic device USB interface;
VR设备还包括:USB主控制模块、USB从控制模块、主从切换控制模块、指令发送模块、指令接收模块、检测模块;The VR device further includes: a USB main control module, a USB slave control module, a master-slave switching control module, an instruction sending module, an instruction receiving module, and a detecting module;
所述USB主控制模块用于控制VR设备作为主机;The USB main control module is configured to control a VR device as a host;
所述USB从控制模块用于控制VR设备作为从机;The USB slave control module is configured to control the VR device as a slave;
所述指令发送模块用于向电子设备发送HNP使能描述符;The instruction sending module is configured to send a HNP enable descriptor to the electronic device;
所述指令接收模块用于接收电子设备发送的数据信息;The instruction receiving module is configured to receive data information sent by an electronic device;
所述检测模块用于检测电子设备总线的状态以及检测总线低电平的状态;The detecting module is configured to detect a state of the electronic device bus and detect a state of the bus low level;
所述主从切换控制模块用于VR设备作为主机进行主从切换时,VR设备发送HNP使能描述符给电子设备,表示VR设备支持HNP协议,电子设备收到HNP使能描述符后,回复ACK,VR设备接到回复后,挂起总线;电子设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;VR设备在总线上检测到低电平状态,VR设备上拉,电平状态为高电平,VR设备与电子设备连接,此时VR设备成为USB从机;电子设 备检测到VR设备连接时,电子设备成为USB主机,并发送总线复位信号开始使用总线,电子设备开始重新枚举VR设备,主从切换控制模块使VR设备的作为从机;反之,VR设备作为从机时,主从切换控制模块使VR设备的作为主机。When the master-slave switching control module is used for master-slave switching of the VR device as the host, the VR device sends the HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and the electronic device receives the HNP enable descriptor and then replies ACK, after receiving the reply, the VR device suspends the bus; the electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state; the VR device detects a low state on the bus, VR The device is pulled up, the level state is high level, and the VR device is connected with the electronic device. At this time, the VR device becomes a USB slave device; When detecting that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to start using the bus. The electronic device starts to re-enumerate the VR device, and the master-slave switching control module makes the VR device act as a slave; otherwise, the VR device acts as a slave. When the slave is in operation, the master-slave switching control module makes the VR device act as the master.
优选地,VR设备采用HID协议、HNP协议以及OTG协议;Preferably, the VR device adopts a HID protocol, a HNP protocol, and an OTG protocol;
电子设备采用HID协议、HNP协议以及OTG协议。The electronic device adopts the HID protocol, the HNP protocol, and the OTG protocol.
从以上技术方案可以看出,本发明具有以下优点:As can be seen from the above technical solutions, the present invention has the following advantages:
VR设备支持HID协议、HNP协议、OTG协议,电子设备支持HID协议、HNP协议、OTG协议,实现了VR设备与电子设备通信和充电的功能,并且提供了一个完善的切换方法,扩充了VR设备的功能,使VR设备即可做主机又可做从机,避免出现VR设备功能单一。The VR device supports the HID protocol, the HNP protocol, and the OTG protocol. The electronic device supports the HID protocol, the HNP protocol, and the OTG protocol, and implements the functions of communication and charging between the VR device and the electronic device, and provides a complete switching method and expands the VR device. The function allows the VR device to be a master and a slave, avoiding the VR device having a single function.
附图说明DRAWINGS
为了更清楚地说明本发明的技术方案,下面将对描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the present invention, the drawings used in the description will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, which are common to the prior art. For the personnel, other drawings can be obtained based on these drawings without paying creative labor.
图1为VR设备USB由主机切换从机的切换方法流程图;1 is a flow chart of a method for switching a VR device USB by a host switching slave;
图2为VR设备USB由从机切换主机的切换方法流程图;2 is a flow chart of a method for switching a VR device USB by a slave to switch a host;
图3为VR设备USB主从切换***的示意图。FIG. 3 is a schematic diagram of a VR device USB master-slave switching system.
具体实施方式detailed description
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将运用具体的实施例及附图,对本发明保护的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明一部分实施例,而非全部的实施例。基于本专利中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本专利保护的范围。In order to make the object, the features and the advantages of the present invention more obvious and easy to understand, the embodiments of the present invention will be clearly and completely described below using the specific embodiments and the accompanying drawings. The examples are only a part of the embodiments of the invention, but not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of this patent.
本实施例提供一种VR设备USB主从切换方法,包括:VR设备和电子设备;The embodiment provides a USB master-slave switching method for a VR device, including: a VR device and an electronic device;
VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换; When the VR device determines its own state of charging the electronic device, the VR device acts as a host to perform master-slave switching with the electronic device through the HNP protocol;
进行主从切换后,电子设备开始枚举外部设备时,VR设备报告其自身是标准人机交互的外部设备。After the master-slave switchover, when the electronic device starts enumerating the external device, the VR device reports that it is an external device that is standard human-computer interaction.
VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换具体包括:When the VR device determines its own state of charging the electronic device, the VR device acting as a host to perform master-slave switching with the electronic device through the HNP protocol includes:
根据检测VR设备ID引脚不同的电平,判断VR设备ID引脚和电子设备ID引脚的电平,根据电平来确定供电主体;Determining the level of the VR device ID pin and the electronic device ID pin according to detecting different levels of the VR device ID pin, and determining the power supply body according to the level;
VR设备作为主机与电子设备进行通信时,VR设备通过HNP协议与电子设备进行主从切换。When the VR device communicates with the electronic device as the host, the VR device performs master-slave switching with the electronic device through the HNP protocol.
VR设备和电子设备在数据通信状态下,VR设备可以通过ID引脚给电子设备充电,电子设备也可以通过VR设备ID引脚给VR设备充电。当然在非数据通信状态下,也可以实现相互充电的功能。In the data communication state of the VR device and the electronic device, the VR device can charge the electronic device through the ID pin, and the electronic device can also charge the VR device through the VR device ID pin. Of course, in the non-data communication state, the function of mutual charging can also be realized.
VR设备USB主从切换的具体方式为,VR设备USB由主机切换从机的切换方法和VR设备USB由从机切换主机的切换方法;The specific manner of switching the USB master-slave of the VR device is a switching method of the VR device USB by the host switching slave and a switching method of the VR device USB switching the host by the slave;
如图1所示,VR设备USB由主机切换从机的切换方法为:As shown in Figure 1, the switching method of the VR device USB by the host switching slave is:
S1:检测电子设备未给自身供电,VR设备打开供电能力;S1: detecting that the electronic device does not supply power to itself, and the VR device turns on the power supply capability;
S2:当进行主从切换时,进行主从切换前VR设备作为主机,电子设备作为从机,当进行主从切换时,VR设备发送HNP使能描述符给电子设备,表示VR设备支持HNP协议,电子设备收到HNP使能描述符后,回复ACK(Acknowledgement),即确认字符,在数据通信中,接收站发给发送站的一种传输类控制字符。表示发来的数据已确认接收无误,VR设备接到回复后,挂起总线;S2: When the master-slave switchover is performed, the VR device acts as the master before the master-slave switchover, and the electronic device acts as the slave. When the master-slave switchover is performed, the VR device sends the HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol. After receiving the HNP enable descriptor, the electronic device replies with an ACK (Acknowledgement), that is, a confirmation character, in the data communication, a transmission type control character sent by the receiving station to the transmitting station. It indicates that the sent data has been confirmed to be received correctly, and the VR device suspends the bus after receiving the reply;
S3:电子设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;S3: The electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
S4:VR设备在总线上检测到低电平状态,VR设备上拉,电平状态为高电平,VR设备与电子设备连接,此时VR设备成为USB从机;S4: The VR device detects a low state on the bus, the VR device is pulled up, the level state is a high level, and the VR device is connected to the electronic device, and the VR device becomes a USB slave at this time;
S5:电子设备检测到VR设备连接时,电子设备成为USB主机,并发送总线复位信号开始使用总线;S5: when the electronic device detects that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to start using the bus;
S6:电子设备开始重新枚举VR设备,VR设备作为从机,枚举电子设备支持标准协议,完成主从切换,VR设备切换到从机,电子设备切换到主机,且采用电子设备支持的协议,使VR设备给电子设备供电。 S6: The electronic device starts to re-enumerate the VR device, the VR device acts as a slave, enumerates the electronic device to support the standard protocol, completes the master-slave switchover, the VR device switches to the slave device, the electronic device switches to the host, and the protocol supported by the electronic device is adopted. To enable VR devices to supply power to electronic devices.
本发明中的HNP使能描述符全称为SetFeature b_hnp_enable描述符。The HNP enable descriptor in the present invention is called a SetFeature b_hnp_enable descriptor.
如图2所示,VR设备USB由从机切换主机的切换方法为:As shown in FIG. 2, the switching method of the VR device USB by the slave switching host is:
S11:进行主从切换前电子设备作为主机,VR设备作为从机,当进行主从切换时,电子设备发送HNP使能描述符给VR设备,表示电子设备支持HNP协议,VR设备收到HNP使能描述符后,回复ACK,电子设备接到回复后,挂起总线;S11: Before the master-slave switchover, the electronic device acts as the master, and the VR device acts as the slave. When the master-slave switchover is performed, the electronic device sends the HNP enable descriptor to the VR device, indicating that the electronic device supports the HNP protocol, and the VR device receives the HNP. After the descriptor can be returned, the ACK is returned, and the electronic device suspends the bus after receiving the reply;
S12:VR设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;S12: The VR device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
S13:电子设备在总线上检测到低电平状态,电子设备上拉,电平状态为高电平,电子设备与VR设备连接,此时电子设备成为USB从机;S13: the electronic device detects a low level state on the bus, the electronic device is pulled up, the level state is a high level, and the electronic device is connected with the VR device, and the electronic device becomes a USB slave device;
S14:VR设备检测到电子设备连接时,VR设备成为USB主机,并发送总线复位信号开始使用总线;S14: When the VR device detects the connection of the electronic device, the VR device becomes a USB host, and sends a bus reset signal to start using the bus;
S15:VR设备开始重新枚举电子设备,电子设备作为从机,枚举VR设备支持标准协议,完成主从切换,电子设备切换到从机,VR设备切换到主机,且采用VR设备支持的协议,使电子设备给VR设备供电。S15: The VR device starts to re-enumerate the electronic device, and the electronic device acts as a slave device, enumerates the VR device to support the standard protocol, completes the master-slave switchover, switches the electronic device to the slave device, switches the VR device to the host, and adopts a protocol supported by the VR device. To enable the electronic device to supply power to the VR device.
本实施例中,VR设备支持HID协议、HNP协议、OTG协议。电子设备支持HID协议、HNP协议、OTG协议,实现了VR设备与电子设备通信和充电的功能,并且本实施例提供了一个完善的切换方法,扩充了VR设备的功能,使VR设备即可做主机又可做从机,避免出现VR设备功能单一。VR设备通过与电子设备以USB端对端互联传输,突破了原来只能由电子设备为主框架的模式,使VR设备功能更为丰富。由于USB总线的高速性、灵活性和扩展性,使VR设备在各个领域得到广泛应用。In this embodiment, the VR device supports the HID protocol, the HNP protocol, and the OTG protocol. The electronic device supports the HID protocol, the HNP protocol, and the OTG protocol, and implements the function of communication and charging between the VR device and the electronic device, and the embodiment provides a perfect switching method, and expands the function of the VR device, so that the VR device can do The host can also be a slave to avoid the VR device function. The VR device transmits the USB end-to-end interconnection with the electronic device, breaking through the mode that can only be dominated by the electronic device, and the VR device is more abundant. Due to the high speed, flexibility and scalability of the USB bus, VR devices are widely used in various fields.
本实施例中,电子设备包括:手机、电脑、平板、智能终端等等电子设备。In this embodiment, the electronic device includes: an electronic device such as a mobile phone, a computer, a tablet, a smart terminal, and the like.
本实施例中,VR设备USB接口未***连接线时,VR设备USB接口默认处于上拉状态,电平状态为高电平,当VR设备做主机时,USB接口会下拉到地,电平状态为0;当VR设备做从机时,USB接口会维持上拉,电平状态为高电平。In this embodiment, when the USB interface of the VR device is not inserted into the connection line, the USB interface of the VR device is in a pull-up state by default, and the level state is a high level. When the VR device is the host, the USB interface is pulled down to the ground, and the level state is 0; when the VR device is a slave, the USB interface will maintain the pull-up and the level is high.
本实施例中,电子设备USB接口未***连接线时,电子设备USB接口默认处于上拉状态,电平状态为高电平,当电子设备做主机时,USB接口 会下拉到地,电平状态为0;当电子设备做从机时,USB接口会维持上拉,电平状态为高电平。In this embodiment, when the USB interface of the electronic device is not inserted into the connection line, the USB interface of the electronic device is in a pull-up state by default, and the level state is a high level. When the electronic device is a host, the USB interface Will pull down to the ground, the level state is 0; when the electronic device is a slave, the USB interface will maintain the pull-up, the level state is high.
本实施例中,VR设备切换到从机,电子设备切换到主机,采用电子设备支持的协议,使VR设备给电子设备供电时,如果VR设备USB接口与电子设备断开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。In this embodiment, the VR device switches to the slave device, and the electronic device switches to the host device, and when the VR device supplies power to the electronic device by using the protocol supported by the electronic device, if the USB interface of the VR device is disconnected from the electronic device, the VR device USB The interface is restored to the default state, in the pull-up state, and the level state is high.
电子设备切换到从机,VR设备切换到主机,采用VR设备支持的协议,使电子设备给VR设备供电时,如果VR设备USB接口与电子设备断开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。When the electronic device is switched to the slave device, the VR device is switched to the host, and the protocol supported by the VR device is used to enable the electronic device to supply power to the VR device. If the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored to the default state. In the pull-up state, the level state is high.
本发明还提供一种VR设备USB主从切换***,如图3所示,包括:VR设备10和电子设备13;VR设备10包括:VR设备USB接口11,电子设备13包括:电子设备USB接口12;The present invention also provides a VR device USB master-slave switching system, as shown in FIG. 3, including: VR device 10 and electronic device 13; VR device 10 includes: VR device USB interface 11, electronic device 13 includes: electronic device USB interface 12;
VR设备10还包括:USB主控制模块1、USB从控制模块2、主从切换控制模块3、指令发送模块4、指令接收模块5、检测模块6;The VR device 10 further includes: a USB main control module 1, a USB slave control module 2, a master-slave switching control module 3, an instruction sending module 4, an instruction receiving module 5, and a detecting module 6;
USB主控制模块1用于控制VR设备作为主机;The USB main control module 1 is used to control the VR device as a host;
USB从控制模块2用于控制VR设备作为从机;The USB slave control module 2 is used to control the VR device as a slave;
指令发送模块4用于向电子设备发送HNP使能描述符;The instruction sending module 4 is configured to send a HNP enable descriptor to the electronic device;
指令接收模块5用于接收电子设备发送的数据信息;The instruction receiving module 5 is configured to receive data information sent by the electronic device;
检测模块6用于检测电子设备总线的状态以及检测总线低电平的状态;The detecting module 6 is configured to detect a state of the electronic device bus and detect a state of the bus low level;
主从切换控制模块3用于VR设备10作为主机进行主从切换时,VR设备10发送HNP使能描述符给电子设备13,表示VR设备10支持HNP协议,电子设备13收到HNP使能描述符后,回复ACK,VR设备10接到回复后,挂起总线;电子设备13检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;VR设备10在总线上检测到低电平状态,VR设备10上拉,电平状态为高电平,VR设备10与电子设备13连接,此时VR设备10成为USB从机;电子设备13检测到VR设备10连接时,电子设备13成为USB主机,并发送总线复位信号开始使用总线,电子设备13开始重新枚举VR设备10,主从切换控制模块使VR设备10的作为从机;反之,VR设备10作为从机时,主从切换控制模块使VR设备10的作为主机。 When the master-slave switching control module 3 is used for the master/slave switchover of the VR device 10 as the master, the VR device 10 sends the HNP enable descriptor to the electronic device 13, indicating that the VR device 10 supports the HNP protocol, and the electronic device 13 receives the HNP enable description. After the ACK, the VR device 10 receives the reply and suspends the bus; the electronic device 13 detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state; the VR device 10 detects on the bus. In the low state, the VR device 10 is pulled up, the level state is high level, the VR device 10 is connected to the electronic device 13, and the VR device 10 becomes a USB slave device; when the electronic device 13 detects that the VR device 10 is connected, The electronic device 13 becomes a USB host, and sends a bus reset signal to start using the bus, the electronic device 13 starts to re-enumerate the VR device 10, and the master-slave switching control module makes the VR device 10 as a slave; otherwise, the VR device 10 acts as a slave. The master-slave switching control module causes the VR device 10 to function as a host.
VR设备10采用HID协议、HNP协议以及OTG协议;电子设备13采用HID协议、HNP协议以及OTG协议。The VR device 10 adopts the HID protocol, the HNP protocol, and the OTG protocol; the electronic device 13 adopts the HID protocol, the HNP protocol, and the OTG protocol.
本发明提供的VR设备USB主从切换***,实现了使USB接口根据需要既可以工作于主设备模式,又可以工作于从设备模式,不仅方便了使用者,同时在为通过USB接口进行数据交换提供了更方便、快捷的途径。The USB master-slave switching system of the VR device provided by the invention realizes that the USB interface can work in the master device mode and the slave device mode as needed, which not only facilitates the user but also performs data exchange through the USB interface. Provide a more convenient and fast way.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参考即可。The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments may be referred to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。 The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments are obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but the scope of the invention is to be accorded

Claims (10)

  1. 一种VR设备USB主从切换方法,其特征在于,包括:VR设备和电子设备;A USB master-slave switching method for a VR device, comprising: a VR device and an electronic device;
    VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换;When the VR device determines its own state of charging the electronic device, the VR device acts as a host to perform master-slave switching with the electronic device through the HNP protocol;
    进行主从切换后,电子设备开始枚举外部设备时,VR设备报告其自身是标准人机交互的外部设备。After the master-slave switchover, when the electronic device starts enumerating the external device, the VR device reports that it is an external device that is standard human-computer interaction.
  2. 根据权利要求1所述的VR设备USB主从切换方法,其特征在于,The USB master-slave switching method of a VR device according to claim 1, wherein
    VR设备确定自身给电子设备进行充电的状态时,VR设备作为主机通过HNP协议与电子设备进行主从切换具体包括:When the VR device determines its own state of charging the electronic device, the VR device acting as a host to perform master-slave switching with the electronic device through the HNP protocol includes:
    根据检测VR设备ID引脚不同的电平,判断VR设备ID引脚和电子设备ID引脚的电平,根据电平来确定供电主体;Determining the level of the VR device ID pin and the electronic device ID pin according to detecting different levels of the VR device ID pin, and determining the power supply body according to the level;
    VR设备作为主机与电子设备进行通信时,VR设备通过HNP协议与电子设备进行主从切换。When the VR device communicates with the electronic device as the host, the VR device performs master-slave switching with the electronic device through the HNP protocol.
  3. 根据权利要求2所述的VR设备USB主从切换方法,其特征在于,The USB master-slave switching method for a VR device according to claim 2, wherein
    VR设备确定自身给所述电子设备进行充电具体包括:The VR device determines that charging the electronic device itself includes:
    检测电子设备未给自身供电,VR设备打开供电能力;The detecting electronic device does not supply power to itself, and the VR device turns on the power supply capability;
    当进行主从切换时,VR设备发送HNP使能描述符给电子设备,表示VR设备支持HNP协议,电子设备收到HNP使能描述符后,回复ACK,VR设备接到回复后,挂起总线;When performing master-slave switching, the VR device sends a HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and after receiving the HNP enable descriptor, the electronic device returns an ACK, and after receiving the reply, the VR device suspends the bus. ;
    电子设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;The electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
    VR设备在总线上检测到低电平状态,VR设备上拉,电平状态为高电平,VR设备与电子设备连接,VR设备成为USB从机;The VR device detects a low state on the bus, the VR device is pulled up, the level state is a high level, the VR device is connected to the electronic device, and the VR device becomes a USB slave;
    电子设备检测到VR设备连接时,电子设备成为USB主机,并发送总线复位信号使用总线;When the electronic device detects that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to use the bus;
    电子设备重新枚举VR设备,VR设备作为从机,枚举电子设备支持标准协议,完成主从切换,VR设备切换到从机,电子设备切换到主机,且采用电子设备支持的协议,使VR设备给电子设备供电。The electronic device re-enumerates the VR device, the VR device acts as the slave device, the enumeration electronic device supports the standard protocol, completes the master-slave switchover, the VR device switches to the slave device, the electronic device switches to the host device, and the protocol supported by the electronic device is used to make the VR The device supplies power to the electronic device.
  4. 根据权利要求3所述的VR设备USB主从切换方法,其特征在于, 包括:The USB master-slave switching method for a VR device according to claim 3, wherein include:
    进行主从切换前电子设备作为主机,VR设备作为从机,当进行主从切换时,电子设备发送HNP使能描述符给VR设备,表示电子设备支持HNP协议,VR设备收到HNP使能描述符后,回复ACK,电子设备接到回复后,挂起总线;Before the master-slave switchover, the electronic device acts as the master, and the VR device acts as the slave. When the master-slave switchover is performed, the electronic device sends the HNP enable descriptor to the VR device, indicating that the electronic device supports the HNP protocol, and the VR device receives the HNP enable description. After the sign, reply ACK, the electronic device receives the reply, suspend the bus;
    VR设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;The VR device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state;
    电子设备在总线上检测到低电平状态,电子设备上拉,电平状态为高电平,电子设备与VR设备连接,电子设备成为USB从机;The electronic device detects a low level state on the bus, the electronic device is pulled up, the level state is a high level, the electronic device is connected to the VR device, and the electronic device becomes a USB slave device;
    VR设备检测到电子设备连接时,VR设备成为USB主机,并发送总线复位信号使用总线;When the VR device detects the connection of the electronic device, the VR device becomes a USB host, and sends a bus reset signal to use the bus;
    VR设备重新枚举电子设备,电子设备作为从机,枚举VR设备支持标准协议,完成主从切换,电子设备切换到从机,VR设备切换到主机,且采用VR设备支持的协议,使电子设备给VR设备供电。The VR device re-enumerates the electronic device, the electronic device acts as a slave, enumerates the VR device to support the standard protocol, completes the master-slave switchover, switches the electronic device to the slave device, switches the VR device to the host, and uses the protocol supported by the VR device to make the electronic The device supplies power to the VR device.
  5. 根据权利要求4所述的VR设备USB主从切换方法,其特征在于,包括:The USB master-slave switching method of the VR device according to claim 4, comprising:
    VR设备USB接口未***连接线时,VR设备USB接口默认处于上拉状态,电平状态为高电平,当VR设备做主机时,USB接口会下拉到地,电平状态为0;当VR设备做从机时,USB接口会维持上拉,电平状态为高电平。When the USB interface of the VR device is not plugged into the cable, the USB interface of the VR device is pulled up by default, and the level state is high. When the VR device is the host, the USB interface will be pulled down to the ground, and the level state is 0; when VR When the device is a slave, the USB interface will maintain the pull-up and the level is high.
  6. 根据权利要求4所述的VR设备USB主从切换方法,其特征在于,包括:The USB master-slave switching method of the VR device according to claim 4, comprising:
    电子设备USB接口未***连接线时,电子设备USB接口默认处于上拉状态,电平状态为高电平,当电子设备做主机时,USB接口会下拉到地,电平状态为0;当电子设备做从机时,USB接口会维持上拉,电平状态为高电平。When the USB interface of the electronic device is not plugged into the cable, the USB interface of the electronic device is in the pull-up state by default, and the level state is high. When the electronic device is the host, the USB interface will be pulled down to the ground, and the level state is 0; When the device is a slave, the USB interface will maintain the pull-up and the level is high.
  7. 根据权利要求4所述的VR设备USB主从切换方法,其特征在于,包括:The USB master-slave switching method of the VR device according to claim 4, comprising:
    VR设备切换到从机,电子设备切换到主机,采用电子设备支持的协议,使VR设备给电子设备供电时,如果VR设备USB接口与电子设备断 开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。The VR device switches to the slave device, and the electronic device switches to the host device. When the VR device supplies power to the electronic device, the VR device is disconnected from the USB device and the electronic device. When the connection is opened, the USB interface of the VR device is restored to the default state, in the pull-up state, and the level state is high.
  8. 根据权利要求4所述的VR设备USB主从切换方法,其特征在于,包括:The USB master-slave switching method of the VR device according to claim 4, comprising:
    电子设备切换到从机,VR设备切换到主机,采用VR设备支持的协议,使电子设备给VR设备供电时,如果VR设备USB接口与电子设备断开连接,则VR设备USB接口恢复默认状态,处于上拉状态,电平状态为高电平。When the electronic device is switched to the slave device, the VR device is switched to the host, and the protocol supported by the VR device is used to enable the electronic device to supply power to the VR device. If the USB interface of the VR device is disconnected from the electronic device, the USB interface of the VR device is restored to the default state. In the pull-up state, the level state is high.
  9. 一种VR设备USB主从切换***,其特征在于,包括:VR设备和电子设备;VR设备包括:VR设备USB接口,电子设备包括:电子设备USB接口;A VR device USB master-slave switching system, comprising: a VR device and an electronic device; the VR device comprises: a VR device USB interface, and the electronic device comprises: an electronic device USB interface;
    VR设备还包括:USB主控制模块、USB从控制模块、主从切换控制模块、指令发送模块、指令接收模块、检测模块;The VR device further includes: a USB main control module, a USB slave control module, a master-slave switching control module, an instruction sending module, an instruction receiving module, and a detecting module;
    所述USB主控制模块用于控制VR设备作为主机;The USB main control module is configured to control a VR device as a host;
    所述USB从控制模块用于控制VR设备作为从机;The USB slave control module is configured to control the VR device as a slave;
    所述指令发送模块用于向电子设备发送HNP使能描述符;The instruction sending module is configured to send a HNP enable descriptor to the electronic device;
    所述指令接收模块用于接收电子设备发送的数据信息;The instruction receiving module is configured to receive data information sent by an electronic device;
    所述检测模块用于检测电子设备总线的状态以及检测总线低电平的状态;The detecting module is configured to detect a state of the electronic device bus and detect a state of the bus low level;
    所述主从切换控制模块用于VR设备作为主机进行主从切换时,VR设备发送HNP使能描述符给电子设备,表示VR设备支持HNP协议,电子设备收到HNP使能描述符后,回复ACK,VR设备接到回复后,挂起总线;电子设备检测到总线挂起,并断开连接,启动HNP,总线放电为低电平状态;VR设备在总线上检测到低电平状态,VR设备上拉,电平状态为高电平,VR设备与电子设备连接,此时VR设备成为USB从机;电子设备检测到VR设备连接时,电子设备成为USB主机,并发送总线复位信号开始使用总线,电子设备开始重新枚举VR设备,主从切换控制模块使VR设备的作为从机;反之,VR设备作为从机时,主从切换控制模块使VR设备的作为主机。When the master-slave switching control module is used for master-slave switching of the VR device as the host, the VR device sends the HNP enable descriptor to the electronic device, indicating that the VR device supports the HNP protocol, and the electronic device receives the HNP enable descriptor and then replies ACK, after receiving the reply, the VR device suspends the bus; the electronic device detects that the bus is suspended, disconnects, starts HNP, and the bus discharges to a low state; the VR device detects a low state on the bus, VR The device is pulled up, the level state is high level, and the VR device is connected to the electronic device. At this time, the VR device becomes a USB slave device; when the electronic device detects that the VR device is connected, the electronic device becomes a USB host, and sends a bus reset signal to start using The bus, the electronic device begins to re-enumerate the VR device, and the master-slave switching control module makes the VR device act as the slave; otherwise, when the VR device acts as the slave, the master-slave switching control module makes the VR device act as the master.
  10. 根据权利要求9所述的VR设备USB主从切换***,其特征在于, 包括:A USB master-slave switching system for a VR device according to claim 9, wherein include:
    VR设备采用HID协议、HNP协议以及OTG协议;The VR device adopts the HID protocol, the HNP protocol, and the OTG protocol;
    电子设备采用HID协议、HNP协议以及OTG协议。 The electronic device adopts the HID protocol, the HNP protocol, and the OTG protocol.
PCT/CN2016/073307 2016-02-03 2016-02-03 Method and system for usb host-client mode switching of vr device WO2017132864A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/073307 WO2017132864A1 (en) 2016-02-03 2016-02-03 Method and system for usb host-client mode switching of vr device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/073307 WO2017132864A1 (en) 2016-02-03 2016-02-03 Method and system for usb host-client mode switching of vr device

Publications (1)

Publication Number Publication Date
WO2017132864A1 true WO2017132864A1 (en) 2017-08-10

Family

ID=59500975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073307 WO2017132864A1 (en) 2016-02-03 2016-02-03 Method and system for usb host-client mode switching of vr device

Country Status (1)

Country Link
WO (1) WO2017132864A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526930A (en) * 2008-10-13 2009-09-09 建荣集成电路科技(珠海)有限公司 USB interface master-slave machine detection device and detection method
CN103559149A (en) * 2013-10-30 2014-02-05 上海斐讯数据通信技术有限公司 Method and system for working mode switchover of universal serial bus on-the-go (USB OTG) dual-role devices
CN104850512A (en) * 2014-02-13 2015-08-19 珠海全志科技股份有限公司 Method and apparatus for implementing USB OTG function without ID pin

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526930A (en) * 2008-10-13 2009-09-09 建荣集成电路科技(珠海)有限公司 USB interface master-slave machine detection device and detection method
CN103559149A (en) * 2013-10-30 2014-02-05 上海斐讯数据通信技术有限公司 Method and system for working mode switchover of universal serial bus on-the-go (USB OTG) dual-role devices
CN104850512A (en) * 2014-02-13 2015-08-19 珠海全志科技股份有限公司 Method and apparatus for implementing USB OTG function without ID pin

Similar Documents

Publication Publication Date Title
EP3234788B1 (en) DATA TRANSMISSION USING PCIe PROTOCOL VIA USB PORT
TWI733752B (en) System and method for side band communication, and tangible, non-transitory, computer-readable medium
CN102591837B (en) USB (universal serial bus) (USB) is hung up and the enhancing of recovery operation
WO2013168289A1 (en) Electronic device and control method therefor
EP2879014B1 (en) Tablet interface extension method and device
US20180004277A1 (en) Information processing apparatus, information processing method, and recording medium on which computer-readable program is recorded
US9059906B1 (en) Data communication interface
US20080178011A1 (en) Method and apparatus for usb/otg connection providing active hnp requests and saving host power
CN110829523B (en) Electronic equipment and reverse charging method
US20160004287A1 (en) Portable electronic device and power management method thereof
CN107577621B (en) Information processing apparatus, information processing method, and recording medium
WO2015195968A1 (en) Tunneling in usb power delivery
US20150338881A1 (en) Mechanism for charging portable device with usb dock
WO2017049553A1 (en) Mobile terminal, power supply adapter, and upgrading method thereof
CN105760328B (en) A kind of VR equipment USB master-slave switching method and system
US10025351B2 (en) System for controlling peripherals connected to a docking station
CN107707000B (en) OTG power supply and wireless charging compatible circuit, related method and terminal equipment
JP2016015005A (en) Portable device, cable assembly, and usb system
CN108292153B (en) System events in Universal Serial Bus (USB) power delivery devices
CN106104504A (en) The system and method disconnecting detection on the double mode port of usb hub
CN202798652U (en) Signal conversion circuit and interface switching equipment
CN106774769B (en) Terminal working mode switching method and device and handheld terminal
CN212846570U (en) Type-C interface circuit and touch-control all-in-one
CN103559149A (en) Method and system for working mode switchover of universal serial bus on-the-go (USB OTG) dual-role devices
CN104899164B (en) Address addressing method for integrated circuit bus, integrated circuit bus device and system

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: 16888689

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: 16888689

Country of ref document: EP

Kind code of ref document: A1