[go: up one dir, main page]

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
printing
printer
equipment
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

Landscapes

  • Accessory Devices And Overall Control Thereof (AREA)
  • Information Transfer Systems (AREA)

Abstract

本发明公开了一种USB打印设备中使用HID设备实现打印免驱动的方法,包括如下步骤:1)通过USB接口连接到PC端;2)配置完成后开始打印任务;3)接收数据完成打印。本发明属于打印技术领域,具体是一种USB打印设备中使用HID设备实现打印免驱动的方法,摒弃了传统的需要安装打印设备驱动程序后才能连接设备实现打印,采用作为HID设备类型实现无需安装驱动程序即插即用,这样省去了安装驱动的步骤,避免了驱动安装出错引发的各种问题。

Figure 202011560977

The invention discloses a method for using HID equipment in a USB printing device to realize printing without driver, comprising the following steps: 1) connecting to a PC through a USB interface; 2) starting a printing task after the configuration is completed; 3) receiving data to complete printing. The invention belongs to the technical field of printing, in particular to a method for using HID equipment in a USB printing device to realize printing without driver, abandoning the traditional need to install a printing device driver before connecting the device to realize printing, and adopting the HID device type to realize printing without installation The driver is plug-and-play, which saves the steps of installing the driver and avoids various problems caused by driver installation errors.

Figure 202011560977

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.一种USB打印设备中使用HID设备实现打印免驱动的方法,其特征在于,包括如下步骤:1. in a USB printing device, use HID device to realize the method for printing without driver, it is characterized in that, comprise the steps: 1)配合USB通信协议,通过USB接口连接到PC端,USB通信包括控制传输、中断传输、等时传输和块传输,任何传输都需要由PC端内部的USB host接口发起,当打印机设备插入PC端到拔出打印机设备的过程都是由host进行询问的,当打印机设备连接到PC端后,主机会通过控制传输询问打印机设备的设备信息,根据打印机设备信息进行驱动配置,配置结束后通过中断传输不断发送数据信息直到打印机设备被拔出;1) Cooperate with the USB communication protocol and connect to the PC through the USB interface. The USB communication includes control transmission, interrupt transmission, isochronous transmission and block transmission. Any transmission needs to be initiated by the USB host interface inside the PC. When the printer device is inserted into the PC The process from the end to the unplugging of the printer device is all inquired by the host. When the printer device is connected to the PC, the host will inquire about the device information of the printer device through control transmission, and configure the driver according to the printer device information. The transmission keeps sending data messages until the printer device is unplugged; 2)当打印机设备连接PC端后,PC端会通过USB接口识别到连接的打印机设备,根据打印机设备提交的设备信息配置驱动,配置完成后查询设备,当找到当前设备后通过注册方式获取设备,注册成功后既可读取当前连接的设备信息,发送数据给当前连接的设备,开始打印任务;2) When the printer device is connected to the PC, the PC will identify the connected printer device through the USB interface, configure the driver according to the device information submitted by the printer device, query the device after the configuration is complete, and obtain the device by registering when the current device is found. After the registration is successful, you can read the information of the currently connected device, send data to the currently connected device, and start the printing task; 3)当打印机设备通过USB接口连接上PC后,PC会检测到有设备插入,通过init方法初始化设备后,调用Hid_find方法查找设备,成功找到设备后再调用Hid_register方法注册,根据注册之后获取到的回调结果确认连接的打印机设备,此时可以通过Hid_write方法写入数据到打印机设备,打印机设备接收到发送的数据后开始打印任务至完成打印。3) When the printer device is connected to the PC through the USB interface, the PC will detect that there is a device plugged in. After initializing the device through the init method, call the Hid_find method to find the device, and then call the Hid_register method to register after successfully finding the device. The callback result confirms the connected printer device. At this time, data can be written to the printer device through the Hid_write method. After the printer device receives the sent data, it starts the printing task and completes the printing.
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
US9569226B2 (en) Baseboard management controller and method of loading firmware
US6353866B1 (en) Apparatus and method for initializing a universal serial bus device
US6618773B1 (en) Receiving a particular identification file among an analog identification file and a digital identification file in response to a request to a dual-interface monitor
US20040230708A1 (en) Application method for universal serial bus file transfer cable
US20040128405A1 (en) Data transfer control system, electronic instrument, program, and data transfer control method
US7610482B1 (en) Method and system for managing boot trace information in host bus adapters
US7979612B2 (en) Communication method and apparatus
CN102937902B (en) A kind of method and apparatus of drive installation
CN115543893B (en) A server and its interface extension method, device, system and storage medium
CN112698795A (en) Method for realizing drive-free printing by using HID (high intensity discharge) equipment in USB (universal serial bus) printing equipment
CN111638916A (en) General android mobile terminal driving system and method for data forensics
CN108132899A (en) A kind of transmission mode configuration method, apparatus and system
CN107783793B (en) Method and USB device for automatically identifying host operating system
CN101354653B (en) Driver automatic installation method and system for hardware device
US7424580B2 (en) Data transfer control device, electronic instrument, program and method of fabricating electronic instrument
US6108723A (en) System for implementing hardware automated control of burst mode data transfer over a communication link between devices operating in a block mode
US8214569B2 (en) Method for reading and writing non-standard register of serial advanced technology attachment (SATA) device
US6301631B1 (en) Memory mapping method for eliminating dual address cycles in a peripheral component interconnect environment
CN108845899B (en) M.3SSD power-on initialization method and system
US7219353B2 (en) Finite state machine with a single process context for a RAID system
CN114090476A (en) SCSI hard disk simulation method, system and medium
CN114443522B (en) Hard disk backboard device and server
CN101154144B (en) Peripheral device, peripheral-device recognizing method, and computer product
CN103631476B (en) Mode switching method of electronic device and related electronic device
CN100468353C (en) USB interface specification detection system and method thereof

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210423

RJ01 Rejection of invention patent application after publication