CN106301488A - A kind of Bluetooth adapter and method of work thereof - Google Patents

A kind of Bluetooth adapter and method of work thereof Download PDF

Info

Publication number
CN106301488A
CN106301488A CN201610864548.XA CN201610864548A CN106301488A CN 106301488 A CN106301488 A CN 106301488A CN 201610864548 A CN201610864548 A CN 201610864548A CN 106301488 A CN106301488 A CN 106301488A
Authority
CN
China
Prior art keywords
bluetooth
usb
protocol
response
data
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.)
Granted
Application number
CN201610864548.XA
Other languages
Chinese (zh)
Other versions
CN106301488B (en
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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201610864548.XA priority Critical patent/CN106301488B/en
Publication of CN106301488A publication Critical patent/CN106301488A/en
Application granted granted Critical
Publication of CN106301488B publication Critical patent/CN106301488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/40Near-field transmission systems, e.g. inductive or capacitive transmission systems characterised by components specially adapted for near-field transmission
    • H04B5/48Transceivers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of Bluetooth adapter and method of work thereof, described method includes: Bluetooth adapter search with preset bluetooth security equipment that device identification matches and and its foundation be connected;Bluetooth adapter is to the usb protocol mark of host computer statement self;Bluetooth adapter receives the USB command from host computer;Bluetooth adapter is according to the protocol type of bluetooth security equipment and USB command tissue Bluetooth commands;Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;Bluetooth adapter receives the bluetooth response from bluetooth security equipment;Bluetooth adapter identifies, according to bluetooth response with usb protocol, the usb protocol tissue USB response matched;USB response is returned to host computer by Bluetooth adapter, and the Bluetooth adapter and the host computer that finally enable bluetooth security equipment be provided by the present invention are communicated.

Description

A kind of Bluetooth adapter and method of work thereof
Technical field
The present invention relates to Bluetooth communication field, particularly relate to a kind of Bluetooth adapter and method of work thereof.
Background technology
Along with the continuous progress of science and technology, bluetooth security equipment can be communicated by Bluetooth channels and mobile terminal.But In prior art, bluetooth security equipment cannot directly communicate with host computer (such as PC end).
Summary of the invention
Present invention solves the technical problem that: the invention provides a kind of Bluetooth adapter and method of work thereof, make bluetooth pacify Bluetooth adapter and host computer that full equipment can be provided by the present invention communicate.
The invention provides the method for work of a kind of Bluetooth adapter, including:
Step s1: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Step s2: described Bluetooth adapter is to the usb protocol mark of host computer statement self;
Step s3: described Bluetooth adapter receives the USB command from described host computer;
Step s4: described Bluetooth adapter is according to the protocol type of described bluetooth security equipment and described USB command tissue Bluetooth commands;
Step s5: described Bluetooth adapter sends Bluetooth commands to described bluetooth security equipment;
Step s6: described Bluetooth adapter receives the bluetooth response from described bluetooth security equipment;
Step s7: described Bluetooth adapter is assisted according to described bluetooth response and the USB matched with described usb protocol mark View tissue USB response;
Step s8: described USB response is returned to described host computer by described Bluetooth adapter.
Present invention also offers the method for work of a kind of Bluetooth adapter, described Bluetooth adapter includes control chip, indigo plant Tooth chip and USB module;Described method includes:
Step y1: described control chip sends poll instruction to described Bluetooth chip, and described Bluetooth chip receives poll After instruction, search for and preset bluetooth security equipment that device identification matches and establish a connection, to described control chip Return poll repeat-back;
Step y2: described control chip initializes USB module, by described USB module to the USB of host computer statement self Protocol-identifier;
Step y3: described control chip receives the USB command from host computer by described USB module;
Step y4: described control chip according to the protocol type of described bluetooth security equipment and the second preset protocol to described USB command is packaged, and obtains instructing encapsulation of data;
Step y5: described instruction encapsulation of data is sent to described Bluetooth chip by described control chip;
Step y6: described Bluetooth chip obtains Bluetooth commands from described instruction encapsulation of data;
Step y7: described Bluetooth chip sends Bluetooth commands to bluetooth security equipment;Receive and set from described bluetooth security Standby bluetooth response;
Step y8: described Bluetooth chip encapsulates described bluetooth response according to the second preset protocol, obtains response encapsulation of data;
Step y9: described Bluetooth chip sends described response encapsulation of data to described control chip;
Step y10: described control chip matches according to described response encapsulation of data with described usb protocol mark Usb protocol tissue USB response;
Step y11: described USB response is returned to described host computer by described USB module by described control chip.
The invention provides a kind of Bluetooth adapter, including: the first search module, the first link block, the first statement mould Block, the first molded tissue block, the first sending module, the first receiver module, the second receiver module, minor microstructure module and second send Module;
Described first search module, for searching for and presetting the bluetooth security equipment that device identification matches;
Described first link block, sets up even for searching, with described first, the described bluetooth security equipment that prime modulus block search arrives Connect;
Described first declaration module, after being connected with the foundation of described bluetooth security equipment when described first link block, Usb protocol mark to host computer statement self;
Described first receiver module, for receiving the USB command from described host computer;
Described first molded tissue block, for the protocol type according to described bluetooth security equipment and described first receiver module The described USB command tissue Bluetooth commands received;
Described first sending module, for sending Bluetooth commands to described bluetooth security equipment;
Described second receiver module, for receiving the bluetooth response from described bluetooth security equipment;
Described minor microstructure module, for the described bluetooth response received according to described second receiver module with described Usb protocol identifies the usb protocol tissue USB response matched;
Described second sending module, for returning to described host computer by described USB response.
Present invention also offers a kind of Bluetooth adapter, including: control chip, Bluetooth chip and USB module;
Described control chip includes: the first transmitting element, the first initialization unit, the first reception unit, the first tissue are single Unit, the second transmitting element, minor microstructure unit and the 3rd transmitting element
Described first transmitting element, for sending poll instruction to described Bluetooth chip;
Described first initialization unit, for receiving the poll from described Bluetooth chip when described first reception unit After repeat-back, initialize USB module, identified to the usb protocol of host computer statement self by described USB module;
Described first receives unit, for receiving the poll repeat-back from described Bluetooth chip;By described USB mould Block receives the USB command from host computer;Receive the response encapsulation of data from described Bluetooth chip;
Described first organizational unit, is used for the protocol type according to described bluetooth security equipment and the second preset protocol to institute State USB command to be packaged, obtain instructing encapsulation of data;
Described second transmitting element, for being sent to described Bluetooth chip by described instruction encapsulation of data;
Described minor microstructure unit, for according to from the described response encapsulation of data of described Bluetooth chip with described Usb protocol identifies the usb protocol tissue USB response matched;
Described 3rd transmitting element, for returning to described host computer by described USB module by described USB response;
Described Bluetooth chip includes: second receive unit, the first search unit, first connect unit, the 4th transmitting element, 3rd receives unit, second acquisition unit, the 5th transmitting element, the 4th reception unit, the 3rd organizational unit and the 6th transmission list Unit;
Described second receives unit, instructs for receiving the poll from control chip;
Described first search unit, after receiving poll instruction when described second reception unit, searches for and presets The described bluetooth security equipment that device identification matches;
Described first connects unit, is connected for setting up with described bluetooth security equipment,
Described 4th transmitting element, for returning poll repeat-back to described control chip;
3rd receives unit, for receiving the instruction encapsulation of data from described control chip;
Described second acquisition unit, for obtaining Bluetooth commands from described instruction encapsulation of data;
Described 5th transmitting element, for sending, to bluetooth security equipment, the Bluetooth commands that second acquisition unit gets;
Described 4th receives unit, for receiving the bluetooth response from described bluetooth security equipment;
Described 3rd organizational unit, for receiving, according to the second preset protocol encapsulation the described 4th, the bluetooth that unit receives Response, obtains response encapsulation of data;
Described 6th transmitting element, sends described response encapsulation of data to described control chip.
The invention have the benefit that and the invention provides a kind of Bluetooth adapter and method of work, Bluetooth adapter The USB command meeting USB from host computer is changed, obtains the Bluetooth commands that bluetooth security equipment is capable of identify that After, Bluetooth commands is sent to bluetooth security equipment, the bluetooth response that bluetooth security equipment returns is reconverted into upper function Enough USB responses meeting USB identified, and the USB response meeting USB is returned to host computer, finally make bluetooth Bluetooth adapter and host computer that safety equipment can be provided by the present invention communicate.
Accompanying drawing explanation
The method of work of a kind of Bluetooth adapter that Fig. 1 provides for the embodiment of the present invention 1;
The method of work of a kind of Bluetooth adapter that Fig. 2 provides for the embodiment of the present invention 2;
The refinement flow chart of the step 107 that Fig. 2-1 provides for the embodiment of the present invention 2;
The refinement flow chart of the step 110 that Fig. 2-2 provides for the embodiment of the present invention 2;
The flow chart of the method for work of a kind of Bluetooth adapter that Fig. 3 provides for the embodiment of the present invention 3;
The refinement flow chart of the step 207 that Fig. 3-1 provides for the embodiment of the present invention 3;
The refinement flow chart of the step 210 that Fig. 3-2 provides for the embodiment of the present invention 3;
The particular flow sheet of the method for work of the Bluetooth adapter that Fig. 4 and Fig. 5 provides for the embodiment of the present invention 4;
The flow chart of the method for work of a kind of Bluetooth adapter that Fig. 6 provides for the embodiment of the present invention 5;
The refinement flow chart of the step 507 that Fig. 6-1 provides for the embodiment of the present invention 5;
The refinement flow chart of the step 508 that Fig. 6-2 provides for the embodiment of the present invention 5;
The structure chart of a kind of Bluetooth adapter that Fig. 7 provides for the embodiment of the present invention 6;
The structure chart of a kind of Bluetooth adapter that Fig. 8 provides for the embodiment of the present invention 7.
Specific implementation method
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under not making creative work premise Embodiment, broadly falls into the scope of protection of the invention.
Embodiment 1
Present embodiments provide the method for work of a kind of Bluetooth adapter, as it is shown in figure 1, specifically include:
Step s1: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Step s2: Bluetooth adapter is to the usb protocol mark of host computer statement self;
Step s3: Bluetooth adapter receives the USB command from host computer;
Step s4: Bluetooth adapter is according to the protocol type of bluetooth security equipment and USB command tissue Bluetooth commands;
Step s5: Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;
Step s6: Bluetooth adapter receives the bluetooth response from bluetooth security equipment;
Step s7: Bluetooth adapter is answered according to bluetooth response and the usb protocol tissue USB matched with usb protocol mark Answer;
Step s8: USB response is returned to host computer by Bluetooth adapter.
In the present embodiment, host computer can be, but not limited to as PC.
In the present embodiment, after step s1, it is also possible to including: Bluetooth adapter is from the broadcast message of bluetooth security equipment Obtain the first protocol-identifier of bluetooth security equipment;Correspondingly, step s4 is particularly as follows: Bluetooth adapter sets according to bluetooth security Protocol type that the first standby protocol-identifier is corresponding and USB command tissue Bluetooth commands.
In the present embodiment, step s4 can be particularly as follows: Bluetooth adapter obtains the effective instruction data in USB command, root Protocol type and effective instruction data tissue Bluetooth commands according to bluetooth security equipment;Correspondingly, step s7 is particularly as follows: bluetooth is fitted Orchestration obtains the effective response data in bluetooth response, includes effectively according to identifying, with usb protocol, the usb protocol tissue matched The USB response of reply data.
In the present embodiment, the APDU that the effective instruction data in USB command are specially in USB command (ApplicationProtocolDataUnit, Application Protocol Data Unit).
In the present embodiment, after step s1, can also include before step s4: Bluetooth adapter is from bluetooth security equipment Broadcast message obtains the first protocol-identifier of bluetooth security equipment;Correspondingly, after step s3, also include: Bluetooth adapter Judge usb protocol to identify whether with the first protocol-identifier to match;
When usb protocol mark matches with the first protocol-identifier, execution following steps:
Step r1: Bluetooth adapter sends USB command to bluetooth security equipment;
Step r2: Bluetooth adapter receives the USB response from bluetooth security equipment;
Step r3: USB response is returned to host computer by Bluetooth adapter;
When usb protocol mark is not mated with the first protocol-identifier, execution following steps:
Step t1: Bluetooth adapter obtains the effective instruction data in USB command, according to the protocol class of bluetooth security equipment Type and effective instruction data tissue Bluetooth commands;
Step t2: Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;
Step t3: Bluetooth adapter receives the bluetooth response from bluetooth security equipment;
Step t4: Bluetooth adapter obtains the effective response data in bluetooth response, matches according to usb protocol mark Usb protocol tissue include effect reply data USB response;
Step t4 particularly as follows: Bluetooth adapter according to the protocol type of bluetooth security equipment obtain in bluetooth response effective Reply data, includes the USB response of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched;
Step t5: USB response is returned to host computer by Bluetooth adapter.
In the present embodiment, after step s1, also include before step s2: Bluetooth adapter is from the broadcast of bluetooth security equipment Information obtains the first protocol-identifier of bluetooth security equipment;Correspondingly, step s2 particularly as follows: Bluetooth adapter by self Usb protocol mark is set to the first protocol-identifier, and the usb protocol to host computer statement self is designated the first protocol-identifier;Phase Ying Di, step s4 particularly as follows: Bluetooth adapter using USB command as Bluetooth commands;Step s7 is particularly as follows: Bluetooth adapter is by indigo plant Tooth response is as USB response.
In the present embodiment, the protocol type of bluetooth security equipment can also is that what Bluetooth adapter self was preset;
When the usb protocol mark of the protocol type and Bluetooth adapter self of default bluetooth security equipment is mated: step Rapid s4 particularly as follows: Bluetooth adapter using USB command as Bluetooth commands;Step s7 is particularly as follows: Bluetooth adapter is by bluetooth response As USB response;
When the usb protocol mark of the protocol type and Bluetooth adapter self of default bluetooth security equipment is not mated: Step s4 is particularly as follows: Bluetooth adapter obtains the effective instruction data in USB command, according to the protocol type of bluetooth security equipment With effective instruction data tissue Bluetooth commands;Step s7 is particularly as follows: Bluetooth adapter obtains the effective response number in bluetooth response According to, include the USB response of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched.
In the present embodiment, step s3 is particularly as follows: the USB command from host computer to be received such as Bluetooth adapter, when in advance If receiving in the time after the USB command of host computer, perform step s4;When be not received by Preset Time from After the USB command of position machine, detect whether to disconnect with bluetooth security equipment, if it is, Bluetooth adapter resets, return Step s1;Otherwise, continue waiting for receiving the USB command from host computer;After step s8, return step s3 and continue waiting for receiving USB command from host computer.
In the present embodiment, also include after step s1: Bluetooth adapter detects whether to have disconnected even with bluetooth security equipment Connect, if it is, Bluetooth adapter resets, return step s1;Otherwise, continue to detect whether to have disconnected even with bluetooth security equipment Connect.
In the present embodiment, Bluetooth adapter resets, particularly as follows: the Bluetooth chip in Bluetooth adapter resets, and control chip Reset.After Bluetooth adapter resets, host computer detects the Bluetooth adapter on usb bus and upper by the hub of self Position machine disconnects.
In the present embodiment, usb protocol is specially CCID protocol or SCSI protocol or HID protocol or other agreements.
The present embodiment additionally provides the method for work of a kind of Bluetooth adapter, wherein, Bluetooth adapter include control chip, Bluetooth chip and USB module;Described method includes:
Step y1: control chip sends poll instruction to Bluetooth chip, after Bluetooth chip receives poll instruction, search The bluetooth security equipment that matches with default device identification also establishes a connection, and returns poll repeat-back to control chip;
Step y2: control chip initializes USB module, by USB module to the usb protocol mark of host computer statement self Know;
Step y3: control chip receives the USB command from host computer by USB module;
Step y4: USB command is carried out by control chip according to protocol type and second preset protocol of bluetooth security equipment Encapsulation, obtains instructing encapsulation of data;
Step y5: instruction encapsulation of data is sent to Bluetooth chip by control chip;
Step y6: Bluetooth chip obtains Bluetooth commands from instruction encapsulation of data;
Step y7: Bluetooth chip sends Bluetooth commands to bluetooth security equipment;Receive the bluetooth from bluetooth security equipment Response;
Step y8: Bluetooth chip, according to the second preset protocol encapsulation bluetooth response, obtains response encapsulation of data;
Step y9: Bluetooth chip sends response encapsulation of data to control chip;
Step y10: control chip identifies, according to response encapsulation of data with usb protocol, the usb protocol tissue USB matched Response;
Step y11: USB response is returned to host computer by USB module by control chip.
Further, after step y1, also include: control chip sends to Bluetooth chip and obtains bluetooth security device identification Instruction;Bluetooth chip returns the response of the first protocol-identifier including bluetooth security equipment to control chip;Correspondingly, step y4 Particularly as follows: control chip is according to the protocol type corresponding with the first protocol-identifier of bluetooth security equipment and the second preset protocol pair USB command is packaged, and obtains instructing encapsulation of data.
Further, step y4, particularly as follows: control chip obtains the effective instruction data in USB command, is pacified according to bluetooth Effective instruction data are packaged by protocol type and second preset protocol of full equipment, obtain instructing encapsulation of data;Step y10 Particularly as follows: response encapsulation of data is unsealed by control chip, obtain the effective response data in bluetooth response, according to USB The usb protocol tissue that protocol-identifier matches includes the USB response of effect reply data.
Further, step y4, particularly as follows: control chip obtains the effective instruction data in USB command, is pacified according to bluetooth Effective instruction data are packaged by the protocol type of full equipment, obtain the first encapsulation of data;According to the second preset protocol to One encapsulation of data is packaged, and obtains instructing encapsulation of data;Step y6 is particularly as follows: Bluetooth chip obtains from instruction encapsulation of data First encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Further, step y10, particularly as follows: response encapsulation of data is unsealed by control chip, obtains bluetooth response, root Obtain the effective response data in bluetooth response according to the protocol type of bluetooth security equipment, match according to usb protocol mark Usb protocol tissue include effect reply data USB response.
Further, after step y1, also include before step y4: control chip sends to Bluetooth chip and obtains bluetooth Safety equipment mark instruction;Bluetooth chip returns the response of the first protocol-identifier including bluetooth security equipment to control chip; Correspondingly, after step y3, also include: control chip judges usb protocol to identify whether with the first protocol-identifier to match, when When usb protocol mark matches with the first protocol-identifier, execution following steps:
Step m1: USB command is packaged by control chip according to the second preset protocol, obtains instructing encapsulation of data;
Step m2: instruction encapsulation of data is sent to Bluetooth chip by control chip;
Step m3: instruction encapsulation of data is unsealed by Bluetooth chip, obtains USB command;
Step m4: Bluetooth chip sends USB command to bluetooth security equipment;Receiving the USB from bluetooth security equipment should Answer;
Step m5: Bluetooth chip, according to the second preset protocol encapsulation USB response, obtains response encapsulation of data;
Step m6: Bluetooth chip sends response encapsulation of data to control chip;
Step m7: response encapsulation of data is unsealed by control chip, obtains USB response;
Step m8: USB response is returned to host computer by USB module by control chip;
When usb protocol mark is not mated with the first protocol-identifier, perform step y4.
Further, after step y1, also include before step y2: control chip sends to Bluetooth chip and obtains bluetooth peace Full device identification instruction;Bluetooth chip returns the response of the first protocol-identifier including bluetooth security equipment to control chip;
The usb protocol of self, particularly as follows: control chip initializes USB module, is identified and is set to the first agreement by step y2 Mark, by USB module to the first protocol-identifier of host computer statement self;
Step y4, particularly as follows: USB command is packaged by control chip according to the second preset protocol, obtains instruction encapsulation number According to;
Step y6, particularly as follows: instruction encapsulation of data is unsealed by Bluetooth chip, obtains USB command;
Step y7 particularly as follows: Bluetooth chip using USB command as Bluetooth commands, send bluetooth to bluetooth security equipment and refer to Order;Receive the bluetooth response from bluetooth security equipment;
Step y10 is particularly as follows: control chip obtains bluetooth response from response encapsulation of data, using bluetooth response as USB Response.
Further, the protocol type of bluetooth security equipment can also be preset for Bluetooth adapter;
When the protocol type of default bluetooth security equipment mates with usb protocol mark:
Step y4, particularly as follows: USB command is packaged by control chip according to the second preset protocol, obtains instruction encapsulation number According to;Step y6, particularly as follows: Bluetooth chip is from instruction encapsulation of data, obtains USB command, using USB command as Bluetooth commands;Step Rapid y10 is particularly as follows: control chip obtains bluetooth response from response encapsulation of data, using bluetooth response as USB response;
When the protocol type of default bluetooth security equipment does not mates with usb protocol mark:
Step y4 is particularly as follows: control chip obtains the effective instruction data in USB command, according to the association of bluetooth security equipment Effective instruction data are packaged by view type and the second preset protocol, obtain instructing encapsulation of data;Step y10 is particularly as follows: control Response encapsulation of data is unsealed by coremaking sheet, obtains the effective response data in bluetooth response, identifies phase according to usb protocol The usb protocol tissue of coupling includes the USB response of effect reply data.
Further, step y3 is particularly as follows: the USB command from host computer to be received such as control chip, when when default In receive after the USB command of host computer, perform step y4;When being not received by from host computer in Preset Time USB command after, it may be judged whether receive from Bluetooth chip and the information that disconnected of bluetooth security equipment, if It is that then reset Bluetooth chip, reset control chip, return step y1;Otherwise, continue waiting for receiving the USB from host computer to refer to Order;After step y11, return step y3.
Further, also include after step y1: control chip judge whether to receive from Bluetooth chip and bluetooth The information that safety equipment have disconnected, if it is, reset Bluetooth chip, reset control chip, returns step y1;Otherwise, Continue to determine whether to receive the information disconnected with bluetooth security equipment from Bluetooth chip.
The method of work of the Bluetooth adapter that the present embodiment provides, Bluetooth adapter is setting up connection with bluetooth security equipment Afterwards, to the usb protocol mark of PC end report self, Bluetooth adapter is suitable can be identified as HID device or CCID equipment or Scsi device or other USB devices, enhance adaptability and the application of Bluetooth adapter.When Bluetooth adapter have received After the USB command meeting USB of PC end, the USB command meeting USB is changed, obtains bluetooth security After the Bluetooth commands that equipment is capable of identify that, Bluetooth commands is sent to bluetooth security equipment, the indigo plant returned by bluetooth security equipment Tooth response is reconverted into the USB response meeting USB that PC end is capable of identify that, and the USB response meeting USB is returned To PC end, Bluetooth adapter that bluetooth security equipment provided by the present invention and PC end is finally enable to communicate.
Embodiment 2
Present embodiments provide the method for work of a kind of Bluetooth adapter, as in figure 2 it is shown, specifically include:
Step 101: Bluetooth adapter powers on;
Step 102: Bluetooth adapter initializes;
In the present embodiment, Bluetooth adapter initializes particularly as follows: Bluetooth adapter initializes control chip and Bluetooth chip.
Step 103: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Specifically, Bluetooth adapter is instructed by control chip tissue poll, sends poll instruction to Bluetooth chip, receives Poll repeat-back from Bluetooth chip.After Bluetooth chip receives poll instruction, search for and preset device identification phase Coupling bluetooth security equipment and establish a connection, to control chip return poll repeat-back.
Wherein, Bluetooth adapter is instructed by control chip tissue poll, particularly as follows: Bluetooth adapter passes through control chip According to the second preset protocol tissue poll instruction.In the present embodiment, poll instruction include: instruction start byte, command identification, The data length of data field, data field and check bit.
Such as, the instruction banner word that " 0x5A " and " 0xA5 " is instructed as poll by Bluetooth adapter by control chip Joint, is arranged in the first byte and second byte of poll instruction, the command identification " 0x02 " instructed as poll, is arranged on In 3rd byte of poll instruction, the data length of the data field during " 0x00 " and " 0x00 " is instructed as poll, set respectively Put on the nybble and the 5th byte of poll instruction, the check value " XOR " that poll is instructed, it is arranged on poll and instructs In later byte (check bit), the poll instruction obtained, particularly as follows: " 5A A5 02 00 00 XOR ", sends to Bluetooth chip Poll instruction " 5A A5 02 00 00 XOR ";Etc. the poll repeat-back from Bluetooth chip to be received.
In the present embodiment, default device identification is default device identification, and wherein, device identification includes: bluetooth equipment UUID (Universally Unique Identifier, general unique identifier), the MAC Address of bluetooth equipment and bluetooth set At least one in standby device name.Wherein, the UUID of bluetooth equipment is the service unique identification information that bluetooth equipment is supported, The MAC Address of bluetooth equipment or the device name of bluetooth equipment are the unique identification information of bluetooth equipment.
In the present embodiment, bluetooth security equipment can be, but not limited to as blue-tooth intelligence key devices and Bluetooth intelligent card etc..
Step 104: Bluetooth adapter judges whether to set up with bluetooth security equipment to connect, if it is, perform step 105;Otherwise, step 104 is returned;
Specifically, when Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, root Judge whether to set up with bluetooth security equipment to connect according to poll repeat-back, if it is, perform step 105;Otherwise, step is returned Rapid 104;
More specifically, Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, Resolve poll repeat-back according to the second preset protocol, obtain the connection result mark in the data field in poll repeat-back, Judge whether to set up with bluetooth security equipment to connect, if connection result is designated success flag according to connection result mark " 00 ", then set up with bluetooth security equipment and connect;Otherwise, connection failure.
Such as, if Bluetooth adapter by control chip receive from the poll repeat-back of Bluetooth chip for " A5 5A 02 00 01 00 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge according to connection result mark " 00 " and bluetooth is pacified Full equipment is set up and is connected;If the poll repeat-back that Bluetooth adapter is received from Bluetooth chip by control chip is " A5 5A 02 00 01 01 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge do not have and blue according to connection result mark " 01 " Tooth safety equipment are set up and are connected.
Step 105: Bluetooth adapter is to the usb protocol mark of host computer statement self;
Specifically, Bluetooth adapter initializes USB module by the control chip of self, to host computer statement self Usb protocol identifies.
In the present embodiment, host computer can be, but not limited to as PC;Usb protocol mark be specially CCID protocol mark or HID protocol mark or SCSI protocol mark.In the present embodiment, usb protocol mark is as a example by SCSI protocol identifies.
Step 106: the USB command from host computer to be received such as Bluetooth adapter, arrives when receiving in Preset Time After the USB command of host computer, perform step 107;When being not received by the USB command from host computer in Preset Time After, detect whether to disconnect with bluetooth security equipment, if it is, Bluetooth adapter resets, return step 102;Otherwise, Return step 106;
Preferably, Preset Time is 3 seconds.
In the present embodiment, Bluetooth adapter resets, particularly as follows: the Bluetooth chip in Bluetooth adapter resets, and control chip Reset.After Bluetooth adapter resets, host computer detects the Bluetooth adapter on usb bus and upper by the hub of self Position machine disconnects.
Step 107: Bluetooth adapter resolves USB command, obtains the effective instruction data in USB command, pacifies according to bluetooth The protocol type of full equipment and effective instruction data tissue Bluetooth commands;
In the present embodiment, the APDU that the effective instruction data in USB command are specially in USB command (ApplicationProtocolDataUnit, Application Protocol Data Unit).
In the present embodiment, USB command is as a example by SCSI command;The type protocol of bluetooth security equipment can be that bluetooth is adaptive Device and bluetooth security equipment consult in advance, can be as a example by CCID protocol.
Specifically, Bluetooth adapter, according to the usb protocol parsing USB command matched with usb protocol mark, obtains USB Effective instruction data in instruction, add the first protocol header and command description mark before effective instruction data, pre-according to first If checking algorithm carries out computing to the data including the first protocol header, command description mark and effective instruction data, obtain first Check value, adds the first check value after valid data, obtains including the first protocol header, command description mark, effective instruction number According to the Bluetooth commands with the first check value.
Such as, Bluetooth adapter resolves SCSI command according to SCSI protocol " 5553424358aad6d60500000000000aff455041535300000055000000 0000000047474b80 ", will The data in front 31 bytes in SCSI command, as command control word, obtain in the 13rd byte in command control word According to the data " 00 " in the 13rd byte in the command control word got, data " 00 ", judge that current SCSI command is as upper The instruction of position machine transmission effective instruction data, the data " 05 " in the 9th byte of acquisition command control word, and as The length of the effective instruction data in SCSI command, the data of 5 byte lengths after acquisition command control word, and made For the effective instruction data in SCSI command, the effective instruction data obtaining SCSI command are " 00 47 47 4b 80 ", are having CCID protocol head " 6F,070,000 00,000,400 0000 " and command description mark " 00 " is added before effect director data, including CCID protocol head, command description mark and the data " 6F,070,000 00000400 of effective instruction data 0000000047474b80 ", according to EDC checking algorithm to including that CCID protocol head and effective instruction data carry out computing and obtain One check value " A7 ", adds the first check value after valid data, obtains including that CCID protocol head, command description identify, effectively The Bluetooth commands " 6F,070,000 00,000,400 00000000 0047474b80A7 " of director data and the first check value.
It should be noted that, when Bluetooth adapter receives after the SCSI command of host computer, also include returning to host computer Echo and answer control word, such as, when Bluetooth adapter receives the SCSI command from host computer After " 5553424358aad6d60500000000000aff455041535300000055000000 0000000047474b80 ", Response control word " 5553425358aad6d60000000000 " is returned to host computer.
Step 108: Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;
Specifically, Bluetooth adapter sends Bluetooth commands by Bluetooth chip to bluetooth security equipment.
Step 109: Bluetooth adapter receives the bluetooth response from bluetooth security equipment;
Specifically, Bluetooth adapter receives the bluetooth response from bluetooth security equipment by Bluetooth chip.
Step 110: Bluetooth adapter resolves bluetooth response, obtains the effective response data in bluetooth response, according to USB The usb protocol tissue that protocol-identifier matches includes the USB response of effect reply data;
Specifically, Bluetooth adapter obtains the effective response number in bluetooth response according to the protocol type of bluetooth security equipment According to, include the USB response of described effective response data according to identifying, with usb protocol, the usb protocol tissue matched.
More specifically, Bluetooth adapter resolves bluetooth response according to the protocol type of bluetooth security equipment, should by bluetooth Data after the first protocol header answered, as bluetooth reply data territory, obtain in bluetooth response in the data field of bluetooth response Effective response data, according to including the USB response imitating reply data with the usb protocol usb protocol tissue that matches of mark.
Such as, Bluetooth adapter resolves bluetooth response according to the protocol type of bluetooth security equipment “80830000000106000000006AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75 DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8 A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1C BE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F90 00 66 ", by bluetooth response Data " 80,830,000 000106000000 " in front ten bytes are as the CCID protocol head in bluetooth response, by cross First character in data field in bluetooth response, as the data field in bluetooth response, is saved as bluetooth by the data after joint Command description mark in response, last byte in data field, as the 3rd check value, obtains the number in bluetooth response After identifying according to the command description in territory, the data in all bytes before the 3rd check value “6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A 91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161 DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C 9B746F50544C008A7CDC106D0F9000 ", and as effective response data, include according to SCSI protocol tissue USB response " the 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE 2 of effect reply data 895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2 FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FC B190DD1CBD3417EEB06D1CBE52CC5D 490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F9000 55 53 42 53f8 58 df da 00 00 00 00 00”。
It should be noted that, according to the USB response including effect reply data of SCSI protocol tissue particularly as follows: according to SCSI The USB response including effect reply data and response control word of agreement organizations.More specifically: according to SCSI protocol effectively Add response control word after reply data, obtain including effect reply data and the USB response of response control word.
Such as, according to SCSI protocol at effective response data " 6AF61B6E94C5CE5871D54D31F9456F9BA397D E422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB 8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3 417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7 CDC106D0F9000 " add afterwards Response control word " 55 53 42 5,3f8 58 df da 00 00 00 00 00 ", obtains including effect reply data and response The USB response of control word is: " 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE 28 95D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2F E1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D49 0E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F9000”。
Step 111: USB response is returned to host computer by Bluetooth adapter, returns step 106;
In the present embodiment, when USB response is specially SCSI response, when i.e. usb protocol is designated SCSI protocol mark, blue Before USB response is returned to host computer by tooth adapter, also include: receive the return USB response from host computer and instruct.
In the present embodiment, step 107 can specifically include as shown in Fig. 2-1:
Step 1071: control chip resolves USB command, obtains the effective instruction data in USB command, according to bluetooth security Effective instruction data are packaged by protocol type and second preset protocol of equipment;
Specifically, control chip obtains the effective instruction data in USB command, according to the protocol type of bluetooth security equipment Effective instruction data are packaged, obtain the first encapsulation of data;According to the second preset protocol, the first encapsulation of data is sealed Dress, obtains instructing encapsulation of data;
More specifically, control chip, according to the usb protocol parsing USB command matched with usb protocol mark, obtains Effective instruction data in USB command, add the first protocol header and command description mark, according to first before effective instruction data Preset checking algorithm to including that the first protocol header, command description mark and the data of effective instruction data carry out computing, obtain the One check value, adds the first check value after effective instruction data, obtains including the first protocol header, command description mark, having Effect director data and the first encapsulation of data of the first check value;The second preset protocol head is added before the first encapsulation of data, according to Second presets checking algorithm carries out computing to the data including the first encapsulation of data and the second preset protocol head, obtains the second verification Value, adds the second check value after the first encapsulation of data, obtains according to the first protocol header and the second preset protocol head effectively Director data be packaged after instruction encapsulation of data.
Such as, control chip resolves SCSI command according to SCSI protocol, and the effective instruction data obtaining SCSI command are " 00 47 47 4b 80 ", before effective instruction data, add CCID protocol head " 6F,070,000 00,000,400 000000 " and order is retouched State mark " 00 ", obtain including CCID protocol head, command description mark and the data " 6F070000 of effective instruction data 00000400 0000000047474b80 ", according to EDC checking algorithm to including that CCID protocol head and effective instruction data are entered Row operation obtains the first check value " A7 ", obtains the first encapsulation of data " 6F,070,000 00,000,400 00000000 0047474b80 A7”;Before the first encapsulation of data, add the second preset protocol head " 5A A5 04 0013 ", obtain including first Data " the 5A A50400136F070000 00,000,400 00000000 of encapsulation of data and the second preset protocol head 0047474b80 A7 ", according to LRC checking algorithm, the data including the first encapsulation of data and the second preset protocol head are transported Calculate, obtain the second check value " 00 ", after the first encapsulation of data, add the second check value, obtain according to the first protocol header and the Two preset protocol heads effective instruction data are packaged after instruction encapsulation of data " 5A A5 04 00 13 6F 07 00 00 00 00 04 00 00 00 00 00 00 47 47 4b 80 A7 00”。
Step 1072: control chip by the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data, be sent to Bluetooth chip;
Specifically, instruction encapsulation of data is sent to Bluetooth chip by control chip.
Step 1073: Bluetooth chip from the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data in, obtain Bluetooth commands;
Specifically, Bluetooth chip obtains the first encapsulation of data from instruction encapsulation of data, is made by described first encapsulation of data For Bluetooth commands.
More specifically, instruction encapsulation of data is unsealed by Bluetooth chip according to the second preset protocol, from instruction encapsulation Data obtain the first encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Such as, instruction encapsulation of data is unsealed by Bluetooth chip, and the data obtained are " 5AA,504 0013 6F070000 00000400 00000000 004,747,4b8,0A7 00 ", after obtaining the second preset protocol head, before the second check value Data in all bytes, using the data " 6F,070,000 00,000,400 00000000 0047474b80 A7 " that get as First encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Correspondingly, step 110 can specifically include as shown in Fig. 2-2:
Step 1101: Bluetooth chip is according to the second preset protocol encapsulation bluetooth response;
Specifically, Bluetooth chip added the second preset protocol head before bluetooth response, preset checking algorithm according to the 3rd The data including the second preset protocol head and bluetooth response are carried out computing, obtains the 4th check value, add after bluetooth response Adding the 4th check value, the bluetooth response after being encapsulated, using the bluetooth response after encapsulation as response encapsulation of data.
Such as, Bluetooth chip is at bluetooth response " 80830000000106000000006AF61B6E94C5CE5871D54D3 1F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384 F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE 1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D 0F9000 66 " before, add the second preset protocol head " A5 5A 04 00 8F ", according to LRC checking algorithm to including that second is pre- If the data of protocol header and bluetooth response carry out computing, obtain the 4th check value " 00 ", after bluetooth response, add the 4th school Test value, the bluetooth response " A55A04008F80830000000106000000006 after obtaining according to the second preset protocol head encapsulation AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91 E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC 5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B 746F50544C008A7CDC106D0F9000 66 00 ", using the bluetooth response after encapsulation as response encapsulation of data.
Step 1102: Bluetooth chip bluetooth response after control chip sends according to the second preset protocol encapsulation;
Specifically, Bluetooth chip sends response encapsulation of data to control chip.
Step 1103: control chip, to according to the bluetooth response after the second preset protocol encapsulation, unseals, obtains bluetooth Effective response data in response, include effect reply data according to identifying, with usb protocol, the usb protocol tissue matched USB response.
Specifically, control chip, to according to the bluetooth response after the second preset protocol encapsulation, i.e. to response encapsulation of data, enters Row deblocking, obtains bluetooth response, obtains the effective response data in bluetooth response, root according to the protocol type of bluetooth security equipment The USB response of effect reply data is included according to identifying, with usb protocol, the usb protocol tissue matched.
More specifically, control chip, to according to the bluetooth response after the second preset protocol encapsulation, i.e. encapsulates number to response According to, unseal, using all data after the first protocol header as the data field in bluetooth response, obtain having in data field Effect reply data, includes the USB response of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched.
Such as, control chip is to according to the bluetooth response after the second preset protocol encapsulation “A55A04008F80830000000106000000006AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC1 1D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B 43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB0 6D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D 0F9,000 66 00 " solve Envelope, after obtaining CCID protocol head, the data in all bytes before the 3rd check value, the data that will get “6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A 91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161 DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C 9B746F50544C008A7CDC106D0F9000 " as the effective response data in bluetooth response, according to SCSI protocol tissue Include the SCSI response " 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD of effect reply data 95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A2 3B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE 52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F900055534253f858dfda00000 00000”。
It should be noted that, according to the USB response including effect reply data of SCSI protocol tissue particularly as follows: according to SCSI The USB response including effect reply data and response control word of agreement organizations.More specifically: according to SCSI protocol effectively Add response control word after reply data, obtain including effect reply data and the USB response of response control word.
Such as, according to SCSI protocol at effective response data " 6AF61B6E94C5CE5871D54D31F9456F9BA397D E422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB 8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3 417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7 CDC106D0F9000 " add afterwards Response control word " 55534253f858dfda0000000000 ", obtains including effect reply data and the USB of response control word Response is: " 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE 2895D234CF80D 2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB8 5889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5A ECE485C9B746F50544C008A7CDC106D0F9000”。
In the present embodiment, the protocol type of the data form of Bluetooth commands and bluetooth response and bluetooth security equipment is mutually Joining, data form and second preset protocol of the communication between control chip and Bluetooth chip match, and wherein, bluetooth security sets Standby protocol type is Bluetooth adapter and bluetooth security equipment consults in advance, and the second preset protocol is control chip and indigo plant Consult in advance between tooth chip.Can be, but not limited between Bluetooth chip and control chip by UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiving-transmitting transmitter)/SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI))/I2C (Inter-Integrated Circuit, internal integrated circuit) bus etc. is multiple Mode transmits data.
It should be noted that, in the present invention, when the protocol type of bluetooth security equipment be Bluetooth adapter preset time, with bluetooth Usb protocol and the first agreement that the usb protocol mark of adapter matches can be different agreements or identical agreement, as In the present embodiment, usb protocol is SCSI protocol, and the protocol type of bluetooth security equipment is CCID protocol.
It should be noted that, in the present embodiment, the protocol type of bluetooth security equipment can also is that Bluetooth adapter according to The broadcast message of bluetooth security equipment gets, specifically, after step 104, it is also possible to including: Bluetooth adapter is from indigo plant The broadcast message of tooth safety equipment obtains the first protocol-identifier of bluetooth security equipment;Correspondingly, according to bluetooth in step 107 The protocol type of safety equipment and effective instruction data tissue Bluetooth commands, particularly as follows: according to first with bluetooth security equipment Protocol type that protocol-identifier is corresponding and USB command tissue Bluetooth commands.
In the present embodiment, when Bluetooth adapter after step 104, before step 107, from the broadcast of bluetooth security equipment After information obtains the first protocol-identifier of bluetooth security equipment, after step 106, it is also possible to including: Bluetooth adapter is sentenced Disconnected usb protocol identifies whether that the first protocol-identifier with bluetooth security equipment matches, if it is not, then perform step 107;If It is then to perform step a1;
Step a1: Bluetooth adapter sends USB command to bluetooth security equipment;
Step a2: Bluetooth adapter receives the USB response from bluetooth security equipment;
Step a3: USB response is returned to host computer by Bluetooth adapter.
In the present embodiment, when Bluetooth adapter after step 104, before step 105, from the broadcast of bluetooth security equipment After obtaining the first protocol-identifier of bluetooth security equipment in information, step 107 may be replaced with step b1: Bluetooth adapter Using USB command as Bluetooth commands, perform step 108;Step 110 may be replaced with step c1: Bluetooth adapter is by indigo plant Tooth response, as USB response, performs step 111.
In the present embodiment, after step 104, it is also possible to including: Bluetooth adapter detects whether with bluetooth security equipment Disconnect, if it is, Bluetooth adapter resets, return step 102;Otherwise, continue to detect whether and bluetooth security equipment Disconnect.Correspondingly, when being not received by Preset Time after the USB command of host computer in step 106, return Step 106.
Embodiment 3
Present embodiments provide the method for work of a kind of Bluetooth adapter, as it is shown on figure 3, specifically include:
Step 201: Bluetooth adapter powers on;
Step 202: Bluetooth adapter initializes;
In the present embodiment, Bluetooth adapter initializes particularly as follows: Bluetooth adapter initializes control chip and Bluetooth chip.
Step 203: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Specifically, Bluetooth adapter is instructed by control chip tissue poll, sends poll instruction to Bluetooth chip, receives Poll repeat-back from Bluetooth chip.After Bluetooth chip receives poll instruction, search for and preset device identification phase Coupling bluetooth security equipment and establish a connection, to control chip return poll repeat-back.
Wherein, Bluetooth adapter is instructed by control chip tissue poll, particularly as follows: Bluetooth adapter passes through control chip According to the second preset protocol tissue poll instruction.In the present embodiment, poll instruction include: instruction start byte, command identification, The data length of data field, data field and check bit.
Such as, the instruction banner word that " 0x5A " and " 0xA5 " is instructed as poll by Bluetooth adapter by control chip Joint, is arranged in the first byte and second byte of poll instruction, the command identification " 0x02 " instructed as poll, is arranged on In 3rd byte of poll instruction, the data length of the data field during " 0x00 " and " 0x00 " is instructed as poll, set respectively Put on the nybble and the 5th byte of poll instruction, the check value " XOR " that poll is instructed, it is arranged on poll and instructs In later byte (check bit), the poll instruction obtained, particularly as follows: " 5A A5 02 00 00 XOR ", sends to Bluetooth chip Poll instruction " 5A A5 02 00 00 XOR ";Etc. the poll repeat-back from Bluetooth chip to be received.
In the present embodiment, default device identification is default device identification, and wherein, device identification includes: bluetooth equipment UUID (Universally Unique Identifier, general unique identifier), the MAC Address of bluetooth equipment and bluetooth set At least one in standby device name.Wherein, the UUID of bluetooth equipment is the service unique identification information that bluetooth equipment is supported, The MAC Address of bluetooth equipment or the device name of bluetooth equipment are the unique identification information of bluetooth equipment.
In the present embodiment, bluetooth security equipment can be, but not limited to as blue-tooth intelligence key devices and Bluetooth intelligent card etc..
Step 204: Bluetooth adapter judges whether to set up with bluetooth security equipment to connect, if it is, perform step 205;Otherwise, step 204 is returned;
Specifically, when Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, root Judge whether to set up with bluetooth security equipment to connect according to poll repeat-back, if it is, perform step 205;Otherwise, step is returned Rapid 204;
More specifically, Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, Resolve poll repeat-back according to the second preset protocol, obtain the connection result mark in the data field in poll repeat-back, Judge whether to set up with bluetooth security equipment to connect, if connection result is designated success flag, then according to connection result mark Set up with bluetooth security equipment and connect;Otherwise, connection failure.
Such as, if Bluetooth adapter by control chip receive from the poll repeat-back of Bluetooth chip for " A5 5A 02 00 01 00 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge according to connection result mark " 00 " and bluetooth is pacified Full equipment is set up and is connected;If the poll repeat-back that Bluetooth adapter is received from Bluetooth chip by control chip is " A5 5A 02 00 01 01 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge do not have and blue according to connection result mark " 01 " Tooth safety equipment are set up and are connected.
Step 205: Bluetooth adapter is to the usb protocol mark of host computer statement self;
Specifically, Bluetooth adapter initializes USB module by the control chip of self, to host computer statement self Usb protocol identifies.
In the present embodiment, host computer can be, but not limited to as PC;Usb protocol mark be specially CCID protocol mark or HID protocol mark or SCSI protocol mark.In the present embodiment, usb protocol mark is as a example by HID protocol identifies.
Step 206: the USB command from host computer to be received such as Bluetooth adapter, arrives when receiving in Preset Time After the USB command of host computer, perform step 207;When being not received by the USB command from host computer in Preset Time After, detect whether to disconnect with bluetooth security equipment, if it is, Bluetooth adapter resets, return step 202;Otherwise, Return step 206;
Preferably, Preset Time is 3 seconds.
In the present embodiment, Bluetooth adapter resets, particularly as follows: the Bluetooth chip in Bluetooth adapter resets, and control chip Reset.After Bluetooth adapter resets, host computer detects the Bluetooth adapter on usb bus and upper by the hub of self Position machine disconnects.
Step 207: Bluetooth adapter resolves USB command, obtains the effective instruction data in USB command, pacifies according to bluetooth The protocol type of full equipment and effective instruction data tissue Bluetooth commands;
In the present embodiment, the APDU that the effective instruction data in USB command are specially in USB command.
In the present embodiment, USB command is as a example by HID instructs;The protocol type of bluetooth security equipment can be that bluetooth is adaptive Device and bluetooth security equipment consult in advance, can be as a example by CCID protocol.
Specifically, Bluetooth adapter, according to the usb protocol parsing USB command matched with usb protocol mark, obtains USB Effective instruction data in instruction, add the first protocol header and command description mark before effective instruction data, pre-according to first If checking algorithm carries out computing to the data including the first protocol header, command description mark and effective instruction data, obtain first Check value, adds the first check value after valid data, obtains including the first protocol header, command description mark, effective instruction number According to the Bluetooth commands with the first check value.
Such as, Bluetooth adapter resolves HID according to HID protocol and instructs " 00 05 00 00 00 05 00 47 47 4b 80cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc Cc cc ", the HID protocol head " 00 05 00 00 00 that the data in the first six byte instruct HID instruct as HID 05 ", using the data length of the effective instruction data that the first two byte " 00 05 " of HID protocol head instructs as HID, HID is assisted Data " 00 00 " in third and fourth byte of view head are as the skew of current packet data transmission packet, by HID protocol head The the 5th and the 6th byte on data " 00 05 " as the data length of current bag transmission, obtain HID according to HID protocol head The data of 5 byte lengths after protocol header, and as the effective instruction data of HID instruction, obtain having of HID instruction Effect director data is " 00 47 47 4b 80 ", adds HID protocol head " 6F,070,000 00000400 before effective instruction data 0000 " and command description mark " 00 ", obtain including CCID protocol head, command description mark and the data of effective instruction data " 6F,070,000 00000400 0000000047474b80 ", according to EDC checking algorithm to including CCID protocol head and effectively referring to The computing that carries out making data obtains the first check value " A7 ", adds the first check value, obtain including that CCID assists after valid data View head, command description mark, effective instruction data and the Bluetooth commands " 6F,070,000 00000400 of the first check value 00000000 0047474b80 A7”。
Step 208: Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;
Specifically, Bluetooth adapter sends Bluetooth commands by Bluetooth chip to bluetooth security equipment.
Step 209: Bluetooth adapter receives the bluetooth response from bluetooth security equipment;
Specifically, Bluetooth adapter receives the bluetooth response from bluetooth security equipment by Bluetooth chip.
Step 210: Bluetooth adapter resolves bluetooth response, obtains the effective response data in bluetooth response, according to USB The usb protocol tissue that protocol-identifier matches includes the USB response of effect reply data;
Specifically, Bluetooth adapter obtains the effective response number in bluetooth response according to the protocol type of bluetooth security equipment According to, include the USB response of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched.
More specifically, Bluetooth adapter resolves bluetooth response according to the protocol type of bluetooth security equipment, should by bluetooth Data after the first protocol header answered, as bluetooth reply data territory, obtain in bluetooth response in the data field of bluetooth response Effective response data, according to including the USB response imitating reply data with the usb protocol usb protocol tissue that matches of mark.
Such as, Bluetooth adapter resolves bluetooth response according to the protocol type of bluetooth security equipment “80830000000106000000006AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8 FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1D CF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC 5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F9000 66 ", by front ten in bluetooth response Data " 80,830,000 000106000000 " in byte are as the CCID protocol head in bluetooth response, after crossed joint Data as the data field in bluetooth response, the first character in the data field in bluetooth response is saved in bluetooth response Command description mark, last byte in data field as the 3rd check value, obtains in the data field in bluetooth response Command description mark after, the data " 6AF61B6E94C5CE5871D54D31F in all bytes before the 3rd check value 9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7 E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1F CB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F 9000 ", and as effective response data, the USB response of effect reply data is included according to HID protocol tissue.
Wherein, the USB response of effect reply data is included according to HID protocol tissue particularly as follows: wrap according to HID protocol tissue Include the USB response of HID protocol head and effective response data.
More specifically, it is also possible to judge whether needs according to HID protocol, default subpackage length and effective response data Subpackage, is surrounded by effect reply data if it is, effective response data be divided into according to default subpackage length more, is often being surrounded by effect Add corresponding HID protocol head before reply data, obtain including many bags USB response of effect reply data;Otherwise, tissue includes The USB response of HID protocol head and effective response data.
Such as, according to according to HID protocol, default subpackage length " 40 " and effective response data “6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A 91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161 DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C 9B746F50544C008A7CDC106D0F9000 ", it is judged that needing USB response is divided into three guarantees, first obtained is surrounded by effect Answer evidence is 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE 2895D234CF80D 2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB80;Second is surrounded by effect reply data is: 55F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BD E1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B;Three guarantees effective response data For: 00820074000e746F50544C008A7CDC106D0F9000, and add corresponding before being often surrounded by effect reply data HID protocol head, obtains including that the first the first bag USB response being surrounded by effect reply data is: 00820000003a6AF61B6E94C 5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0 A577461BC384F7E9B8DFBC19CB80;
Obtain including that the second the second bag USB response being surrounded by effect reply data is:
0082003a003a55F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB 190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B;
The three guarantees USB response obtaining including three guarantees effective response data is:
00820074000e746F50544C008A7CDC106D0F9000ccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccc。
Step 211: USB response is returned to host computer by Bluetooth adapter, returns step 206;
In the present embodiment, step 207 can specifically include as shown in figure 3-1:
Step 2071: control chip resolves USB command, obtains the effective instruction data in USB command, according to bluetooth security Effective instruction data are packaged by protocol type and second preset protocol of equipment;
Specifically, control chip obtains the effective instruction data in USB command, according to the protocol type of bluetooth security equipment Effective instruction data are packaged, obtain the first encapsulation of data;According to the second preset protocol, the first encapsulation of data is sealed Dress, obtains instructing encapsulation of data;
More specifically, control chip, according to the usb protocol parsing USB command matched with usb protocol mark, obtains Effective instruction data in USB command, add the first protocol header and command description mark, according to first before effective instruction data Preset checking algorithm to including that the first protocol header, command description mark and the data of effective instruction data carry out computing, obtain the One check value, adds the first check value after effective instruction data, obtains including the first protocol header, command description mark, having Effect director data and the first encapsulation of data of the first check value;The second preset protocol head is added before the first encapsulation of data, according to Second presets checking algorithm carries out computing to the data including the first encapsulation of data and the second preset protocol head, obtains the second verification Value, adds the second check value after the first encapsulation of data, obtains according to the first protocol header and the second preset protocol head effectively Director data be packaged after instruction encapsulation of data.
Such as, control chip resolves HID according to HID protocol and instructs " 0005000000050047474b80ccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc Cccccccccccccccccc ", the data " 00 05 00 00 00 05 " in the first six byte instruct HID refer to as HID The HID protocol head of order, the data of effective instruction data the first two byte " 00 05 " of HID protocol head instructed as HID are long Data " 00 00 " in third and fourth byte of HID protocol head are transmitted the skew of packet by degree as current packet data, Using the data " 00 05 " in the 5th and the 6th byte of HID protocol head as the data length of current bag transmission, assist according to HID View head obtains the data of 5 byte lengths after HID protocol head, and as the effective instruction data of HID instruction, obtains The effective instruction data of HID instruction are " 00 47 47 4b 80 ", add CCID protocol head before effective instruction data " 6F,070,000 00,000,400 000000 " and command description mark " 00 ", obtain including that CCID protocol head, command description identify With the data " 6F,070,000 00000400 0000000047474b80 " of effective instruction data, according to EDC checking algorithm to bag The computing that carries out including CCID protocol head and effective instruction data obtains the first check value " A7 ", obtains the first encapsulation of data “6F070000 00000400 00000000 0047474b80 A7”;The second preset protocol head is added before the first encapsulation of data " 5A A5 04 0013 ", obtains including the first encapsulation of data and the data " 5A of the second preset protocol head A50400136F070000 00,000,400 00000000 0047474b80 A7 ", according to LRC checking algorithm to including the first envelope The data of dress data and the second preset protocol head carry out computing, obtain the second check value " 00 ", add after the first encapsulation of data Add the second check value, obtain the instruction after effective instruction data being packaged according to the first protocol header and the second preset protocol head Encapsulation of data " 5A A5 04 00 13 6F 07 00 00 00 00 04 00 00 00 00 00 00 47 47 4b 80 A7 00”。
Step 2072: control chip by the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data, be sent to Bluetooth chip;
Specifically, instruction encapsulation of data is sent to Bluetooth chip by control chip;
Step 2073: Bluetooth chip from the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data in, obtain Bluetooth commands;
Specifically, Bluetooth chip obtains the first encapsulation of data from instruction encapsulation of data, is made by described first encapsulation of data For Bluetooth commands.
More specifically, instruction encapsulation of data is unsealed by Bluetooth chip according to the second preset protocol, from instruction encapsulation Data obtain the first encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Such as, instruction encapsulation of data is unsealed by Bluetooth chip, and the data obtained are " 5AA,504 0013 6F070000 00000400 00000000 0047474b80 A7 00 ", after obtaining the second preset protocol head, before the second check value Data in all bytes, using the data " 6F,070,000 00,000,400 00000000 0047474b80 A7 " that get as First encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Correspondingly, step 210 can specifically include as shown in figure 3-2:
Step 2101: Bluetooth chip is according to the second preset protocol encapsulation bluetooth response;
Specifically, Bluetooth chip added the second preset protocol head before bluetooth response, preset checking algorithm according to the 3rd The data including the second preset protocol head and bluetooth response are carried out computing, obtains the 4th check value, add after bluetooth response Adding the 4th check value, the bluetooth response after being encapsulated, using the bluetooth response after encapsulation as response encapsulation of data.
Such as, Bluetooth chip is at bluetooth response " 80830000000106000000006AF61B6E94C5CE5871D54D3 1F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384 F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE 1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D 0F9000 66 " before, add the second preset protocol head " A5 5A 04 00 8F ", according to LRC checking algorithm to including that second is pre- If the data of protocol header and bluetooth response carry out computing, obtain the 4th check value " 00 ", after bluetooth response, add the 4th school Test value, the bluetooth response " A55A04008F80830000000106000000006 after obtaining according to the second preset protocol head encapsulation AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91 E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC 5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B 746F50544C008A7CDC106D0F9000 66 00 ", using the bluetooth response after encapsulation as response encapsulation of data.
Step 2102: Bluetooth chip bluetooth response after control chip sends according to the second preset protocol encapsulation;
Specifically, Bluetooth chip sends response encapsulation of data to control chip.
Step 2103: control chip, to according to the bluetooth response after the second preset protocol encapsulation, unseals, obtains bluetooth Effective response data in response, include effect reply data according to identifying, with usb protocol, the usb protocol tissue matched USB response.
Specifically, control chip, to according to the bluetooth response after the second preset protocol encapsulation, i.e. to response encapsulation of data, enters Row deblocking, obtains bluetooth response, obtains the effective response data in bluetooth response, root according to the protocol type of bluetooth security equipment The USB response of effect reply data is included according to identifying, with usb protocol, the usb protocol tissue matched.
More specifically, control chip, to according to the bluetooth response after the second preset protocol encapsulation, i.e. encapsulates number to response According to, unseal, using all data after the first protocol header as the data field in bluetooth response, obtain having in data field Effect reply data, includes the USB response of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched.
Such as, control chip is to according to the bluetooth response " A55A04008F80830000000 after the second preset protocol encapsulation 10600000000 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234C F80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC12 9FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A 8C5AECE485C9B746F50544C008A7CDC106D0F9000 66 00 " unseal, after obtaining CCID protocol head, The data in all bytes before 3rd check value, the data " 6AF61B6E94C5CE5871D54D31F9456 that will get F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8 DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB19 0DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F9000 " as the effective response data in bluetooth response, include the HID response of effect reply data according to HID protocol tissue.
Wherein, the USB response of effect reply data is included according to HID protocol tissue particularly as follows: wrap according to HID protocol tissue Include the USB response of HID protocol head and effective response data.
More specifically, it is also possible to judge whether needs according to HID protocol, default subpackage length and effective response data Subpackage, is surrounded by effect reply data if it is, effective response data be divided into according to default subpackage length more, is often being surrounded by effect Add corresponding HID protocol head before reply data, obtain including many bags USB response of effect reply data;Otherwise, tissue includes The USB response of HID protocol head and effective response data.
Such as, according to according to HID protocol, default subpackage length and effective response data " 6AF61B6E94C5CE5871D54D3 1F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384 F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE 1FC B190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106 D0F9000 ", it is judged that need by USB response be divided into three guarantees, first obtained be surrounded by effect reply data be: 6AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A9 1E94CAB11F0A577461BC384F7E9B8DFBC19CB80;Second is surrounded by effect reply data is: 55F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD341 7EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B;Three guarantees effective response data are: 00820074000e746F50544C008A7CDC106D0F9000, and add corresponding HID before being often surrounded by effect reply data Protocol header, obtains including that the first the first bag USB response being surrounded by effect reply data is: 00820000003a6AF61B6E94C5CE 5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A57 7461BC384F7E9B8DFBC19CB80;
Obtain including that the second the second bag USB response being surrounded by effect reply data is:
0082003a003a55F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB 190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B;
The three guarantees USB response obtaining including three guarantees effective response data is
00820074000e746F50544C008A7CDC106D0F9000ccccccccccccccccccccccccccccccccccccc ccccccccccccccccccccccccccccccccccccccccccccccccccc。
In the present embodiment, the protocol type of the data form of Bluetooth commands and bluetooth response and bluetooth security equipment is mutually Joining, data form and second preset protocol of the communication between control chip and Bluetooth chip match, and wherein, bluetooth security sets Standby protocol type can be Bluetooth adapter and bluetooth security equipment consults in advance, and the second preset protocol is control chip And consult in advance between Bluetooth chip.Can be, but not limited between Bluetooth chip and control chip pass through UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiving-transmitting transmitter)/SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI)) (Inter-Integrated Circuit, is internally integrated electricity to/I2C Road) the various mode transmission data such as bus.
It should be noted that, in the present invention, when the protocol type of bluetooth security equipment be Bluetooth adapter preset time, with bluetooth The usb protocol usb protocol that matches of mark of adapter and the protocol type of bluetooth security equipment can be different agreements or The agreement that person is identical, in the present embodiment, usb protocol is HID protocol, and the protocol type of bluetooth security equipment is CCID association View.
It should be noted that, in the present embodiment, the protocol type of bluetooth security equipment can also is that Bluetooth adapter according to The broadcast message of bluetooth security equipment gets, specifically, after step 204, it is also possible to including: Bluetooth adapter is from indigo plant The broadcast message of tooth safety equipment obtains the first protocol-identifier of bluetooth security equipment;Correspondingly, in step 207, bluetooth is adaptive Device according to the protocol type of bluetooth security equipment and effective instruction data tissue Bluetooth commands, particularly as follows: according to bluetooth security Protocol type that first protocol-identifier of equipment is corresponding and USB command tissue Bluetooth commands.
In the present embodiment, when Bluetooth adapter after step 204, before step 207, from the broadcast of bluetooth security equipment After information obtains the first protocol-identifier of bluetooth security equipment, after step 206, it is also possible to including: Bluetooth adapter is sentenced Disconnected usb protocol identifies whether that the first protocol-identifier with bluetooth security equipment matches, if it is not, then perform step 207;If It is then to perform step d1;
Step d1: Bluetooth adapter sends USB command to bluetooth security equipment;
Step d2: Bluetooth adapter receives the USB response from bluetooth security equipment;
Step d3: USB response is returned to host computer by Bluetooth adapter.
In the present embodiment, when Bluetooth adapter after step 204, before step 205, wide from from bluetooth security equipment Broadcasting in information after the first protocol-identifier of acquisition bluetooth security equipment, step 207 may be replaced with step e1: bluetooth is adaptive USB command as Bluetooth commands, is performed step 208 by device;Step 210 may be replaced with step f1: Bluetooth adapter will Bluetooth response, as USB response, performs step 211.
In the present embodiment, after step 204, it is also possible to including: Bluetooth adapter detects whether with bluetooth security equipment Disconnect, if it is, Bluetooth adapter resets, return step 202;Otherwise, continue to detect whether and bluetooth security equipment Disconnect.Correspondingly, when being not received by Preset Time after the USB command of host computer in step 206, return Step 206.
Embodiment 4
Present embodiments provide the method for work of a kind of Bluetooth adapter, it is adaptable to include Bluetooth adapter, bluetooth security Equipment and the system of host computer, as shown in Figure 4, including:
Step 301: Bluetooth adapter powers on;
Step 302: Bluetooth adapter initializes;
Step 303: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Step 304: Bluetooth adapter judges whether to set up with bluetooth security equipment to connect, if it is, perform step 305;Otherwise, step 304 is returned;
Step 305: Bluetooth adapter is to the usb protocol mark of host computer statement self;
Step 306: host computer sends USB command to Bluetooth adapter;
Step 307: Bluetooth adapter resolves USB command, obtains the effective instruction data in USB command, pacifies according to bluetooth The protocol type of full equipment and effective instruction data tissue Bluetooth commands;
Specifically, Bluetooth adapter, according to the usb protocol parsing USB command matched with usb protocol mark, obtains USB Effective instruction data in instruction, according to protocol type and the effective instruction data tissue Bluetooth commands of bluetooth security equipment.
In the present embodiment, the APDU that the effective instruction data in USB command are specially in USB command.
Step 308: Bluetooth adapter sends Bluetooth commands to bluetooth security equipment;
Step 309: bluetooth security equipment resolves Bluetooth commands, organizes the bluetooth response corresponding with Bluetooth commands;
Specifically, bluetooth security equipment resolves Bluetooth commands according to the protocol type of bluetooth security equipment, pacifies according to bluetooth The bluetooth response that the protocol type tissue of equipment is corresponding with Bluetooth commands entirely.
Step 310: bluetooth security equipment sends bluetooth response to Bluetooth adapter;
Step 311: Bluetooth adapter resolves bluetooth response, obtains the effective response data in bluetooth response, according to USB The usb protocol tissue that protocol-identifier matches includes the USB response of effect reply data;
Specifically, bluetooth security equipment resolves bluetooth response according to the protocol type of bluetooth security equipment, and obtaining bluetooth should Effective response data in answering, according to the usb protocol matched with usb protocol mark and effective response data tissue USB response.
Step 312: Bluetooth adapter sends USB response to host computer.
It should be noted that, in the present invention, when the protocol type of bluetooth security equipment be Bluetooth adapter preset time, with bluetooth The usb protocol usb protocol that matches of mark of adapter and the protocol type of bluetooth security equipment can be different agreements or The agreement that person is identical.
It should be noted that, in the present embodiment, the protocol type of bluetooth security equipment can also is that Bluetooth adapter according to The broadcast message of bluetooth security equipment gets, specifically, after step 304, it is also possible to including: Bluetooth adapter is from indigo plant The broadcast message of tooth safety equipment obtains the first protocol-identifier of bluetooth security equipment;Correspondingly, in step 307, bluetooth is adaptive Device according to the protocol type of bluetooth security equipment and effective instruction data tissue Bluetooth commands, particularly as follows: Bluetooth adapter according to The protocol type corresponding with the first protocol-identifier of bluetooth security equipment and USB command tissue Bluetooth commands.
In the present embodiment, when Bluetooth adapter after the step 304, before step 307, from the broadcast of bluetooth security equipment After information obtains the first protocol-identifier of bluetooth security equipment, after step 306, it is also possible to including: Bluetooth adapter is sentenced Disconnected usb protocol identifies whether that the first protocol-identifier with bluetooth security equipment matches, if it is not, then perform step 307;If It is then to perform step g1;
Step g1: Bluetooth adapter sends USB command to bluetooth security equipment;
Step g2: Bluetooth adapter receives the USB response from bluetooth security equipment;
Step g3: USB response is returned to host computer by Bluetooth adapter.
In the present embodiment, when Bluetooth adapter after the step 304, before step 305, wide from from bluetooth security equipment Broadcasting in information after the first protocol-identifier of acquisition bluetooth security equipment, step 307 may be replaced with step: Bluetooth adapter Using USB command as Bluetooth commands;Step 310 may be replaced with step: Bluetooth adapter should as USB using bluetooth response Answer.
In the present embodiment, after step 304, it is also possible to including: Bluetooth adapter detects whether with bluetooth security equipment Disconnect, if it is, Bluetooth adapter resets, return step 302;Otherwise, continue to detect whether and bluetooth security equipment Disconnect.
In the present embodiment, additionally provide the method for work of a kind of Bluetooth adapter, it is adaptable to include Bluetooth adapter, bluetooth Safety equipment and the system of host computer, wherein, Bluetooth adapter includes control chip and Bluetooth chip, concrete as it is shown in figure 5, work as After Bluetooth adapter powers on, including:
Step 401: control chip initializes, Bluetooth chip initializes;
Step 402: control chip sends poll instruction to Bluetooth chip;
In the present embodiment, control chip is after Bluetooth chip sends poll instruction, and control chip etc. is to be received from bluetooth The poll repeat-back of chip.
Specifically, control chip instructs according to the second preset protocol tissue poll, sends poll instruction to Bluetooth chip, treats Receive the poll repeat-back from Bluetooth chip.
Step 403: Bluetooth chip search with preset bluetooth security equipment that device identification matches and establish a connection;
Step 404: Bluetooth chip returns poll repeat-back to control chip;
Specifically, control chip, according to the second preset protocol tissue poll repeat-back, returns poll to Bluetooth chip and refers to Make response.
Step 405: control chip judges whether to set up with bluetooth security equipment to connect according to poll repeat-back, if It is then to perform step 406;Otherwise, continue waiting for receiving the poll repeat-back from Bluetooth chip, when receiving from bluetooth After the poll repeat-back of chip, return step 405;
Specifically, control chip receives after the poll repeat-back of Bluetooth chip, according to the second preset protocol solution Analysis poll repeat-back, obtains the connection result mark in the data field in poll repeat-back, sentences according to connection result mark Break and whether set up connection, if connection result is designated success flag " 00 ", then with bluetooth security equipment with bluetooth security equipment Set up and connect;Otherwise, connection failure.
Step 406: control chip initializes USB module, to the usb protocol mark of host computer statement self;
Step 407: host computer sends USB command to control chip;
Step 408: control chip resolves USB command, obtains the effective instruction data in USB command, according to bluetooth security Effective instruction data are packaged by protocol type and second preset protocol of equipment;
Specifically, control chip, according to the usb protocol parsing USB command matched with usb protocol mark, obtains USB and refers to Effective instruction data in order, effective instruction data are carried out by protocol type and the second preset protocol according to bluetooth security equipment Encapsulation, obtains instructing encapsulation of data.
More specifically, control chip, according to the usb protocol parsing USB command matched with usb protocol mark, obtains Effective instruction data are packaged according to the protocol type of bluetooth security equipment, obtain by the effective instruction data in USB command First encapsulation of data;According to the second preset protocol, the first encapsulation of data is packaged, obtains instructing encapsulation of data;
Step 409: control chip by the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data, be sent to Bluetooth chip;
Specifically, instruction encapsulation of data is sent to Bluetooth chip by control chip;
Step 410: Bluetooth chip from the protocol type according to bluetooth security equipment and the second preset protocol to effective instruction Data be packaged after data in, obtain Bluetooth commands;
Specifically, Bluetooth chip obtains the first encapsulation of data, using the first encapsulation of data as indigo plant from instruction encapsulation of data Tooth instructs.
More specifically, instruction encapsulation of data is unsealed by Bluetooth chip according to the second preset protocol, from instruction encapsulation Data obtain the first encapsulation of data, using the first encapsulation of data as Bluetooth commands.
Step 411: Bluetooth chip sends Bluetooth commands to bluetooth security equipment;
Step 412: bluetooth security equipment resolves Bluetooth commands, organizes the bluetooth response corresponding with Bluetooth commands;
Specifically, bluetooth security equipment resolves Bluetooth commands according to the protocol type of bluetooth security equipment, pacifies according to bluetooth The bluetooth response that the protocol type tissue of equipment is corresponding with Bluetooth commands entirely.
Step 413: bluetooth security equipment sends bluetooth response to Bluetooth chip;
Step 414: Bluetooth chip is according to the second preset protocol encapsulation bluetooth response;
Specifically, Bluetooth chip, according to the second preset protocol encapsulation bluetooth response, obtains response encapsulation of data;
Step 415: Bluetooth chip bluetooth response after control chip sends according to the second preset protocol encapsulation;
Specifically, Bluetooth chip sends response encapsulation of data to control chip;
Step 416: control chip, to according to the bluetooth response after the second preset protocol encapsulation, unseals, obtains bluetooth Effective response data in response, include effect reply data according to identifying, with usb protocol, the usb protocol tissue matched USB response;
Specifically, control chip unseals according to the bluetooth response after the second preset protocol encapsulation, i.e. seals response Dress data unseal, and obtain the effective response data in bluetooth response, identify, according to usb protocol, the usb protocol matched Tissue includes the USB response of effect reply data.
Step 417: control chip sends USB response to host computer.
In the present embodiment, can be, but not limited between Bluetooth chip and control chip by UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiving-transmitting transmitter)/SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI))/I2C (Inter-Integrated Circuit, internal integrated circuit) bus etc. is multiple Mode transmits data.
It should be noted that, the protocol type of bluetooth security equipment can be Bluetooth adapter and bluetooth security equipment is assisted in advance Business is good, and the second preset protocol is to consult in advance between control chip and Bluetooth chip.
It should be noted that, in the present embodiment, the protocol type of bluetooth security equipment can also is that control chip is according to indigo plant The broadcast message of tooth safety equipment gets, and specifically, after step 402, also includes: control chip sends to Bluetooth chip Obtain bluetooth security device identification instruction;Bluetooth chip returns the first protocol-identifier including bluetooth security equipment to control chip Response;
Correspondingly, in step 408 control chip according to the protocol type of bluetooth security equipment and the second preset protocol to having Effect director data is packaged particularly as follows: control chip is according to the protocol class corresponding with the first protocol-identifier of bluetooth security equipment Effective instruction data are packaged by type and the second preset protocol.
In the present embodiment, when control chip after step 405, before step 408, also include: control chip is to bluetooth Chip sends and obtains bluetooth security device identification instruction;Bluetooth chip returns to control chip and includes the first of bluetooth security equipment After the response of protocol-identifier, after step 406, it is also possible to including: control chip judges that usb protocol identifies whether and the first association Assess a bid for tender sensible coupling, when usb protocol mark matches with the first protocol-identifier, perform following steps:
Step m1: USB command is packaged by control chip according to the second preset protocol, obtains instructing encapsulation of data;
Step m2: instruction encapsulation of data is sent to Bluetooth chip by control chip;
Specifically, control chip, by according to the USB command after the second preset protocol encapsulation, is sent to Bluetooth chip;
Step m3: instruction encapsulation of data is unsealed by Bluetooth chip, obtains USB command;
Specifically, the USB command after encapsulation is unsealed by Bluetooth chip according to the second preset protocol, obtains USB command; Instruction encapsulation of data is unsealed by i.e. Bluetooth chip according to the second preset protocol, obtains USB command.
Step m4: Bluetooth chip sends USB command to bluetooth security equipment;Receiving the USB from bluetooth security equipment should Answer;
Step m5: Bluetooth chip, according to the second preset protocol encapsulation USB response, obtains response encapsulation of data;
Step m6: Bluetooth chip sends response encapsulation of data to control chip;
Specifically, Bluetooth chip USB response after control chip sends according to the second preset protocol encapsulation;
Step m7: response encapsulation of data is unsealed by control chip, obtains USB response;
Specifically, control chip is carried out according to the USB response after the second preset protocol encapsulation according to the second preset protocol Deblocking, obtains USB response;Response encapsulation of data is unsealed by i.e. control chip according to the second preset protocol, and obtaining USB should Answer.
Step m8: USB response is returned to host computer by USB module by control chip;
When usb protocol mark is not mated with the first protocol-identifier, perform step 408.
In the present embodiment, when control chip after step 402, before step 406, also include: control chip is to bluetooth Chip sends and obtains bluetooth security device identification instruction;Bluetooth chip returns to control chip and includes the first of bluetooth security equipment After the response of protocol-identifier, the usb protocol of self, particularly as follows: control chip initializes USB module, is identified and arranges by step 406 It is the first protocol-identifier, by USB module to the first protocol-identifier of host computer statement self;
Step 408 is replaced by: USB command is packaged by control chip according to the second preset protocol, obtains instruction envelope Dress data;
Step 409 is replaced by: control chip, by according to the USB command after the second preset protocol encapsulation, will instruct envelope Dress data, are sent to Bluetooth chip;
Step 410 is replaced by: the USB command after encapsulation is unsealed by Bluetooth chip according to the second preset protocol, To USB command, perform step 411;I.e. step 410 is replaced by: Bluetooth chip encapsulates number according to the second preset protocol to instruction According to unsealing, obtain USB command, perform step 411;
Step 416 is replaced by: control chip obtains bluetooth from according to the bluetooth response after the second preset protocol encapsulation Response, using bluetooth response as USB response.That is, step 416 is replaced by: control chip obtains indigo plant from response encapsulation of data Tooth response, using bluetooth response as USB response.
In the present embodiment, after step 406, before step 408, the USB from host computer to be received such as control chip refers to Order, when receiving in Preset Time after the USB command of host computer, performs step 408;When not connecing in Preset Time Receive after the USB command of host computer, it may be judged whether receive having disconnected even with bluetooth security equipment from Bluetooth chip The information connect, if it is, reset Bluetooth chip, reset control chip, returns step 401;Otherwise, continue waiting for receive from The USB command of host computer;
After step 417, control chip returns to waiting for receiving the USB command from host computer.
In the present embodiment, after step 405, also include: control chip judges whether to receive the sum from Bluetooth chip The information that bluetooth security equipment has disconnected, if it is, reset Bluetooth chip, reset control chip, returns step 401; Otherwise, continue to determine whether to receive the information disconnected with bluetooth security equipment from Bluetooth chip.
Embodiment 5
Present embodiments provide the method for work of a kind of Bluetooth adapter, as shown in Figure 6, specifically include:
Step 501: Bluetooth adapter powers on;
Step 502: Bluetooth adapter initializes;
In the present embodiment, Bluetooth adapter initializes control chip and Bluetooth chip.
Step 503: Bluetooth adapter search with preset the bluetooth security equipment and its foundation company that device identification matches Connect;
Specifically, Bluetooth adapter is instructed by control chip tissue poll, sends poll instruction to Bluetooth chip, receives Poll repeat-back from Bluetooth chip.After Bluetooth chip receives poll instruction, search for and preset device identification phase Coupling bluetooth security equipment and establish a connection, to control chip return poll repeat-back.
Wherein, Bluetooth adapter is instructed by control chip tissue poll, particularly as follows: Bluetooth adapter passes through control chip According to the second preset protocol tissue poll instruction.In the present embodiment, poll instruction include: instruction start byte, command identification, The data length of data field, data field and check bit.
Such as, the instruction banner word that " 0x5A " and " 0xA5 " is instructed as poll by Bluetooth adapter by control chip Joint, is arranged in the first byte and second byte of poll instruction, the command identification " 0x02 " instructed as poll, is arranged on In 3rd byte of poll instruction, the data length of the data field during " 0x00 " and " 0x00 " is instructed as poll, set respectively Put on the nybble and the 5th byte of poll instruction, the check value " XOR " that poll is instructed, it is arranged on poll and instructs In later byte (check bit), the poll instruction obtained, particularly as follows: " 5A A5 02 00 00 XOR ", sends to Bluetooth chip Poll instruction " 5A A5 02 00 00 XOR ";Etc. the poll repeat-back from Bluetooth chip to be received.
In the present embodiment, default device identification is default device identification, and wherein, device identification includes: bluetooth equipment UUID (Universally Unique Identifier, general unique identifier), the MAC Address of bluetooth equipment and bluetooth set At least one in standby device name.Wherein, the UUID of bluetooth equipment is the service unique identification information that bluetooth equipment is supported, The MAC Address of bluetooth equipment or the device name of bluetooth equipment are the unique identification information of bluetooth equipment.
In the present embodiment, bluetooth security equipment can be, but not limited to as blue-tooth intelligence key devices and Bluetooth intelligent card etc..
Step 504: Bluetooth adapter judges whether to set up with bluetooth security equipment to connect, if it is, perform step 505;Otherwise, step 504 is returned;
Specifically, when Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, root Judge whether to set up with bluetooth security equipment to connect according to poll repeat-back, if it is, perform step 505;Otherwise, step is returned Rapid 504;
More specifically, Bluetooth adapter receives after the poll repeat-back of Bluetooth chip by control chip, Resolve poll repeat-back according to the second preset protocol, obtain the connection result mark in the data field in poll repeat-back, Judge whether to set up with bluetooth security equipment to connect, if connection result is designated success flag, then according to connection result mark Set up with bluetooth security equipment and connect;Otherwise, connection failure.
Such as, if Bluetooth adapter by control chip receive from the poll repeat-back of Bluetooth chip for " A5 5A 02 00 01 00 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge according to connection result mark " 00 " and bluetooth is pacified Full equipment is set up and is connected;If the poll repeat-back that Bluetooth adapter is received from Bluetooth chip by control chip is " A5 5A 02 00 01 01 XOR ", after obtaining the 5th byte, the data in byte before last byte, and by it Identify as the connection result in the data field in poll repeat-back, then judge do not have and blue according to connection result mark " 01 " Tooth safety equipment are set up and are connected.
Step 505: Bluetooth adapter is to the CCID protocol mark of host computer statement self;
Specifically, Bluetooth adapter initializes USB module by the control chip of self, to host computer statement self CCID protocol identifies.
Step 506: the CCID from host computer to be received such as Bluetooth adapter instructs, and arrives when receiving in Preset Time After the CCID of host computer instructs, perform step 507;Instruct when being not received by the CCID from host computer in Preset Time After, detect whether to disconnect with bluetooth security equipment, if it is, Bluetooth adapter resets, return step 502;Otherwise, Return step 506;
Preferably, Preset Time is 3 seconds.
In the present embodiment, Bluetooth adapter resets, particularly as follows: the Bluetooth chip in Bluetooth adapter resets, and control chip Reset.After Bluetooth adapter resets, host computer detects the Bluetooth adapter on usb bus and upper by the hub of self Position machine disconnects.
Step 507: Bluetooth adapter sends CCID instruction to bluetooth security equipment;
Specifically, Bluetooth adapter sends CCID instruction by Bluetooth chip to bluetooth security equipment.
Such as, Bluetooth adapter sends CCID by Bluetooth chip to bluetooth security equipment and instructs " 6F070000 00000400 00000000 0047474b80A7”。
Step 508: Bluetooth adapter receives the CCID response from bluetooth security equipment;
Specifically, Bluetooth adapter receives the CCID response from bluetooth security equipment by Bluetooth chip.
Such as, the CCID response that Bluetooth adapter is received from bluetooth security equipment by Bluetooth chip is “80830000000106000000006AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8 FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1D CF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC 5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D0F9000 66”。
Step 509: CCID response is returned to host computer by Bluetooth adapter, returns step 506;
In the present embodiment, step 507 can specifically include as in Figure 6-1:
Step 5071: CCID instruction is packaged by control chip according to the second preset protocol;
Specifically, control chip adds the second preset protocol head in CCID instruction, presets checking algorithm to bag according to second Include CCID instruction and the data of the second preset protocol head carry out computing, obtain the second check value, after CCID instructs, add the Two check values, the CCID instruction after being encapsulated, using the CCID instruction after encapsulation as instruction encapsulation of data.
Such as, " 6F,070,000 00,000,400 00000000 0047474b80 A7 " is front adds in CCID instruction for control chip Add the second preset protocol head " 5A A5 04 0013 ", obtain including CCID instruction and the data " 5A of the second preset protocol head A50400136F070000 00,000,400 00000000 0047474b80 A7 ", according to LRC checking algorithm to including that CCID refers to The data of order and the second preset protocol head carry out computing, obtain the second check value " 00 ", add the second school after CCID instructs Testing value, the CCID after obtaining according to the second preset protocol head encapsulation instructs " 5A A5 04 00 13 6F 07 00 00 00 00 04 00 00 00 00 00 00 47 47 4b 80 A7 00”。
Step 5072: control chip, by according to the CCID instruction after the second preset protocol encapsulation, is sent to Bluetooth chip;
Step 5073: the CCID instruction after encapsulation is unsealed by Bluetooth chip according to the second preset protocol, obtains CCID Instruction;
Specifically, the CCID instruction after encapsulation is unsealed by Bluetooth chip to according to the second preset protocol, from according to the CCID instruction after encapsulation is carried out in the data that solution is honored as a queen by two preset protocol, obtains CCID instruction.
Such as, the data after being packaged effective instruction data according to the second preset protocol are unsealed by Bluetooth chip The data obtained are " 5AA,504 0013 6F,070,000 00,000,400 00000000 0047474b80 A7 00 ", obtain the After two preset protocol heads, the data in all bytes before the second check value, the data " 6F070000 that will get 00000400 00000000 0047474b80 A7 " instruct as CCID.
Step 5074: Bluetooth chip sends CCID instruction to bluetooth security equipment.
Correspondingly, step 508 can specifically include as in fig. 6-2:
Step 5081: Bluetooth chip is according to the second preset protocol encapsulation CCID response;
Specifically, Bluetooth chip added the second preset protocol head before CCID response, preset checking algorithm according to the 3rd The data including the second preset protocol head and CCID response are carried out computing, obtains the 4th check value, add after CCID response Adding the 4th check value, the CCID response after being encapsulated, using the CCID response after encapsulation as response encapsulation of data.
Such as, Bluetooth chip is at CCID response " 80830000000106000000006AF61B6E94C5CE5871D54D3 1F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E94CAB11F0A577461BC384 F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5176BE28F3CE62E9ED1BDE 1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B746F50544C008A7CDC106D 0F9000 66 " before, add the second preset protocol head " A5 5A 04 00 8F ", according to LRC checking algorithm to including that second is pre- If the data of protocol header and CCID response carry out computing, obtain the 4th check value " 00 ", after CCID response, add the 4th school Test value, the CCID response " A55A04008F80830000000106000000006 after obtaining according to the second preset protocol head encapsulation AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91 E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC 5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B 746F50544C008A7CDC106D0F9000 66 00 ", using the CCID response after encapsulation as response encapsulation of data.
Step 5082: Bluetooth chip CCID response after control chip sends according to the second preset protocol encapsulation;
Step 5083: control chip, to according to the CCID response after the second preset protocol encapsulation, unseals, obtains CCID Response.
Specifically, control chip, to according to the CCID response after the second preset protocol encapsulation, unseals, presets second After protocol header, all data before the 4th check value are as CCID response.
Such as, control chip is to according to the CCID response " A55A04008F80830000000 after the second preset protocol encapsulation 106000000006AF61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF 80D2F1436A91E94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129 FB85889161DC5176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8 C5AECE485C9B746F50544C008A7CDC106D0F9000 66 00 ", unseal, obtain the second preset protocol head it After, the data in all bytes before the 4th check value, the data " 8F80830000000106000000006A that will get F61B6E94C5CE5871D54D31F9456F9BA397DE422AC11D75DD95A8FE2895D234CF80D2F1436A91E 94CAB11F0A577461BC384F7E9B8DFBC19CB8055F8B43E8A23B1DCF2FE1BAC129FB85889161DC5 176BE28F3CE62E9ED1BDE1FCB190DD1CBD3417EEB06D1CBE52CC5D490E9B47A8C5AECE485C9B7 46F50544C008A7CDC106D0F9000 66 " as CCID response.
In the present embodiment, the data form of the communication between control chip and Bluetooth chip and the second preset protocol phase Joining, wherein, the second preset protocol is to consult in advance between control chip and Bluetooth chip.Bluetooth chip and control chip it Between can be, but not limited to by UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receipts Send out transmitter)/SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI))/I2C (Inter-Integrated Circuit, internal integrated circuit) the various mode transmission data such as bus.
In the present embodiment, after step 504, it is also possible to including: Bluetooth adapter detects whether with bluetooth security equipment Disconnect, if it is, Bluetooth adapter resets, return step 502;Otherwise, continue to detect whether and bluetooth security equipment Disconnect.Correspondingly, when being not received by Preset Time after the USB command of host computer in step 506, return Step 506.
Embodiment 6
Present embodiments provide a kind of Bluetooth adapter, as it is shown in fig. 7, comprises: first search module the 01, first connection mode Block the 02, first declaration module the 03, first molded tissue block the 04, first sending module the 05, first receiver module the 06, second receiver module 07, minor microstructure module 08 and the second sending module 09;
First search module 01, for searching for and presetting the bluetooth security equipment that device identification matches;
First link block 02, the bluetooth security equipment searched for searching prime modulus block 01 with first is set up and is connected;
First declaration module 03, after being connected with the foundation of bluetooth security equipment when the first link block 02, to host computer State the usb protocol mark of self;
First receiver module 06, for receiving the USB command from host computer;
First molded tissue block 04, receives for the protocol type according to bluetooth security equipment and the first receiver module 06 USB command tissue Bluetooth commands;
First sending module 05, for sending Bluetooth commands to bluetooth security equipment;
Second receiver module 07, for receiving the bluetooth response from bluetooth security equipment;
Minor microstructure module 08, identifies for the bluetooth response received according to the second receiver module 07 with usb protocol The usb protocol tissue USB response matched;
Second sending module 09, for returning to host computer by USB response.
In the present embodiment, usb protocol is specially CCID protocol or SCSI protocol or HID protocol or other agreements.
In the present embodiment, Bluetooth adapter can also include the first acquisition module;
First acquisition module, after being connected with the foundation of bluetooth security equipment when the first link block 02, from bluetooth security The broadcast message of equipment obtains the first protocol-identifier of bluetooth security equipment;
Correspondingly, the first molded tissue block 04, specifically for according to corresponding with the first protocol-identifier of bluetooth security equipment Protocol type and USB command tissue Bluetooth commands.
In the present embodiment, the first molded tissue block 04, specifically for obtaining the effective instruction data in USB command, according to indigo plant The protocol type of tooth safety equipment and effective instruction data tissue Bluetooth commands;
Minor microstructure module 08, specifically for obtaining the effective response data in bluetooth response, identifies according to usb protocol The usb protocol tissue matched includes the USB response of effect reply data.
Further, Bluetooth adapter can also include the second acquisition module, the first judge module, the 3rd sending module, 3rd receiver module and the 4th sending module;
Second acquisition module, after being connected with the foundation of bluetooth security equipment when the first link block 02, the first tissue mould Before block 04 organizes Bluetooth commands, from the broadcast message of bluetooth security equipment, obtain the first Protocol Standard of bluetooth security equipment Know;
First judge module, for receiving after the USB command of host computer when the first receiver module 06, it is judged that USB Whether protocol-identifier matches with the first protocol-identifier;
3rd sending module, for after the first judge module is judged as YES, sends USB command to bluetooth security equipment;
3rd receiver module, for receiving the USB response from bluetooth security equipment;
4th sending module, for returning to host computer by USB response;
Correspondingly, the first molded tissue block 04, specifically for after the first judge module is judged as NO, obtain in USB command Effective instruction data, according to protocol type and the effective instruction data tissue Bluetooth commands of bluetooth security equipment;
Minor microstructure module 08, specifically for obtaining the effective response data in bluetooth response, identifies according to usb protocol The usb protocol tissue matched includes the USB response of effect reply data.
In the present embodiment, minor microstructure module 08 can specifically include: the first acquiring unit and the first organizational unit;
First acquiring unit, obtains the effective response number in bluetooth response for the protocol type according to bluetooth security equipment According to;
First organizational unit, the usb protocol tissue matched for basis and usb protocol mark includes effect reply data USB response.
In the present embodiment, Bluetooth adapter can also include: the 3rd acquisition module;
3rd acquisition module, after being connected with the foundation of bluetooth security equipment when the first link block 02, the first statement mould Block 03, before the usb protocol mark of host computer statement self, obtains bluetooth security from the broadcast message of bluetooth security equipment First protocol-identifier of equipment;
First declaration module 03, specifically for being set to the first protocol-identifier, to host computer by the usb protocol of self mark State the first protocol-identifier of self;
First molded tissue block 04, specifically for using USB command as Bluetooth commands;
Minor microstructure module 08, specifically for using bluetooth response as USB response.
In the present embodiment, the protocol type of bluetooth security equipment can be that Bluetooth adapter is preset;
Correspondingly: the first molded tissue block 04, specifically for when protocol type and the usb protocol mark of bluetooth security equipment Timing, using USB command as Bluetooth commands;When the protocol type of bluetooth security equipment does not mates with usb protocol mark, obtain Effective instruction data in USB command, according to protocol type and the effective instruction data tissue Bluetooth commands of bluetooth security equipment;
Minor microstructure module 08, specifically for when the protocol type of bluetooth security equipment mates with usb protocol mark, inciting somebody to action Bluetooth response is as USB response;When the protocol type of bluetooth security equipment does not mates with usb protocol mark, obtaining bluetooth should Effective response data in answering, include the USB of effect reply data according to identifying, with usb protocol, the usb protocol tissue matched Response.
In this enforcement, Bluetooth adapter can also include first detection module and the first reseting module;
First receiver module 06, specifically for when the first declaration module 03 is to the usb protocol mark of host computer statement self After, wait the USB command from host computer to be received;When first detection module be detected as no after, wait to be received from host computer USB command;And after USB response is returned to host computer by the second sending module 09, wait the USB from host computer to be received to refer to Order;
First molded tissue block 04, specifically for receiving from host computer in Preset Time when the first receiver module 06 After USB command, according to protocol type and the USB command tissue Bluetooth commands of bluetooth security equipment;
First detection module, for being not received by from host computer in Preset Time when the first receiver module 06 After USB command, detect whether to disconnect with bluetooth security equipment;
First reseting module, for after first detection module is detected as being, resets;
First search module 01, is additionally operable to, after the first reseting module resets, search for and preset what device identification matched Bluetooth security equipment.
In the present embodiment, Bluetooth adapter can also include: the second detection module and the second reseting module;
Second detection module, after being connected with the foundation of bluetooth security equipment when link block and for working as testing result After no, continue to detect whether to disconnect with described bluetooth security equipment;, detect whether to disconnect with bluetooth security equipment Connect;
Second reseting module, for after the second detection module is detected as being, resets;
First search module 01, is additionally operable to, after the second reseting module resets, search for and preset what device identification matched Bluetooth security equipment.
In the present embodiment, usb protocol is specially CCID protocol or SCSI protocol or HID protocol or other agreements.This enforcement The Bluetooth adapter that example provides is after setting up connection with bluetooth security equipment, to the usb protocol mark of PC end report self, blue Tooth adapter is suitable can be identified as HID device or CCID equipment or scsi device or other USB devices by PC end, enhances indigo plant The adaptability of tooth adapter and application.When Bluetooth adapter have received the USB command meeting USB from PC end After, the USB command meeting USB is changed, after obtaining the Bluetooth commands that bluetooth security equipment is capable of identify that, by bluetooth Instruction is sent to bluetooth security equipment, and what the bluetooth response that bluetooth security equipment returns was reconverted into PC end is capable of identify that meets The USB response of USB, and the USB response meeting USB is returned to PC end, finally enable bluetooth security equipment lead to Bluetooth adapter and the PC end of crossing present invention offer communicate.
Embodiment 7
Present embodiments provide a kind of Bluetooth adapter, as shown in Figure 8, including: control chip, Bluetooth chip and USB mould Block;
Control chip includes: first transmitting element the 601, first initialization unit 602, first receives unit 603, first group Knit unit the 604, second transmitting element 605, minor microstructure unit 606 and the 3rd transmitting element 607;
First transmitting element 601, for sending poll instruction to Bluetooth chip;
First initialization unit 602, should for receiving the poll instruction from Bluetooth chip when the first reception unit 603 After answering, initialize USB module, identified to the usb protocol of host computer statement self by USB module;
In the present embodiment, usb protocol is specially CCID protocol or SCSI protocol or HID protocol or other agreements.
First receives unit 603, for receiving the poll repeat-back from Bluetooth chip;Received by USB module From the USB command of host computer;Receive the response encapsulation of data from Bluetooth chip;
First organizational unit 604, is used for the protocol type according to bluetooth security equipment and the second preset protocol to USB command It is packaged, obtains instructing encapsulation of data;
Second transmitting element 605, for being sent to Bluetooth chip by instruction encapsulation of data;
Minor microstructure unit 606, for according to the response encapsulation of data from Bluetooth chip and identifying phase with usb protocol The usb protocol tissue USB response joined;
3rd transmitting element 607, for returning to host computer by USB module by USB response;
Bluetooth chip includes: second receives unit the 701, first search unit 702, first connects unit the 703, the 4th transmission Unit the 704, the 3rd receives unit 705, second acquisition unit the 706, the 5th transmitting element the 707, the 4th receives unit the 708, the 3rd Organizational unit 709 and the 6th transmitting element 710;
Second receives unit 701, instructs for receiving the poll from control chip;
First search unit 702, after receiving poll instruction when the second reception unit 701, searches for and sets The bluetooth security equipment that standby mark matches;
First connects unit 703, is connected for setting up with bluetooth security equipment,
4th transmitting element 704, for returning poll repeat-back to control chip;
3rd receives unit 705, for receiving the instruction encapsulation of data from control chip;
Second acquisition unit 706, for receiving the instruction encapsulation of data that unit 705 receives from the 3rd, obtains bluetooth Instruction;
5th transmitting element 707, refers to for the bluetooth got to bluetooth security equipment transmission second acquisition unit 706 Order;
4th receives unit 708, for receiving the bluetooth response from bluetooth security equipment;
3rd organizational unit 709, should for the bluetooth received according to the second preset protocol encapsulation the 4th reception unit 708 Answer, obtain response encapsulation of data;
6th transmitting element 710, sends the response encapsulation of data of the 3rd organizational unit 709 tissue to control chip.
In the present embodiment, control chip also includes the 7th transmitting element;Bluetooth chip also includes the 8th transmitting element;
7th transmitting element, for answering when the 4th transmitting element 704 of Bluetooth chip returns poll instruction to control chip After answering, send to Bluetooth chip and obtain bluetooth security device identification instruction;
8th transmitting element, for returning the response of the first protocol-identifier including bluetooth security equipment to control chip;
Correspondingly, the first organizational unit 604, specifically for according to corresponding with the first protocol-identifier of bluetooth security equipment USB command is packaged by protocol type and the second preset protocol, obtains instructing encapsulation of data.
In the present embodiment, the first organizational unit 604, can be specifically for obtaining the effective instruction data in USB command, root Effective instruction data are packaged by protocol type and the second preset protocol according to bluetooth security equipment, obtain instruction encapsulation number According to;
Minor microstructure unit 606, can obtain specifically for unsealing the response encapsulation of data from Bluetooth chip Effective response data in bluetooth response, include effect reply data according to identifying, with usb protocol, the usb protocol tissue matched USB response.
In the present embodiment, the first organizational unit 604, it is also possible to specifically for obtaining the effective instruction data in USB command, Effective instruction data are packaged by the protocol type according to bluetooth security equipment, obtain the first encapsulation of data;Pre-according to second If the first encapsulation of data is packaged by agreement, obtain instructing encapsulation of data;Second acquisition unit 706, can specifically for from Instruction encapsulation of data obtains the first encapsulation of data, using the first encapsulation of data as Bluetooth commands.
In the present embodiment, minor microstructure unit 606, it is also possible to specifically for response encapsulation of data is unsealed, obtain Bluetooth response, obtains the effective response data in bluetooth response according to the protocol type of bluetooth security equipment, according to usb protocol The usb protocol tissue that mark matches includes the USB response of effect reply data.
Further, control chip also include the 9th transmitting element, the first judging unit, the first encapsulation unit, the tenth One transmitting element, the second deblocking unit and the 14th transmitting element;Bluetooth chip also includes that the tenth transmitting element, the first deblocking are single Unit, the second encapsulation unit, the 12nd transmitting element, the 5th reception unit and the 13rd transmitting element;
9th transmitting element, for answering when the 4th transmitting element 704 of Bluetooth chip returns poll instruction to control chip After answering, before USB command is packaged by the first organizational unit 604, sends to Bluetooth chip and obtain bluetooth security device identification Instruction;
Tenth transmitting element, for returning the response of the first protocol-identifier including bluetooth security equipment to control chip;
First judging unit, for receiving the USB command from host computer when the first reception unit 603 by USB module After, it is judged that usb protocol identifies whether to match with the first protocol-identifier;When the first judging unit be judged to no after, trigger first Organizational unit 604;
Correspondingly, the first organizational unit 604, specifically for obtaining the effective instruction data in USB command, is pacified according to bluetooth Effective instruction data are packaged by the protocol type of full equipment, obtain the first encapsulation of data;According to the second preset protocol to One encapsulation of data is packaged, and obtains instructing encapsulation of data;Or specifically for obtaining the effective instruction data in USB command, Effective instruction data are packaged by protocol type and the second preset protocol according to bluetooth security equipment, obtain instruction encapsulation number According to.
First encapsulation unit, for after the first judging unit is judged to be, enters USB command according to the second preset protocol Row encapsulation, obtains instructing encapsulation of data;
11st transmitting element, for being sent to Bluetooth chip by instruction encapsulation of data;
First deblocking unit, for unsealing instruction encapsulation of data, obtains USB command;
12nd transmitting element, for sending USB command to bluetooth security equipment;
5th receives unit, for receiving the USB response from bluetooth security equipment;
Second encapsulation unit, for according to the second preset protocol encapsulation USB response, obtaining response encapsulation of data;
13rd transmitting element, for sending response encapsulation of data to control chip;
Second deblocking unit, for unsealing response encapsulation of data, obtains USB response;
14th transmitting element, for returning to host computer by USB module by USB response.
In the present embodiment, control chip can also include the 15th transmitting element;Bluetooth chip can also include the 16th Transmitting element;
15th transmitting element, for returning poll instruction when the 4th transmitting element 704 of Bluetooth chip to control chip After response, the first initialization unit 602 by USB module before the usb protocol of host computer statement self identifies, to bluetooth core Sheet sends and obtains bluetooth security device identification instruction;
16th transmitting element, for including answering of the first protocol-identifier of bluetooth security equipment to control chip return Answer;
First initialization unit 602, specifically for initializing USB module, identifies the usb protocol of self and is set to first Protocol-identifier, by USB module to the first protocol-identifier of host computer statement self;
First organizational unit 604, specifically for being packaged USB command according to the second preset protocol, obtains instruction envelope Dress data;
Second acquisition unit 706, specifically for unsealing instruction encapsulation of data, obtains described USB command;
5th transmitting element 707, specifically for using USB command as Bluetooth commands, send bluetooth to bluetooth security equipment Instruction;
Minor microstructure unit 606, specifically for from response encapsulation of data obtain bluetooth response, using bluetooth response as USB response.
In the present embodiment, the protocol type of bluetooth security equipment is default;
First organizational unit 604, specifically for when the protocol type of bluetooth security equipment and usb protocol mark is mated, According to the second preset protocol, USB command is packaged, obtains instructing encapsulation of data;When bluetooth security equipment protocol type with Usb protocol mark when not mating, obtains the effective instruction data in USB command, according to the protocol type of bluetooth security equipment and Effective instruction data are packaged by the second preset protocol, obtain instructing encapsulation of data;
Second acquisition unit 706, specifically for when the protocol type of bluetooth security equipment and usb protocol mark is mated, From instruction encapsulation of data, obtain USB command, using USB command as Bluetooth commands;When bluetooth security equipment protocol type with When usb protocol mark is not mated, from instruction encapsulation of data, obtain Bluetooth commands;
Minor microstructure unit 606, specifically for when the protocol type of bluetooth security equipment and usb protocol mark is mated, Bluetooth response is obtained, using bluetooth response as USB response from response encapsulation of data;When bluetooth security equipment protocol type with When usb protocol mark is not mated, response encapsulation of data is unsealed, obtain the effective response data in bluetooth response, according to Identify, with usb protocol, the usb protocol tissue matched and include the USB response of effect reply data.
In the present embodiment, control chip can also include the second judging unit and the first reset unit;First receives unit 603 include that the first reception subelement, the second reception subelement and the 3rd receive subelement;
First receives subelement, for when the first initialization unit 602 is to the usb protocol mark of host computer statement self After, wait the USB command from host computer to be received;After the second judging unit is judged as NO, wait to be received from host computer USB command;And after USB response is returned to host computer by the 3rd transmitting element 607, wait the USB from host computer to be received Instruction;
Second receives subelement, for receiving the poll repeat-back from Bluetooth chip;
3rd receives subelement, for receiving the response encapsulation of data from Bluetooth chip;
First organizational unit 604, specifically for receiving from host computer in Preset Time when the first reception unit 603 USB command after, USB command is packaged by protocol type and the second preset protocol according to bluetooth security equipment;
Second judging unit, for being not received by from host computer in Preset Time when the first reception unit 603 After USB command, it may be judged whether receive the information disconnected with bluetooth security equipment from Bluetooth chip;
First reset unit, is used for after the second judging unit is judged as YES, reset Bluetooth chip, reset control chip;
First transmitting element 601, is additionally operable to when the first reset unit reset Bluetooth chip, after reset control chip, Xiang Lan Tooth chip sends poll instruction.
In the present embodiment, control chip can also include: the 3rd judging unit and the second reset unit;
3rd judging unit, for returning after poll repeat-back and oneself to control chip when the 4th transmitting element 704 After body is judged as NO, it may be judged whether receive the information disconnected with bluetooth security equipment from Bluetooth chip;
Second reset unit, is used for after the 3rd judging unit is judged as YES, reset Bluetooth chip, reset control chip;
First transmitting element 601, is additionally operable to when the second reset unit reset Bluetooth chip, after reset control chip, Xiang Lan Tooth chip sends poll instruction.
The above, the only present invention preferably detailed description of the invention, but protection scope of the present invention is not limited thereto, Any those familiar with the art in technical scope disclosed by the invention, the change that can readily occur in or replacement, All should contain within protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims It is as the criterion.

Claims (42)

1. the method for work of a Bluetooth adapter, it is characterised in that including:
Step s1: Bluetooth adapter search with preset bluetooth security equipment that device identification matches and and its foundation be connected;
Step s2: described Bluetooth adapter is to the usb protocol mark of host computer statement self;
Step s3: described Bluetooth adapter receives the USB command from described host computer;
Step s4: described Bluetooth adapter is according to the protocol type of described bluetooth security equipment and described USB command tissue bluetooth Instruction;
Step s5: described Bluetooth adapter sends Bluetooth commands to described bluetooth security equipment;
Step s6: described Bluetooth adapter receives the bluetooth response from described bluetooth security equipment;
Step s7: described Bluetooth adapter identifies, according to described bluetooth response with described usb protocol, the usb protocol group matched Knit USB response;
Step s8: described USB response is returned to described host computer by described Bluetooth adapter.
Method the most according to claim 1, it is characterised in that after described step s1, also include: described Bluetooth adapter The first protocol-identifier of described bluetooth security equipment is obtained from the broadcast message of described bluetooth security equipment;
Described step s4 is particularly as follows: described Bluetooth adapter is according to corresponding with the first protocol-identifier of described bluetooth security equipment Protocol type and described USB command tissue Bluetooth commands.
Method the most according to claim 1, it is characterised in that described step s4 is particularly as follows: described Bluetooth adapter obtains Effective instruction data in described USB command, according to protocol type and the described effective instruction data of described bluetooth security equipment Tissue Bluetooth commands;
Described step s7 particularly as follows: described Bluetooth adapter obtains the effective response data in described bluetooth response, according to institute State the usb protocol usb protocol tissue that matches of mark and include the USB response of described effective response data.
Method the most according to claim 3, it is characterised in that after described step s1, before described step s4, also wraps Include: described Bluetooth adapter obtains the first agreement of described bluetooth security equipment from the broadcast message of described bluetooth security equipment Mark;
After described step s3, also include: described Bluetooth adapter judges that described usb protocol identifies whether and described first agreement Mark matches;
When described usb protocol mark matches with described first protocol-identifier, execution following steps:
Step r1: described Bluetooth adapter sends described USB command to described bluetooth security equipment;
Step r2: described Bluetooth adapter receives the USB response from described bluetooth security equipment;
Step r3: described USB response is returned to host computer by described Bluetooth adapter;
When described usb protocol mark is not mated with described first protocol-identifier, perform described step s4.
Method the most according to claim 3, it is characterised in that described Bluetooth adapter obtains having in described bluetooth response Effect reply data is particularly as follows: described Bluetooth adapter obtains described bluetooth response according to the protocol type of described bluetooth security equipment In effective response data.
Method the most according to claim 1, it is characterised in that after described step s1, also includes before described step s2: Described Bluetooth adapter obtains the first Protocol Standard of described bluetooth security equipment from the broadcast message of described bluetooth security equipment Know;
Described step s2 is set to the first protocol-identifier, upwards particularly as follows: the usb protocol of self is identified by described Bluetooth adapter First protocol-identifier of position machine statement self;
Described step s4 particularly as follows: described Bluetooth adapter using described USB command as Bluetooth commands;
Described step s7 particularly as follows: described Bluetooth adapter using described bluetooth response as USB response.
Method the most according to claim 1, it is characterised in that the protocol type of described bluetooth security equipment is default;
When the protocol type of described bluetooth security equipment mates with described usb protocol mark:
Described step s4 particularly as follows: described Bluetooth adapter using described USB command as Bluetooth commands;
Described step s7 particularly as follows: described Bluetooth adapter using described bluetooth response as USB response;
When the protocol type of described bluetooth security equipment does not mates with described usb protocol mark:
Described step s4 is particularly as follows: described Bluetooth adapter obtains the effective instruction data in described USB command, according to described indigo plant The protocol type of tooth safety equipment and described effective instruction data tissue Bluetooth commands;
Described step s7 particularly as follows: described Bluetooth adapter obtains the effective response data in described bluetooth response, according to institute State the usb protocol usb protocol tissue that matches of mark and include the USB response of described effective response data.
Method the most according to claim 1, it is characterised in that described step s3 is particularly as follows: described Bluetooth adapter waits Receive the USB command from described host computer, when receiving in Preset Time after the USB command of described host computer, hold Row step s4;When being not received by Preset Time after the USB command of described host computer, detect whether and described bluetooth Safety equipment disconnect, if it is, described Bluetooth adapter resets, return step s1;Otherwise, continue waiting for receiving USB command from described host computer;
After described step s8, return described step s3.
Method the most according to claim 1, it is characterised in that also include after described step s1: described Bluetooth adapter Detect whether to disconnect with described bluetooth security equipment, if it is, described Bluetooth adapter resets, return step s1; Otherwise, continue to detect whether to disconnect with described bluetooth security equipment.
Method the most according to claim 1, it is characterised in that described usb protocol is specially CCID protocol or SCSI protocol Or HID protocol.
11. a Bluetooth adapter, it is characterised in that including: the first search module, the first link block, the first declaration module, First molded tissue block, the first sending module, the first receiver module, the second receiver module, minor microstructure module and second send mould Block;
Described first search module, for searching for and presetting the bluetooth security equipment that device identification matches;
Described first link block, for search with described first prime modulus block search to described bluetooth security equipment set up and be connected;
Described first declaration module, after being connected with the foundation of described bluetooth security equipment when described first link block, upwards The usb protocol mark of position machine statement self;
Described first receiver module, for receiving the USB command from described host computer;
Described first molded tissue block, receives for the protocol type according to described bluetooth security equipment and described first receiver module The described USB command tissue Bluetooth commands arrived;
Described first sending module, for sending Bluetooth commands to described bluetooth security equipment;
Described second receiver module, for receiving the bluetooth response from described bluetooth security equipment;
Described minor microstructure module, for the described bluetooth response that receives according to described second receiver module and with described USB The usb protocol tissue USB response that protocol-identifier matches;
Described second sending module, for returning to described host computer by described USB response.
12. Bluetooth adapter according to claim 11, it is characterised in that also include the first acquisition module;
Described first acquisition module, after being connected with the foundation of described bluetooth security equipment when described first link block, from institute State the first protocol-identifier obtaining described bluetooth security equipment in the broadcast message of bluetooth security equipment;
Described first molded tissue block, specifically for according to the protocol class corresponding with the first protocol-identifier of described bluetooth security equipment Type and described USB command tissue Bluetooth commands.
13. Bluetooth adapter according to claim 11, it is characterised in that described first molded tissue block, specifically for obtaining Take the effective instruction data in described USB command, according to protocol type and the described effective instruction number of described bluetooth security equipment According to tissue Bluetooth commands;
Minor microstructure module, specifically for obtaining the effective response data in described bluetooth response, according to described usb protocol mark The usb protocol tissue of sensible coupling includes the USB response of described effective response data.
14. Bluetooth adapter according to claim 13, it is characterised in that also include the second acquisition module, the first judgement Module, the 3rd sending module, the 3rd receiver module and the 4th sending module;
Described second acquisition module, after being connected with the foundation of described bluetooth security equipment when described link block, described first Before molded tissue block tissue Bluetooth commands, from the broadcast message of described bluetooth security equipment, obtain described bluetooth security equipment First protocol-identifier;
Described first judge module, for receiving after the USB command of described host computer when described first receiver module, sentences Disconnected described usb protocol identifies whether to match with described first protocol-identifier;
Described 3rd sending module, for after described first judge module is judged as YES, sends to described bluetooth security equipment Described USB command;
Described 3rd receiver module, for receiving the USB response from described bluetooth security equipment;
Described 4th sending module, for returning to host computer by described USB response;
Described first molded tissue block, specifically for, after described first judge module is judged as NO, obtaining in described USB command Effective instruction data, according to protocol type and the described effective instruction data tissue Bluetooth commands of described bluetooth security equipment.
15. Bluetooth adapter according to claim 13, it is characterised in that described minor microstructure module includes the first acquisition Unit and the first organizational unit;
Described first acquiring unit, obtains having in described bluetooth response for the protocol type according to described bluetooth security equipment Effect reply data;
Described first organizational unit, for according to and the described usb protocol usb protocol tissue that matches of mark include described effectively The USB response of reply data.
16. Bluetooth adapter according to claim 11, it is characterised in that also include: the 3rd acquisition module;
Described 3rd acquisition module, after being connected with the foundation of described bluetooth security equipment when described first link block, described First declaration module is before the usb protocol mark of host computer statement self, from the broadcast message of described bluetooth security equipment Obtain the first protocol-identifier of described bluetooth security equipment;
Described first declaration module, specifically for being set to the first protocol-identifier, to host computer sound by the usb protocol of self mark Self the first protocol-identifier bright;
Described first molded tissue block, specifically for using described USB command as Bluetooth commands;
Described minor microstructure module, specifically for using described bluetooth response as USB response.
17. Bluetooth adapter according to claim 11, it is characterised in that the protocol type of described bluetooth security equipment is Preset;
Described first molded tissue block, specifically for when protocol type and the described usb protocol mark of described bluetooth security equipment Timing, using described USB command as Bluetooth commands;When the protocol type of described bluetooth security equipment identifies with described usb protocol When not mating, obtain the effective instruction data in described USB command, according to the protocol type of described bluetooth security equipment and described Effective instruction data tissue Bluetooth commands;
Described minor microstructure module, specifically for when protocol type and the described usb protocol mark of described bluetooth security equipment Timing, using described bluetooth response as USB response;When the protocol type of described bluetooth security equipment identifies with described usb protocol When not mating, obtain the effective response data in described bluetooth response, according to the USB association matched with described usb protocol mark View tissue includes the USB response of described effective response data.
18. Bluetooth adapter according to claim 11, it is characterised in that also include that first detection module and first resets Module;
Described first receiver module, specifically for when described first declaration module is to the usb protocol mark of host computer statement self After, wait the USB command from described host computer to be received;When described first detection module be detected as no after, wait to be received from The USB command of described host computer;And after described USB response is returned to described host computer by described second sending module, etc. USB command from described host computer to be received;
Described first molded tissue block, specifically for receiving from described upper when described first receiver module in Preset Time After the USB command of machine, according to protocol type and the described USB command tissue Bluetooth commands of described bluetooth security equipment;
Described first detection module, for being not received by from described upper when described first receiver module in Preset Time After the USB command of machine, detect whether to disconnect with described bluetooth security equipment;
Described first reseting module, for after described first detection module is detected as being, resets;
Described first search module, is additionally operable to, after described first reseting module resets, search for and preset device identification and match Bluetooth security equipment.
19. Bluetooth adapter according to claim 11, it is characterised in that also include that the second detection module and second resets Module;
Described second detection module, after being connected with the foundation of described bluetooth security equipment when described link block and when self Be detected as no after, detect whether to disconnect with described bluetooth security equipment;
Described second reseting module, for after described second detection module is detected as being, resets;
Described first search module, is additionally operable to, after described second reseting module resets, search for and preset device identification and match Bluetooth security equipment.
If 20. according to the Bluetooth adapter described in right 11, it is characterised in that described usb protocol be specially CCID protocol or SCSI protocol or HID protocol.
21. the method for work of a Bluetooth adapter, it is characterised in that described Bluetooth adapter includes control chip, bluetooth core Sheet and USB module;Described method includes:
Step y1: described control chip sends poll instruction to described Bluetooth chip, described Bluetooth chip receives poll instruction Afterwards, search for and preset bluetooth security equipment that device identification matches and establish a connection, return to described control chip Poll repeat-back;
Step y2: described control chip initializes USB module, by described USB module to the usb protocol of host computer statement self Mark;
Step y3: described control chip receives the USB command from host computer by described USB module;
Step y4: described control chip according to the protocol type of described bluetooth security equipment and the second preset protocol to described USB Instruction is packaged, and obtains instructing encapsulation of data;
Step y5: described instruction encapsulation of data is sent to described Bluetooth chip by described control chip;
Step y6: described Bluetooth chip obtains Bluetooth commands from described instruction encapsulation of data;
Step y7: described Bluetooth chip sends Bluetooth commands to bluetooth security equipment;Receive from described bluetooth security equipment Bluetooth response;
Step y8: described Bluetooth chip encapsulates described bluetooth response according to the second preset protocol, obtains response encapsulation of data;
Step y9: described Bluetooth chip sends described response encapsulation of data to described control chip;
Step y10: described control chip is assisted according to described response encapsulation of data and the USB matched with described usb protocol mark View tissue USB response;
Step y11: described USB response is returned to described host computer by described USB module by described control chip.
22. method according to claim 21, it is characterised in that after described step y1, also include: described control chip Send to described Bluetooth chip and obtain bluetooth security device identification instruction;Described Bluetooth chip returns to described control chip and includes The response of the first protocol-identifier of described bluetooth security equipment;
Described step y4 is particularly as follows: described control chip is according to the association corresponding with the first protocol-identifier of described bluetooth security equipment Described USB command is packaged by view type and the second preset protocol, obtains described instruction encapsulation of data.
23. methods according to claim 21, it is characterised in that described step y4 is particularly as follows: described control chip obtains Effective instruction data in described USB command, protocol type and the second preset protocol according to described bluetooth security equipment are to institute State effective instruction data to be packaged, obtain instructing encapsulation of data;
Described step y10, particularly as follows: described response encapsulation of data is unsealed by described control chip, obtains described response encapsulation Effective response data in data, include described effective response according to identifying, with described usb protocol, the usb protocol tissue matched The USB response of data.
24. methods according to claim 21, it is characterised in that described step y4 is particularly as follows: described control chip obtains Effective instruction data in described USB command, according to the protocol type of described bluetooth security equipment to described effective instruction data It is packaged, obtains the first encapsulation of data;According to described second preset protocol, described first encapsulation of data is packaged, obtains Instruction encapsulation of data;
Described step y6 is particularly as follows: described Bluetooth chip obtains the first encapsulation of data from described instruction encapsulation of data, by described First encapsulation of data is as Bluetooth commands.
25. methods according to claim 21, it is characterised in that described step y10 is particularly as follows: described control chip is to institute State response encapsulation of data to unseal, obtain described bluetooth response, obtain institute according to the protocol type of described bluetooth security equipment State the effective response data in bluetooth response, have according to including with the described usb protocol usb protocol tissue that matches of mark The USB response of effect reply data.
26. according to the method described in claim 23 or 24 or 25, it is characterised in that after described step y1, described step y4 The most also include: described control chip sends to described Bluetooth chip and obtains bluetooth security device identification instruction;Described bluetooth core Sheet returns the response of the first protocol-identifier including described bluetooth security equipment to described control chip;
After described step y3, also include: described control chip judges that described usb protocol identifies whether and described first Protocol Standard Sensible coupling, when described usb protocol mark matches with described first protocol-identifier, execution following steps:
Step m1: described USB command is packaged by described control chip according to the second preset protocol, obtains instruction encapsulation number According to;
Step m2: described instruction encapsulation of data is sent to Bluetooth chip by described control chip;
Step m3: described instruction encapsulation of data is unsealed by described Bluetooth chip, obtains described USB command;
Step m4: described Bluetooth chip sends described USB command to described bluetooth security equipment;Receive from described bluetooth security The USB response of equipment;
Step m5: described Bluetooth chip encapsulates described USB response according to the second preset protocol, obtains response encapsulation of data;
Step m6: described Bluetooth chip sends described response encapsulation of data to described control chip;
Step m7: described response encapsulation of data is unsealed by described control chip, obtains described USB response;
Step m8: described USB response is returned to described host computer by described USB module by described control chip;
When described usb protocol mark is not mated with described first protocol-identifier, perform step y4.
27. methods according to claim 21, it is characterised in that after described step y1, also wrap before described step y2 Include: described control chip sends to described Bluetooth chip and obtains bluetooth security device identification instruction;Described Bluetooth chip is to described Control chip returns the response of the first protocol-identifier including described bluetooth security equipment;
The usb protocol of self, particularly as follows: described control chip initializes USB module, is identified and is set to first by described step y2 Protocol-identifier, by described USB module to the first protocol-identifier of host computer statement self;
Described step y4, particularly as follows: described USB command is packaged by described control chip according to the second preset protocol, is referred to Make encapsulation of data;
Described step y6 obtains described USB command particularly as follows: described Bluetooth chip carries out deblocking to described instruction encapsulation of data;
Described step y7 particularly as follows: described Bluetooth chip using described USB command as Bluetooth commands, to described bluetooth security equipment Send described Bluetooth commands;Receive the bluetooth response from described bluetooth security equipment;
Described step y10 is particularly as follows: described control chip obtains described bluetooth response from described response encapsulation of data, by described Bluetooth response is as USB response.
28. methods according to claim 21, it is characterised in that the protocol type of described bluetooth security equipment is default 's;
When the protocol type of described bluetooth security equipment mates with described usb protocol mark:
Described step y4, particularly as follows: described USB command is packaged by described control chip according to the second preset protocol, is referred to Make encapsulation of data;
Described USB, particularly as follows: described Bluetooth chip obtains USB command from described instruction encapsulation of data, is referred to by described step y6 Order is as Bluetooth commands;
Described step y10 is particularly as follows: described control chip obtains described bluetooth response from described response encapsulation of data, by described Bluetooth response is as USB response;
When the protocol type of described bluetooth security equipment does not mates with described usb protocol mark:
Described step y4 is particularly as follows: described control chip obtains the effective instruction data in described USB command, according to described bluetooth Described effective instruction data are packaged by protocol type and second preset protocol of safety equipment, obtain instructing encapsulation of data;
Described step y10, particularly as follows: described response encapsulation of data is unsealed by described control chip, obtains described bluetooth response In effective response data, include described effective response data according to the described usb protocol usb protocol tissue that matches of mark USB response.
29. methods according to claim 21, it is characterised in that described step y3 is particularly as follows: described control chip waits Receive the USB command from described host computer, when receiving in Preset Time after the USB command of described host computer, hold Row step y4;When being not received by Preset Time after the USB command of described host computer, it may be judged whether receive from The information disconnected with described bluetooth security equipment of described Bluetooth chip, if it is, described reset Bluetooth chip, multiple Position control chip, returns step y1;Otherwise, continue waiting for receiving the USB command from described host computer;
After described step y11, return step y3.
30. methods according to claim 21, it is characterised in that also include after described step y1: described control chip Judge whether to receive the information disconnected with described bluetooth security equipment from described Bluetooth chip, if it is, Reset Bluetooth chip, reset control chip, return step y1;Otherwise, continue to determine whether to receive from described Bluetooth chip And the information that disconnected of described bluetooth security equipment.
If 31. according to the method described in right 21, it is characterised in that described usb protocol is specially CCID protocol or SCSI association View or HID protocol.
32. 1 kinds of Bluetooth adapter, it is characterised in that including: control chip, Bluetooth chip and USB module;
Described control chip includes: the first transmitting element, the first initialization unit, first receive unit, the first organizational unit, the Two transmitting elements, minor microstructure unit and the 3rd transmitting element
Described first transmitting element, for sending poll instruction to described Bluetooth chip;
Described first initialization unit, instructs for the poll received from described Bluetooth chip when described first reception unit After response, initialize USB module, identified to the usb protocol of host computer statement self by described USB module;
Described first receives unit, for receiving the poll repeat-back from described Bluetooth chip;Connect by described USB module Receive the USB command from host computer;Receive the response encapsulation of data from described Bluetooth chip;
Described first organizational unit, is used for the protocol type according to described bluetooth security equipment and the second preset protocol to described USB command is packaged, and obtains instructing encapsulation of data;
Described second transmitting element, for being sent to described Bluetooth chip by described instruction encapsulation of data;
Described minor microstructure unit, and assists from the described response encapsulation of data of described Bluetooth chip with described USB for basis The usb protocol tissue USB response of sensible coupling of assessing a bid for tender;
Described 3rd transmitting element, for returning to described host computer by described USB module by described USB response;
Described Bluetooth chip includes: second receive unit, the first search unit, first connect unit, the 4th transmitting element, the 3rd Receive unit, second acquisition unit, the 5th transmitting element, the 4th reception unit, the 3rd organizational unit and the 6th transmitting element;
Described second receives unit, instructs for receiving the poll from control chip;
Described first search unit, after receiving poll instruction when described second reception unit, searches for and presets equipment The described bluetooth security equipment that mark matches;
Described first connects unit, is connected for setting up with described bluetooth security equipment,
Described 4th transmitting element, for returning poll repeat-back to described control chip;
3rd receives unit, for receiving the instruction encapsulation of data from described control chip;
Described second acquisition unit, for obtaining Bluetooth commands from described instruction encapsulation of data;
Described 5th transmitting element, for sending, to bluetooth security equipment, the Bluetooth commands that second acquisition unit gets;
Described 4th receives unit, for receiving the bluetooth response from described bluetooth security equipment;
Described 3rd organizational unit, should for the bluetooth received according to the described 4th reception unit of the second preset protocol encapsulation Answer, obtain response encapsulation of data;
Described 6th transmitting element, sends described response encapsulation of data to described control chip.
33. Bluetooth adapter according to claim 32, it is characterised in that described control chip also includes that the 7th transmission is single Unit;Described Bluetooth chip also includes the 8th transmitting element;
Described 7th transmitting element, for when described 4th transmitting element of described Bluetooth chip is to described control chip Returning wheel After asking repeat-back, send to described Bluetooth chip and obtain bluetooth security device identification instruction;
Described 8th transmitting element, for returning the first protocol-identifier including described bluetooth security equipment to described control chip Response;
Described first organizational unit, specifically for according to the protocol class corresponding with the first protocol-identifier of described bluetooth security equipment Described USB command is packaged by type and the second preset protocol, obtains described instruction encapsulation of data.
34. Bluetooth adapter according to claim 32, it is characterised in that described first organizational unit, specifically for obtaining Take the effective instruction data in described USB command, according to protocol type and second preset protocol pair of described bluetooth security equipment Described effective instruction data are packaged, and obtain instructing encapsulation of data;
Described minor microstructure unit, specifically for unsealing the described response encapsulation of data from described Bluetooth chip, obtains Take the effective response data in described bluetooth response, include institute according to identifying, with described usb protocol, the usb protocol tissue matched State the USB response of effective response data.
35. Bluetooth adapter according to claim 32, it is characterised in that described first organizational unit, specifically for obtaining Take the effective instruction data in described USB command, according to the protocol type of described bluetooth security equipment to described effective instruction number According to being packaged, obtain the first encapsulation of data;According to described second preset protocol, described first encapsulation of data is packaged, To instruction encapsulation of data;
Described second acquisition unit, specifically for obtaining the first encapsulation of data, by described first from described instruction encapsulation of data Encapsulation of data is as Bluetooth commands.
36. Bluetooth adapter according to claim 32, it is characterised in that described minor microstructure unit, specifically for right Described response encapsulation of data unseals, and obtains described bluetooth response, obtains according to the protocol type of described bluetooth security equipment Effective response data in described bluetooth response, include described according to identifying, with described usb protocol, the usb protocol tissue matched The USB response of effective response data.
37. according to the Bluetooth adapter described in claim 34 or 35 or 36, it is characterised in that described control chip also includes Nine transmitting elements, the first judging unit, the first encapsulation unit, the 11st transmitting element, the second deblocking unit and the 14th send Unit;Described Bluetooth chip also include the tenth transmitting element, first deblocking unit, the second encapsulation unit, the 12nd transmitting element, 5th receives unit and the 13rd transmitting element;
Described 9th transmitting element, for when described 4th transmitting element of described Bluetooth chip is to described control chip Returning wheel After asking repeat-back, before described USB command is packaged by described first organizational unit, sends to described Bluetooth chip and obtain Bluetooth security device identification instructs;
Described tenth transmitting element, for returning the first protocol-identifier including described bluetooth security equipment to described control chip Response;
Described first judging unit, for receiving the USB from host computer when described first reception unit by described USB module After instruction, it is judged that described usb protocol identifies whether to match with described first protocol-identifier;When described first judging unit judges After no, trigger described first organizational unit;
Described first encapsulation unit, for after described first judging unit is judged to be, according to the second preset protocol to described USB command is packaged, and obtains instructing encapsulation of data;
Described 11st transmitting element, for being sent to Bluetooth chip by described instruction encapsulation of data;
Described first deblocking unit, for unsealing described instruction encapsulation of data, obtains described USB command;
Described 12nd transmitting element, for sending described USB command to described bluetooth security equipment;
Described 5th receives unit, for receiving the USB response from described bluetooth security equipment;
Described second encapsulation unit, for encapsulating described USB response according to the second preset protocol, obtains response encapsulation of data;
Described 13rd transmitting element, for sending described response encapsulation of data to described control chip;
Described second deblocking unit, for unsealing described response encapsulation of data, obtains described USB response;
Described 14th transmitting element, for returning to described host computer by described USB module by described USB response.
38. Bluetooth adapter according to claim 32, it is characterised in that described control chip also includes the 15th transmission Unit;Described Bluetooth chip also includes the 16th transmitting element;
Described 15th transmitting element, for returning to described control chip when described 4th transmitting element of described Bluetooth chip After poll repeat-back, described first initialization unit is identified to the usb protocol of host computer statement self by described USB module Before, acquisition bluetooth security device identification instruction is sent to described Bluetooth chip;
Described 16th transmitting element, for returning the first Protocol Standard including described bluetooth security equipment to described control chip The response known;
Described first initialization unit, specifically for initializing USB module, identifies the usb protocol of self and is set to the first association Assess a bid for tender knowledge, by described USB module to the first protocol-identifier of host computer statement self;
Described first organizational unit, specifically for being packaged described USB command according to the second preset protocol, obtains instruction envelope Dress data;
Described second acquisition unit, specifically for unsealing described instruction encapsulation of data, obtains described USB command;
Described 5th transmitting element, specifically for using described USB command as Bluetooth commands, send to described bluetooth security equipment Described Bluetooth commands;
Described minor microstructure unit, specifically for obtaining described bluetooth response, by described bluetooth from described response encapsulation of data Response is as USB response.
39. Bluetooth adapter according to claim 32, it is characterised in that the protocol type of described bluetooth security equipment is Preset;
Described first organizational unit, specifically for when protocol type and the described usb protocol mark of described bluetooth security equipment Timing, is packaged described USB command according to the second preset protocol, obtains instructing encapsulation of data;When described bluetooth security sets When standby protocol type does not mates with described usb protocol mark, obtain the effective instruction data in described USB command, according to institute Described effective instruction data are packaged by protocol type and the second preset protocol of stating bluetooth security equipment, obtain instruction encapsulation Data;
Described second acquisition unit, specifically for when protocol type and the described usb protocol mark of described bluetooth security equipment Timing, from described instruction encapsulation of data, obtains USB command, using described USB command as Bluetooth commands;When described bluetooth is pacified When the protocol type of full equipment does not mates with described usb protocol mark, from described instruction encapsulation of data, obtain Bluetooth commands;
Described minor microstructure unit, specifically for when protocol type and the described usb protocol mark of described bluetooth security equipment Timing, obtains described bluetooth response, using described bluetooth response as USB response from described response encapsulation of data;When described indigo plant When the protocol type of tooth safety equipment does not mates with described usb protocol mark, described response encapsulation of data is unsealed, obtain Effective response data in described bluetooth response, include described according to identifying, with described usb protocol, the usb protocol tissue matched The USB response of effective response data.
40. Bluetooth adapter according to claim 32, it is characterised in that described control chip also includes the second judgement list Unit and the first reset unit;Described first receives unit includes the first reception subelement, the second reception subelement and the 3rd reception Subelement;
Described first receives subelement, for when described first initialization unit is to the usb protocol mark of host computer statement self After, wait the USB command from described host computer to be received;After described second judging unit is judged as NO, wait to be received from The USB command of described host computer;And after described USB response is returned to described host computer by described 3rd transmitting element, etc. USB command from described host computer to be received;
Described second receives subelement, for receiving the poll repeat-back from described Bluetooth chip;
Described 3rd receives subelement, for receiving the described response encapsulation of data from described Bluetooth chip;
Described first organizational unit, specifically for receiving from described upper when described first reception unit in Preset Time After the USB command of machine, described USB command is sealed by protocol type and the second preset protocol according to described bluetooth security equipment Dress;
Described second judging unit, for being not received by from described upper when described first reception unit in Preset Time After the USB command of machine, it may be judged whether receive from described Bluetooth chip and described bluetooth security equipment disconnected Information;
Described first reset unit, for after described second judging unit is judged as YES, reset described Bluetooth chip, reset institute State control chip.
41. Bluetooth adapter according to claim 32, it is characterised in that described control chip also includes: the 3rd judges Unit and the second reset unit;
Described 3rd judging unit, for when described 4th transmitting element to described control chip return after poll repeat-back with And after self is judged as NO, it may be judged whether receive disconnecting with described bluetooth security equipment from described Bluetooth chip Information;
Described second reset unit, for after described 3rd judging unit is judged as YES, reset described Bluetooth chip, reset institute State control chip;
Described first transmitting element, is additionally operable to when the described second reset unit described Bluetooth chip of reset, and reset described control core After sheet, send poll instruction to described Bluetooth chip.
42. Bluetooth adapter according to claim 32, it is characterised in that described usb protocol be specially CCID protocol or SCSI protocol or HID protocol.
CN201610864548.XA 2016-09-29 2016-09-29 A kind of Bluetooth adapter and its working method Active CN106301488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610864548.XA CN106301488B (en) 2016-09-29 2016-09-29 A kind of Bluetooth adapter and its working method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610864548.XA CN106301488B (en) 2016-09-29 2016-09-29 A kind of Bluetooth adapter and its working method

Publications (2)

Publication Number Publication Date
CN106301488A true CN106301488A (en) 2017-01-04
CN106301488B CN106301488B (en) 2018-11-20

Family

ID=57715455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610864548.XA Active CN106301488B (en) 2016-09-29 2016-09-29 A kind of Bluetooth adapter and its working method

Country Status (1)

Country Link
CN (1) CN106301488B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135476A (en) * 2017-06-27 2017-09-05 飞天诚信科技股份有限公司 A kind of Bluetooth adapter and its method of work
CN107885674A (en) * 2017-10-18 2018-04-06 北京明华联盟科技有限公司 Bluetooth equipment simulator and its method of work, bluetooth equipment operating system
CN109428658A (en) * 2017-08-29 2019-03-05 深圳市美好创亿医疗科技有限公司 Bluetooth equipment Performance Test System and test method
CN112770307A (en) * 2020-12-31 2021-05-07 重庆百瑞互联电子技术有限公司 Multi-mode Bluetooth adapter and working method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040125782A1 (en) * 2002-12-12 2004-07-01 Chang William Ho Method for wireless communication between computing devices
US20130031392A1 (en) * 2011-07-29 2013-01-31 Mclane William J Usb device side wake-up for power conservation and management
CN104346722A (en) * 2014-10-27 2015-02-11 飞天诚信科技股份有限公司 Mobile payment terminal supporting Bluetooth communication and work method of mobile payment terminal
CN105005540A (en) * 2015-05-22 2015-10-28 飞天诚信科技股份有限公司 CCID equipment with Bluetooth interface and working method of CCID equipment
CN105162498A (en) * 2015-09-28 2015-12-16 飞天诚信科技股份有限公司 Bluetooth adapter and communication method thereof
CN205608729U (en) * 2016-04-19 2016-09-28 飞天诚信科技股份有限公司 Integral type bluetooth key

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040125782A1 (en) * 2002-12-12 2004-07-01 Chang William Ho Method for wireless communication between computing devices
US20130031392A1 (en) * 2011-07-29 2013-01-31 Mclane William J Usb device side wake-up for power conservation and management
CN104346722A (en) * 2014-10-27 2015-02-11 飞天诚信科技股份有限公司 Mobile payment terminal supporting Bluetooth communication and work method of mobile payment terminal
CN105005540A (en) * 2015-05-22 2015-10-28 飞天诚信科技股份有限公司 CCID equipment with Bluetooth interface and working method of CCID equipment
CN105162498A (en) * 2015-09-28 2015-12-16 飞天诚信科技股份有限公司 Bluetooth adapter and communication method thereof
CN205608729U (en) * 2016-04-19 2016-09-28 飞天诚信科技股份有限公司 Integral type bluetooth key

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135476A (en) * 2017-06-27 2017-09-05 飞天诚信科技股份有限公司 A kind of Bluetooth adapter and its method of work
CN109428658A (en) * 2017-08-29 2019-03-05 深圳市美好创亿医疗科技有限公司 Bluetooth equipment Performance Test System and test method
CN107885674A (en) * 2017-10-18 2018-04-06 北京明华联盟科技有限公司 Bluetooth equipment simulator and its method of work, bluetooth equipment operating system
CN107885674B (en) * 2017-10-18 2020-05-29 北京明华联盟科技有限公司 Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN112770307A (en) * 2020-12-31 2021-05-07 重庆百瑞互联电子技术有限公司 Multi-mode Bluetooth adapter and working method thereof

Also Published As

Publication number Publication date
CN106301488B (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN106301488A (en) A kind of Bluetooth adapter and method of work thereof
JP6571341B2 (en) Power supply method, device and program for audio use
US9459604B2 (en) Methods and system for joining a smart energy device to a zigbee network
US20100115108A1 (en) Wireless device and method for automatically establishing wireless connection
CN105050083A (en) Network configuration method and system for intelligent equipment
CN106686526B (en) Method and device for acquiring routing information of electric appliance
CN104781750A (en) Balloon-based positioning system and method
CN208158154U (en) Fast charge line and fast charging system
WO1998054870A3 (en) Method for authorizing couplings between devices in a capability addressable network
CN105743752B (en) The signal acquisition of radio gang meshed network, data transmission method and its internal node device
CN106130770A (en) Use the mixing simple connection establishment of networking of agent equipment
CN104980215A (en) System and method for achieving WiFi configuration of intelligent equipment based on optical signal transmission
CN107943529A (en) Equipment pairing method and device, readable storage medium and interactive intelligent equipment
CN107708116A (en) A kind of method and system realized equipment and exempt from password connection route device
CN108712739A (en) A kind of IOS systems obtain the method and device of Bluetooth address
US8266348B2 (en) System and method of communicating with portable devices
CN108540552A (en) Device interconnection method, apparatus, system, device and storage medium
EP1887756A2 (en) Communication system, connection adapter for communication device, and network router
CN105933428A (en) Method and device for communicating with apple terminal
CN110891260A (en) Bluetooth connection method, equipment, terminal, system and storage medium
WO2003026185A3 (en) Method for joining node into subnet of power line communication network, electronic appliance connected to subnet, and communication module used in electronic appliance
CN106850003A (en) A kind of system and method for detecting low-power consumption bluetooth proper communication
WO2008093164A3 (en) Communication system and method
CN109088882A (en) A kind of method, apparatus, network controller and the system of data transmission
US20090193139A1 (en) Communication apparatus, communication system, communication method and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant