CN112698795A - Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment - Google Patents

Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment Download PDF

Info

Publication number
CN112698795A
CN112698795A CN202011560977.0A CN202011560977A CN112698795A CN 112698795 A CN112698795 A CN 112698795A CN 202011560977 A CN202011560977 A CN 202011560977A CN 112698795 A CN112698795 A CN 112698795A
Authority
CN
China
Prior art keywords
equipment
printer
printing
usb
hid
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011560977.0A
Other languages
Chinese (zh)
Inventor
刘伟宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Detong Electronic Technology Jiangsu Co ltd
Original Assignee
Detong Electronic Technology Jiangsu Co ltd
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 Detong Electronic Technology Jiangsu Co ltd filed Critical Detong Electronic Technology Jiangsu Co ltd
Priority to CN202011560977.0A priority Critical patent/CN112698795A/en
Publication of CN112698795A publication Critical patent/CN112698795A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for realizing printing drive-free by using HID equipment in USB printing equipment, which comprises the following steps: 1) the USB interface is connected to a PC terminal; 2) starting a printing task after configuration is completed; 3) and receiving data to complete printing. The invention belongs to the technical field of printing, in particular to a method for realizing printing without driving by using HID equipment in USB printing equipment, which abandons the traditional method that the equipment can be connected to realize printing after a printing equipment driving program is required to be installed, and adopts the type of the HID equipment to realize plug-and-play without installing the driving program, thereby saving the step of installing the driving and avoiding various problems caused by the error installation of the driving.

Description

Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment
Technical Field
The invention belongs to the technical field of printing, and particularly relates to a method for realizing printing drive-free by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment.
Background
Hid (human Interface device) is a common device type in USB devices, and is a USB device that interacts directly with human, such as a keyboard, a mouse, and a joystick. Among USB devices, HID devices are low cost. Drivers for HID devices are built into windows 98 and later versions and can be used directly by applications to communicate with the device. A printer is one of the output devices of a computer for printing the results of a computer process on an associated medium. The indexes for measuring the quality of the printer comprise three items, namely printing resolution, printing speed and noise.
At present, the installation of a printer is generally divided into two parts, one part is the connection between the printer and a computer, and the other part is the installation of a driver of the printer in an operating system. After entering the operating system, the system will prompt to find a printer, and the system will install the printer driver to use the printer. Some operating systems have many printer drivers, and most common printer drivers can be automatically installed. If the operating system does not have the drive of the printer, a drive disc attached to the printer needs to be placed in a computer, and then installation is carried out according to the system prompt; the existing process of installing the driver is relatively redundant, and basically, the driver is required to be operated according to step prompts. When a connecting wire of a USB printer is plugged into a USB interface of a computer, the system prompts a new printer to be found, a drive optical disk is placed into an optical drive according to the prompt, a 'confirm' button is clicked, the system starts to search a drive program of the printer at the moment, the system finds the drive program of the printer and clicks the 'confirm' button again, the system starts to copy files from the optical disk at the moment, the drive program is installed, finally, the installation is prompted to be completed, and the 'complete' button is clicked.
Disclosure of Invention
Aiming at the situation, in order to overcome the defects of the prior art, the invention provides a method for realizing printing drive-free by using an HID in a USB printing device, which abandons the traditional method that the device can be connected to realize printing after a printing device driver is installed, adopts the HID type to realize plug-and-play without installing the driver, thus omitting the step of installing the driver and avoiding various problems caused by the error of driver installation.
The technical scheme adopted by the invention is as follows: the invention discloses a method for realizing printing drive-free by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment, which comprises the following steps of:
1) the method comprises the steps that a USB communication protocol is matched and is connected to a PC end through a USB interface, the USB communication comprises control transmission, interrupt transmission, isochronous transmission and block transmission, any transmission needs to be initiated by a USB host interface in the PC end, when a printer device is plugged into the PC end and the process of pulling out the printer device is inquired by a host, after the printer device is connected to the PC end, the host inquires device information of the printer device through the control transmission, then drive configuration is carried out according to the printer device information, and after the configuration is finished, data information is continuously sent through the interrupt transmission until the printer device is pulled out;
2) when the printer equipment is connected with the PC end, the PC end can identify the connected printer equipment through the USB interface, drive is configured according to the equipment information submitted by the printer equipment, the equipment is inquired after configuration is completed, the equipment is obtained through a registration mode after the current equipment is found, the information of the currently connected equipment can be read after registration is successful, and data can be sent to the currently connected equipment to start a printing task;
3) when the printer equipment is connected with the PC through the USB interface, the PC can detect that the equipment is inserted, the equipment is initialized through the init method, the Hid _ find method is called to search the equipment, the Hid _ register method is called to register after the equipment is successfully found, the connected printer equipment is confirmed according to a callback result obtained after registration, at the moment, data can be written into the printer equipment through the Hid _ write method, and the printer equipment starts to print a task until printing is finished after receiving the sent data.
The invention with the structure has the following beneficial effects: according to the method for achieving printing without driving by using the HID in the USB printing equipment, the traditional method that the printing equipment can be connected to realize printing after a driving program of the printing equipment needs to be installed is abandoned, the method is adopted as the HID to achieve plug-and-play without installing the driving program, the step of installing the driver is omitted, and various problems caused by error in driving and installing are avoided.
Drawings
FIG. 1 is a flow chart of a method for implementing printing drive-free by using an HID device in a USB printing device according to the present invention;
fig. 2 is a schematic circuit diagram of the present invention.
The MCU is a central processing unit of the printer, is provided with a USB 2.0 full-speed interface, and has a fixed resistor pulled up in an internal D +; fixed resistors are respectively pulled down on D + and D-of a USB host interface in the PC terminal, and the USB driver is matched with a software protocol to judge the voltage change on a D + line, so that the printer is identified as a full-speed USB device, and then the printer displays the full-speed USB device as a USB HID device on the PC terminal, and drive-free printing is realized.
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments; all other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1-2, the method for implementing print drive-free by using HID device in USB printing device of the present invention includes the following steps:
1) the method comprises the steps that a USB communication protocol is matched and is connected to a PC end through a USB interface, the USB communication comprises control transmission, interrupt transmission, isochronous transmission and block transmission, any transmission needs to be initiated by a USB host interface in the PC end, when a printer device is plugged into the PC end and the process of pulling out the printer device is inquired by a host, after the printer device is connected to the PC end, the host inquires device information of the printer device through the control transmission, then drive configuration is carried out according to the printer device information, and after the configuration is finished, data information is continuously sent through the interrupt transmission until the printer device is pulled out;
2) when the printer equipment is connected with the PC end, the PC end can identify the connected printer equipment through the USB interface, drive is configured according to the equipment information submitted by the printer equipment, the equipment is inquired after configuration is completed, the equipment is obtained through a registration mode after the current equipment is found, the information of the currently connected equipment can be read after registration is successful, and data can be sent to the currently connected equipment to start a printing task;
3) when the printer equipment is connected with the PC through the USB interface, the PC can detect that the equipment is inserted, the equipment is initialized through the init method, the Hid _ find method is called to search the equipment, the Hid _ register method is called to register after the equipment is successfully found, the connected printer equipment is confirmed according to a callback result obtained after registration, at the moment, data can be written into the printer equipment through the Hid _ write method, and the printer equipment starts to print a task until printing is finished after receiving the sent data.
When the printer is connected to the PC end, a host computer inquires about equipment information of the printer equipment through control transmission, then drive configuration is carried out according to the printer equipment information, and after the configuration is finished, data information is continuously sent through interrupt transmission until the printer equipment is pulled out; when the printer equipment is connected with the PC end, the PC end can identify the connected printer equipment through the USB interface, drive is configured according to the equipment information submitted by the printer equipment, the equipment is inquired after configuration is completed, the equipment is obtained through a registration mode after the current equipment is found, the information of the currently connected equipment can be read after registration is successful, and data can be sent to the currently connected equipment to start a printing task; when the printer device is connected with the PC through the USB interface, the PC can detect that the device is inserted, the device is initialized through the init method, the Hid _ find method is called to search the device, the Hid _ register method is called to register after the device is successfully found, the connected printer device is confirmed according to a callback result obtained after registration, data can be written into the printer device through the Hid _ write method, the printer device starts to print a task until printing is completed after receiving the sent data, the whole work flow of the invention is realized, and the step can be repeated when the printer device is used next time.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
The present invention and its embodiments have been described above, and the description is not intended to be limiting, and the drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. In summary, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying other structures for carrying out the same purposes of the present invention without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (1)

1. A method for realizing printing drive-free by using an HID (high intensity discharge) device in a USB printing device is characterized by comprising the following steps:
1) the method comprises the steps that a USB communication protocol is matched and is connected to a PC end through a USB interface, the USB communication comprises control transmission, interrupt transmission, isochronous transmission and block transmission, any transmission needs to be initiated by a USB host interface in the PC end, when a printer device is plugged into the PC end and the process of pulling out the printer device is inquired by a host, after the printer device is connected to the PC end, the host inquires device information of the printer device through the control transmission, drive configuration is carried out according to the printer device information, and after the configuration is finished, data information is continuously sent through the interrupt transmission until the printer device is pulled out;
2) when the printer equipment is connected with the PC end, the PC end can identify the connected printer equipment through the USB interface, configure a driver according to the equipment information submitted by the printer equipment, query the equipment after configuration is finished, obtain the equipment through a registration mode after finding the current equipment, read the information of the currently connected equipment after registration is successful, send data to the currently connected equipment and start a printing task;
3) when the printer equipment is connected with the PC through the USB interface, the PC can detect that the equipment is inserted, the equipment is initialized through the init method, the Hid _ find method is called to search the equipment, the Hid _ register method is called to register after the equipment is successfully found, the connected printer equipment is confirmed according to a callback result obtained after registration, at the moment, data can be written into the printer equipment through the Hid _ write method, and the printer equipment starts to print a task until printing is finished after receiving the sent data.
CN202011560977.0A 2020-12-25 2020-12-25 Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment Pending CN112698795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011560977.0A CN112698795A (en) 2020-12-25 2020-12-25 Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011560977.0A CN112698795A (en) 2020-12-25 2020-12-25 Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment

Publications (1)

Publication Number Publication Date
CN112698795A true CN112698795A (en) 2021-04-23

Family

ID=75510475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011560977.0A Pending CN112698795A (en) 2020-12-25 2020-12-25 Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment

Country Status (1)

Country Link
CN (1) CN112698795A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102084354A (en) * 2008-04-05 2011-06-01 社会传播公司 Shared virtual area communication environment based apparatus and methods
CN102214148A (en) * 2010-04-01 2011-10-12 山东新北洋信息技术股份有限公司 Printer with USB (Universal Serial Bus) interface as well as driver installation method and system thereof
CN107329916A (en) * 2017-06-13 2017-11-07 北京深之度科技有限公司 A kind of USB device control method, device and computing device
CN108089999A (en) * 2017-11-29 2018-05-29 郑州云海信息技术有限公司 A kind of Multifunctional USB method for device registration and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102084354A (en) * 2008-04-05 2011-06-01 社会传播公司 Shared virtual area communication environment based apparatus and methods
CN102214148A (en) * 2010-04-01 2011-10-12 山东新北洋信息技术股份有限公司 Printer with USB (Universal Serial Bus) interface as well as driver installation method and system thereof
CN107329916A (en) * 2017-06-13 2017-11-07 北京深之度科技有限公司 A kind of USB device control method, device and computing device
CN108089999A (en) * 2017-11-29 2018-05-29 郑州云海信息技术有限公司 A kind of Multifunctional USB method for device registration and system

Similar Documents

Publication Publication Date Title
CN1168022C (en) Method and apparatus for detecting type of interface to which peripheral device is connected
US7752029B2 (en) Method to change USB device descriptors from host to emulate a new device
CN102713843B (en) Method of USB device enumeration including detecting operating system type of USB host
US6145019A (en) Unconfigured device that automatically configures itself as the primary device if no other unconfigured device is present
US5797038A (en) Method and system for serially based host/peripheral communication
US20060174049A1 (en) USB to SATA bridge system
US7975101B2 (en) Storage medium storing drive configuration setting program
US6460093B1 (en) Automatic configuration of primary and secondary peripheral devices for a computer
US20040230708A1 (en) Application method for universal serial bus file transfer cable
JPH05341923A (en) Protocol for providing bi-directional communicating capability and method therefor
US8250255B2 (en) Two-way connectivity USB control device and operation method thereof
US20030223486A1 (en) Method for detecting data transmission rate of USB controller by using USB device
JP2008521080A (en) Multimedia card interface method, computer program, and apparatus
JP2003114859A (en) Usb connector
US7979612B2 (en) Communication method and apparatus
CN112698795A (en) Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment
EP1024434B1 (en) Automatic configuration of primary and secondary peripheral devices for a computer
CN101751353A (en) Data card upgrading method and device
US8214569B2 (en) Method for reading and writing non-standard register of serial advanced technology attachment (SATA) device
JPH03204023A (en) Duplexing control system for magnetic recorder
US7293167B2 (en) Method and apparatus for driving a non-native SATA hard disk
CN113076270A (en) Protocol configuration device and method of IO interface and related components
US6301631B1 (en) Memory mapping method for eliminating dual address cycles in a peripheral component interconnect environment
US7219353B2 (en) Finite state machine with a single process context for a RAID system
US20030097515A1 (en) Circuit system and method for data transmission between LPC devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination