USB打印机识别区分

    本文地址:http://tongxinmao.com/Article/Detail/id/278

    Plug and Play


    "Plug and Play"(PNP) in the context of a USB attached printer is a process that automatically installs driver software for a particular MAKE and MODEL of a printer. Depending on the particular host operating system, the detection of a new printer may initiate a search for appropriate drivers. When the same printer is replugged the process of making the printer available to the user is much faster. 

    The objective in the deployment of the RedTitan Virtual Printer is usually the configuration of a device that will "mount" without any user intervention. (The host computer may not have a user interface capable of installing "new" hardware). 

    PNP Identity strings.


    The PNP standards were developed when parallel port centronics interfaces were adapted to return small identity strings to host computers. The confused adoptation of PNP on USB devices by printer manufacturers has led to some compromises that complicate the process. In the absence a simple central registration scheme for a VENDOR INDENTIFICATION (VID) / PRODUCT IDENTIFICATION (PID), Microsoft extended the proposed standards to prevent "collisions" between different manufacturers when selecting drivers. The (still informal) VID/PID is used as the overriding identity on Linux platforms but Microsoft platforms also use COMPATIBLE ID (CID) created from hashing the MANUFACTURER (MFG) and the printer MODEL (MDL). 


    Microsoft recommended a way of creating a "CID" as part of the CHICAGO(NT) development. In summary, the MFG and MDL strings are concatonated. A 16 bit checksum is computed from the complete string. The constructed string has space characters replaced by underscore characters and it is truncated to twenty characters. The checksum is added as 4 hex character to produce the completed CID. RedTitan has published a utility to test this computation (see CIDOMAT.EXE in utilities.zip)

       e.g. CIDOMAT
          MFG: HP
          MDL: Deskjet F2200 series
          CID: HPDeskjet_F2200_seri87C7




    UU2 presents the following identity strings in response to an identity query

     ID use origin format example
    VIDVendor IDAssigned by the USB organisationFour hexadecimal values03F0
    PIDProduct IdentificationAssigned by the manufacturerFour hexadecimal values6C17
    RIDRevision IDVersion of driver assigned by authorFour hex digits (endian swapped)0100
    MFGManufacturerInformalStringHewlett Packard
    MDLModelInformalStringColor LaserJet 4610
    DESDescriptionInformalStringHP Deskjet 9800 Printer
    CMDCommandsInformal list of PDL supportedStringMLC,PCL,PML,DW-PCL,DYN,DESKJET
    SNSerial numberUnique device identificationStringYN9B9CB3RV05CY
    CIDCompatible IDSee CIDOMAT below24 character stringHPDeskjet_9800541F



    Virtual Printer Configuration from Management Console


    configuring printer personality

    Understanding Windows PNP printer install.


    A modern Windows platform come with a number of Windows Hardware Quality Labs (WHQL) certified printer drivers available on disk. When a new USB printer is attached, the INF files that accompany each driver is scanned to find a suitable driver that matches the identity strings from the printer. This is a "best match" process ordered in VID/PID,CID rank. 

    On a Windows 7 platform the drivers are located in the folder -C:\Windows\System32\DriverStore\FileRepository\ A complete summary of the relevant parts of pre-installed database on Windows 7 (64bit) is available as an XML file at http://www.pclviewer.com/uu2/dlist.xml 

    A single INF may describe a number of different printer drivers 

    Inspecting the "manufacturer" section of a ".INF" file list a number of parameter value pairs in the format driver=compatability list . . .

       e.g.
    
          HP LaserJet 5200 Series PCL 5=HPC5200F.GPD.ICM_LH_PHASE5,Hewlett-PackardHP_LaB67C,Vid_03f0&Pid_6417&Rev_0100,HP_LaserJet_5200_Series_pcl5,HP_LaserJet_5200_Series_PCL_5 ; Hardware ID

    In this sequence the appropriate identity strings can be deduced

          DES=HP LaserJet 5200 Series PCL 5
          CID=Hewlett-PackardHP_LaB67C
          MFG=HP
          MDL=LaserJet 5200 Series PCL 5
          VID=03f0
          PID=6417
          RID=0100

    A UU2 configured with these characteristics would cause Windows to install this driver on attachment without prompting for a disk. 

    Other fields (the serial number) can be found from the registry after the printer is installed. (See USBX.EXE USB Explorer utility inhttp://www.pclviewer.com/uu2/utilities.zip)

    • Fields may be omitted.

    • SN may be used to distinguish between several instances of the same printer type.

    • If the SN is omitted the USB port last mounted is used to distinguish "instances"

    • DOT4 printers are not supported

    • USB printer support is always installed

    On most Windows platforms the DES field is rarely used. When the install "wizard" is activated the tray pop-up will announce that it is installing "HPLaserJet 5200 Series PCL 5" driver. i.e. MFG an MDL are concatonated without a space character. On completion the name will be extracted from the driver INF file. The pop-up will announce - installed "HP LaserJet 5200 Series PCL 5"


    上一篇:PCL打印文件转换软件
    下一篇:电脑 硬件特征码读取 C++(序列号加密)