Background technology
USB (universal serial bus) (USB, Universal Serial Bus) equipment provides data transmission channel from the main process equipment application software to USB device by driver in the USB device when communicating with main process equipment, finish the mutual of information.But the driver of USB device is write very complexity of technology, directly causes main process equipment to crash in case make mistakes.For this reason, to typical USB device, for example human interface device (HID, Human Interface Device) provides built-in driver in the operating system of main process equipment.Existing USB technology can be designed to HID with atypical USB device such as USB KEY.When between HID and main process equipment, carrying out data transmission, the built-in driver of operating system be can directly use, the complicacy and the risk of writing driver removed from.
When carrying out data transmission between HID and the main process equipment, the built-in driver of main process equipment operating system adopts dual mode that HID hardware is conducted interviews, and the 1st kind is the control transmission mode that defines in the USB standard; The 2nd kind is the interruption transmission mode that defines in the USB standard.HID has built-in chip inside and is respectively equipped with the hardware circuit of supporting different data transfer modes, every kind of all corresponding circuit kit of data transfer mode, and this cover circuit can be by the abstract end points that is called.Support the end points of control transmission mode to be called the control end points; Support the end points that interrupts transmission mode to be called interrupt endpoint.Also have piece end points etc. to be used to support the end points of piece transmission mode.Every kind of built-in chip is not to have all end points, and except that every kind of chip of control end points all had, the manufacturer of other each chip of type end points can selectively adopt one or more.
Therefore, for the USB device of using no interrupt endpoint built-in chip, when it is designed to HID, because built-in chip does not have interrupt endpoint, some main process equipment operating system may be refused to carry out any type of data transmission with this HID, influences the compatibility of this HID.As, under LINUX operating system, need receive the relevant information that HID goes up interrupt endpoint, just carry out data transmission with this HID equipment.If do not receive, refusal carries out data transmission with this HID, and the use of this HID is subjected to certain restriction.As the built-in chip that adopts the various transmission modes of development support improves the compatibility of HID, then increases chip production producer cost and production difficulty.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method and device that improves compatibility of man-machne interface device, strengthens the compatibility of human interface device.
The present invention also provides a kind of method that improves compatibility of man-machne interface device, comprising:
Human interface device transmits virtual interrupt endpoint information to main process equipment;
Described main process equipment permission is carried out data transmission with described human interface device.
Preferably, described human interface device built-in chip transmits virtual interrupt endpoint information to main process equipment.
Preferably, described virtual interrupt endpoint information comprises the information of a virtual interrupt endpoint.
Preferably, comprise that also human interface device increases an interrupt endpoint descriptor.
Preferably, described virtual interrupt endpoint information comprises the information of two or more virtual interrupt endpoint.
Preferably, comprise that also human interface device increases and the interrupt endpoint descriptor of virtual interrupt endpoint number equal number.
A kind of device that improves compatibility of man-machne interface device of the present invention comprises built-in chip, and described built-in chip comprises control end dot element and virtual interrupt endpoint unit;
Described virtual interrupt endpoint unit is used to transmit virtual interrupt endpoint information to main process equipment, makes described main process equipment permission carry out data transmission with human interface device.
Preferably, described virtual interrupt endpoint information comprises the information of a virtual interrupt endpoint.
Preferably, described virtual interrupt endpoint information comprises the information of two or more virtual interrupt endpoint.
Preferably, described human interface device also comprises the interrupt endpoint descriptor with virtual interrupt endpoint number equal number.
Compared with prior art, the present invention has the following advantages:
The present invention sends virtual interrupt endpoint information by the built-in chip on the human interface device to main process equipment, make the main process equipment that the operating system that requires HID to possess interrupt endpoint is installed to discern this HID, and the permission with this HID carry out data transmission, the enhancing HID compatibility.The present invention is simple, with respect to increase the interrupt endpoint method in built-in chip, can reduce the production cost and the manufacture difficulty of chip production producer, has practicality.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Core concept of the present invention is to send virtual interrupt endpoint information by the built-in chip on the human interface device to main process equipment, make the main process equipment that the operating system that requires HID to possess interrupt endpoint is installed to discern this HID, and the permission with this HID carry out data transmission, the enhancing HID compatibility.
See also Fig. 1, improve the embodiment process flow diagram of the method for compatibility of man-machne interface device for the present invention is a kind of, concrete steps are as follows:
Step 101, HID transmit virtual interrupt endpoint information to main process equipment;
Main process equipment is that main process equipment operating system, that can HID carry out data transmission is installed, as computing machine etc.The operating system difference that main process equipment is installed is also different to the requirement of HID.Only require HID to possess the control end points as MS WINDOWS operating system, whether possess interrupt endpoint and do not do the pressure requirement.The main process equipment of installation MS WINDOWS operating system and HID are based on control transmission, if HID has interrupt endpoint, this main process equipment and HID also can adopt to interrupt transmitting and finish data transmission.But if the main process equipment installation is LINUX operating system, the characteristic decision of LINUX operating system itself needs to confirm have after the interrupt endpoint on the HID, and just permission and this HID carry out data transmission.
If do not possess interrupt endpoint on the HID, and need carry out data transmission with the main process equipment that LINUX operating system is installed the time, can send virtual interrupt endpoint information to main process equipment by built-in chip among the HID, make main process equipment think that this HID has interrupt endpoint, and data transmission is carried out in permission with it.
The built-in built-in chip of HID, built-in chip send virtual interrupt endpoint information to main process equipment.Interrupt endpoint information comprises the information of one or more virtual interrupting input end points.As the built-in chip transmission is the information of a virtual interrupt endpoint, the byte of expression end points quantity should be 1 in the HID interface descriptor, and increase an interrupt endpoint descriptor, the byte of expression endpoint type is set to 3 in this descriptor, the end points buffer length is set to 8 bytes, and the end points access time is spaced apart maximal value FF; As the built-in chip transmission is the information of a plurality of virtual interrupt endpoint, the byte of representing end points quantity among the HID in the interface descriptor should be and the identical numerical value of virtual interrupt endpoint number, increase the interrupt endpoint descriptor of corresponding number simultaneously, the byte of expression endpoint type is set to 3 in this descriptor, the end points buffer length is set to 8 bytes, and the end points access time is spaced apart maximal value FF.
The byte of expression end points quantity is provided with and needs that to send to the virtual interrupt endpoint number that is comprised in the information of main process equipment consistent with built-in chip in the interface descriptor, and on the basis of original descriptor, increase the interrupt endpoint descriptor of respective numbers, the byte of expression endpoint type is set to 3 in the interrupt endpoint descriptor, and what show that this descriptor represents is interrupt endpoint.The interrupt endpoint buffer length is set to 8 bytes, and it is preferred value that the end points access time is spaced apart maximal value FF, also can get other numerical value.
Step 102, main process equipment permission are carried out data transmission with HID.
After the operating system of main process equipment receives virtual interrupt endpoint information, confirm that this HID possesses interrupt endpoint, data transmission is carried out in permission with it.If the operating system of main process equipment is not received the information of related interrupts end points or by detect finding that HID does not have interrupt endpoint, refusal and carry out any type of data transmission then with this HID.
HID does not have the interrupt endpoint on the essential meaning among the present invention, makes main process equipment think that this HID possesses interrupt endpoint but send virtual interrupt endpoint information by the built-in chip among the HI D, and then data transmission is carried out in permission with it.When carrying out data transmission, because of having interrupt endpoint support, HID do not interrupt transmission mode, and the mode of the end points supports such as control end points that can only rely in the built-in chip to be possessed is carried out data transmission.As, necessarily possess the control end points in the built-in chip, can adopt the mode of control transmission to carry out data transmission between HID and the main process equipment.Carry out data transmission though virtual interrupt endpoint can not make between main process equipment and the HID to interrupt transmission manner, can make between main process equipment and the HID and carry out data transmission in modes such as control transmission.So just make between originally incompatible main process equipment and the HID and can carry out data transmission, strengthen the compatibility of HID.With respect in built-in chip, increasing the interrupt endpoint method, can reduce the production cost and the manufacture difficulty of chip production producer, have practicality.
See also Fig. 2, for the present invention is a kind of embodiment synoptic diagram that improves the device of compatibility of man-machne interface device, comprise HID20, HID20 comprises built-in chip 201, and wherein, built-in chip 201 comprises virtual interrupt endpoint unit 2011 and control end dot element 2012.
Do not possess interrupt endpoint on the HID20, and need carry out data transmission with the main process equipment that LINUX operating system is installed the time, can send virtual interrupt endpoint information to main process equipment by virtual interrupt endpoint unit 2011, make main process equipment think that this HID20 has interrupt endpoint, and data transmission is carried out in permission with it.
Virtual interrupt endpoint unit 2011 sends virtual interrupt endpoint information to main process equipment.Interrupt endpoint information comprises the information of one or more virtual interrupting input end points.As 2011 transmissions of virtual interrupt endpoint unit is the information of a virtual interrupt endpoint, the interface descriptor should be 1 among the HID20, and increase an interrupt endpoint descriptor, the byte of expression endpoint type is set to 3 in this descriptor, the end points buffer length is set to 8 bytes, and the end points access time is spaced apart maximal value FF; As 2011 transmissions of virtual interrupt endpoint unit is the information of a plurality of virtual interrupt endpoint, the interface descriptor should be and the identical numerical value of virtual interrupt endpoint number among the HID20, increase the interrupt endpoint descriptor of corresponding number simultaneously, the byte of expression endpoint type is set to 3 in this descriptor, the end points buffer length is set to 8 bytes, and the end points access time is spaced apart maximal value FF.
The byte of expression end points quantity is provided with and needs that to send to the virtual interrupt endpoint number that is comprised in the information of main process equipment consistent with built-in chip in the interface descriptor, and on the basis of original descriptor, increase the interrupt endpoint descriptor of respective numbers, the byte of expression endpoint type is set to 3 in the interrupt endpoint descriptor, and what show that this descriptor represents is interrupt endpoint.The interrupt endpoint buffer length is set to 8 bytes, and it is preferred value that the end points access time is spaced apart maximal value FF, also can get other numerical value.
After the operating system of main process equipment receives virtual interrupt endpoint information, confirm that HID20 possesses interrupt endpoint, data transmission is carried out in permission with it.If the operating system of main process equipment is not received the information of related interrupts end points or by detect finding that HID20 does not have interrupt endpoint, refusal and carry out any type of data transmission then with this HID20.The interrupt endpoint that virtual interrupt endpoint unit 2011 does not have on the essential meaning among the present invention, but make main process equipment think that HID20 possesses interrupt endpoint by sending virtual interrupt endpoint information, and then data transmission is carried out in permission with it.When carrying out data transmission,, can only rely on control end dot element 2012 to carry out data transmission in the control transmission mode because of virtual interrupt endpoint unit 2011 does not have interrupt endpoint support to interrupt transmission mode.
Carry out data transmission though virtual interrupt endpoint unit 2011 can not make between main process equipment and the HID20 to interrupt transmission manner, can make between main process equipment and the HID20 and can carry out data transmission in modes such as control transmission by control end dot element 2012.So just make between originally incompatible main process equipment and the HID20 and can carry out data transmission, strengthen the compatibility of HID20.
More than to a kind of method and device that improves the human interface device compatibility provided by the present invention, be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.