CN106385273B - Bluetooth communication based on response type and Bluetooth communication method - Google Patents

Bluetooth communication based on response type and Bluetooth communication method Download PDF

Info

Publication number
CN106385273B
CN106385273B CN201610821225.2A CN201610821225A CN106385273B CN 106385273 B CN106385273 B CN 106385273B CN 201610821225 A CN201610821225 A CN 201610821225A CN 106385273 B CN106385273 B CN 106385273B
Authority
CN
China
Prior art keywords
unit
instruction
data
abstraction
bluetooth
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.)
Active
Application number
CN201610821225.2A
Other languages
Chinese (zh)
Other versions
CN106385273A (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.)
Kangtai Zhiai Beijing Medical Holding Co ltd
Original Assignee
Beijing Ding Care Technology 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 Beijing Ding Care Technology Co Ltd filed Critical Beijing Ding Care Technology Co Ltd
Priority to CN201610821225.2A priority Critical patent/CN106385273B/en
Publication of CN106385273A publication Critical patent/CN106385273A/en
Application granted granted Critical
Publication of CN106385273B publication Critical patent/CN106385273B/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

Landscapes

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

Abstract

This application discloses a kind of bluetooth communications based on response type, including instruction dispensing unit, search unit, data transmission unit, instruction control unit, hardware push unit, switch unit, operation abstraction unit, status control unit and Date Conversion Unit, described search unit, data transmission unit, instruction control unit, hardware push unit and switch unit are encapsulated in the same package module, the package module is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, the data transmission for being uniformly processed between bluetooth equipment.Disclosed herein as well is utilize a kind of above-mentioned method that the bluetooth communication based on response type carries out Bluetooth communication.The application designs bluetooth communication using command mode as framework, using response type, is encapsulated to bluetooth communication, code is write using response type, avoid multiple readjustment, can significantly simplified code.

Description

Bluetooth communication based on response type and Bluetooth communication method
Technical field
The present invention relates to computer communication fields, specifically, being to be related to a kind of bluetooth communication based on response type And Bluetooth communication method.
Background technology
Bluetooth (Bluetooth) is a kind of short-distance wireless communication technology, is operated in for Alternative digital equipment tooth equipment The wireless networking between cable coupling and realization digital device between computer peripheral equipment.In May, 1998 is by Ericsson, IBM, English 5 company such as Te Er, Nokia, Toshiba has set up Bluetooth Special Interest group (SIG), is responsible for joint and formulates Bluetooth specification.It is blue Tooth is operated in the unified and open 2.4GHz industry in the whole world, science, medicine (Industrial Scientific Medical) frequency Section can share channel width with simultaneous transmission data and voice, at most 8 movable bluetooth equipments, form so-called Gram net (piconet).In each piconet, it is bluetooth master to have 1, remaining 7 are that may be allowed simultaneously from equipment Have and is more locked to main equipment in a manner of suspending (park) from equipment.Multiple picon-et can be overlapped.It is formed and is dissipated Penetrate net (scattern-et).
The Bluetooth specification that SIG is promulgated is exactly Bluetooth wireless communication consensus standard, it defines what bluetooth applications should follow Standard and need requirement to be achieved, including core protocol (Core) and application framework (Profiles) two parts.Protocol specification portion Divide each layer communication protocol for defining bluetooth, it then follows open system interconnection reference model defines Bluetooth protocol from low to high Storehouse it is at all levels.According to the logic function of Bluetooth protocol, protocol stack is divided into three parts from the bottom to top:Transport protocol, Broker protocol and application protocol.
Bluetooth module is a kind of PCBA board of integrated Bluetooth function, is used for short-distance wireless communication, is divided into bluetooth by function Data module and blue tooth voice module.Bluetooth module in the prior art is all to need multiple step setting behaviour in compiling procedure Make, multiple readjustment.
Invention content
Can technical problem to be solved by the invention is to provide a kind of bluetooth based on response type that avoid multiple readjustment Communication module and Bluetooth communication method, the bluetooth communication can realize interaction between bluetooth equipment, avoid interim card.
In order to solve the above technical problems, the present invention provides a kind of bluetooth communication based on response type, it is located at movement In terminal, including instruction dispensing unit, search unit, data transmission unit, instruction control unit, hardware push unit, switch Unit, operation abstraction unit, status control unit and Date Conversion Unit, described search unit, data transmission unit, instruction control Unit, hardware push unit and switch unit processed are encapsulated in the same package module, the package module respectively with described instruction Dispensing unit is mutually coupled with operation abstraction unit, the data transmission for being uniformly processed between bluetooth equipment, wherein
Described instruction dispensing unit, respectively with parallel described search unit, data transmission unit, instruction control unit, Hardware push unit is mutually coupled with switch unit, for described search unit, data transmission unit, instruction control unit, hard Part push unit and switch unit carry out instruction configuration, send search instruction to search unit, transmission data transmission instruction to institute It states data transmission unit, send operational order to described instruction control unit, transmission hardware trigger push instruction to the hardware Push unit and switch order is sent to the switch unit;
Described search unit is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, described for receiving The search instruction for instructing dispensing unit to send, and execute search instruction and obtain nearby just in whole bluetooth equipments of broadcast state, The bluetooth equipment data searched are sent to the operation abstraction unit;
The data transmission unit mutually couples respectively with described instruction dispensing unit and operation abstraction unit, for receiving The data transfer instruction that described instruction dispensing unit is sent, by actual data transfer to the operation abstraction unit, the reality Data refer to the data transmitted when the mobile terminal is interacted with bluetooth equipment;
Described instruction control unit mutually couples respectively with described instruction dispensing unit and operation abstraction unit, for receiving The operational order that described instruction dispensing unit is sent, cooperates with the operation abstraction unit and completes operational order, and the operation refers to Order refer to the application program of the mobile terminal send out binding instruction, Planning Directive and unbinding;
The hardware push unit mutually couples respectively with described instruction dispensing unit and operation abstraction unit, for receiving The hardware trigger push instruction that described instruction dispensing unit is sent, executes hardware trigger push operation, hardware trigger data is passed It send to operation abstraction unit;
The switch unit is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, described for receiving The switch order for instructing dispensing unit to send will determine that the data transfer instruction, operational order and hardware trigger push refer to The switch order whether transmitted is enabled to be sent to the operation abstraction unit;
The operation abstraction unit, it is single with the parallel described search unit, data transmission unit, instruction control respectively Member, hardware push unit are mutually coupled with switch unit and status control unit, the indigo plant for receiving the transmission of described search unit Operational order, the hardware push unit of tooth device data, the real data that the data transmission unit is sent, instruction control unit The switch order whether transmitted that the hardware trigger data and switch unit of transmission are sent is sent to the state control after processing Unit;
The status control unit mutually couples respectively with the operation abstraction unit and Date Conversion Unit, for receiving After the operation abstraction unit treated instruction and data, judged whether normally to get the data, it is normal to obtain After be sent to the Date Conversion Unit;
The Date Conversion Unit is mutually coupled with the status control unit, for receiving in the status control unit The data normally obtained are converted to readable data.
Preferably, further include bluetooth module communication interface, be located in the package module, connect with the package module, For the Bluetooth commands blue-teeth data transmitting defined in instruction dispensing unit, the Bluetooth commands are binding, unbundlings, send The operational order of plan, the blue-teeth data refer to the scrutable data of bluetooth equipment.
Preferably, the Date Conversion Unit is also mutually coupled with Basic API, for character string to be converted to byte, then general Byte conversion is 16 system bytes, and is sent to the Basic API.
The method that the bluetooth communication that disclosed herein as well is a kind of using above-mentioned based on response type carries out Bluetooth communication, Applied between mobile terminal and bluetooth equipment, including step:
Instruction configuration is carried out, described instruction includes search instruction, data transfer instruction, operational order, hardware trigger push Instruction and switch order;
To described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch order into Row encapsulation;
Execute described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch order: It obtains nearby just in whole bluetooth equipments of broadcast state, the bluetooth equipment data searched is sent to operation level of abstraction;It will Actual data transfer is to the operation level of abstraction;It cooperates with the operation level of abstraction and completes operational order, the operational order is Refer to binding instruction, Planning Directive that the application program of the mobile terminal sends out and unbinding;Execute hardware trigger push Operation, by hardware trigger data transmission to operating level of abstraction;Determine that the data transfer instruction, operational order and hardware touch Whether hair push instruction is transmitted, and is sent to operation level of abstraction;
Operate level of abstraction to after execution search instruction, data transfer instruction, operational order, hardware trigger push instruction, And switch order carries out data processing, and state control layer is sent to after processing;
State control layer judges whether normally to get the data, it is normal obtain after be sent to the data conversion layer;
Data conversion layer receives the data obtained in the state control layer, is converted to readable data.
Preferably, by described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch Instruction be encapsulated in a package module, by between the package module and bluetooth equipment carry out data transmission and data turn It changes.
Preferably, character string is converted to byte by the data conversion layer, then by byte conversion is 16 system bytes, concurrently It send to Basic API.
Compared with prior art, bluetooth communication and Bluetooth communication method of the present invention based on response type, reach Following effect is arrived:
1) bluetooth communication based on response type of the application and Bluetooth communication method are used using command mode as framework Response type designs bluetooth communication, is encapsulated to bluetooth communication, code is write using response type, avoided multiple Readjustment, can significantly simplified code;
2) module that this encapsulation is designed using the framework of command mode, makes the use of module more succinct;
3) with command mode framework in the application, Bluetooth communication (news) module is write using response type, it is logical using the bluetooth Believe that module can be to need the application program of Bluetooth communication (news);More smooth user experience and simpler use are brought, is kept away Exempt from application program interim card.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and constitutes the part of the present invention, this hair Bright illustrative embodiments and their description are not constituted improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the bluetooth communication structure chart based on response type of embodiment 1;
Fig. 2 is the Bluetooth communication method flow chart based on response type of embodiment 2.
Specific implementation mode
Some vocabulary has such as been used to censure specific components in specification and claim.Those skilled in the art answer It is understood that hardware manufacturer may call the same component with different nouns.This specification and claims are not with name The difference of title is used as the mode for distinguishing component, but is used as the criterion of differentiation with the difference of component functionally.Such as logical The "comprising" of piece specification and claim mentioned in is an open language, therefore should be construed to " include but do not limit In "." substantially " refer in receivable error range, those skilled in the art can be described within a certain error range solution Technical problem basically reaches the technique effect.In addition, " coupling " word includes any direct and indirect electric property coupling herein Means.Therefore, if it is described herein that a first device is coupled to a second device, then representing the first device can directly electrical coupling It is connected to the second device, or the second device indirectly electrically coupled through other devices or coupling means.Specification Subsequent descriptions be implement the present invention better embodiment, so it is described description be by illustrate the present invention rule for the purpose of, It is not limited to the scope of the present invention.Protection scope of the present invention is when subject to appended claims institute defender.
Below in conjunction with attached drawing, invention is further described in detail, but not as a limitation of the invention.
Embodiment 1:
In conjunction with Fig. 1, a kind of bluetooth communication and Bluetooth communication method based on response type are present embodiments provided, with life Pattern architecture is enabled, bluetooth communication is designed using response type, is specifically included:Instruct dispensing unit 101, search unit 102, number According to transmission unit 103, instruction control unit 104, hardware push unit 105, switch unit 106, operation abstraction unit 107, shape State control unit 108 and Date Conversion Unit 109, wherein
Described instruction dispensing unit 101, respectively with parallel described search unit 102, data transmission unit 103, instruction Control unit 104, hardware push unit 105 and switch unit 106 mutually couple, for described search unit 102, data transmission Unit 103, instruction control unit 104, hardware push unit 105 and switch unit 106 carry out instruction configuration, send search instruction To search unit 102, transmission data transmission instruction to the data transmission unit 103, operational order is sent to described instruction control Unit 104 processed sends hardware trigger push instruction to the hardware push unit 105 and sends switch order and opened to described Close unit 106;
Described search unit 102 is used for respectively with described instruction dispensing unit 101 and operation 107 phase of abstraction unit coupling The search instruction that described instruction dispensing unit 101 is sent is received, and executes search instruction and obtains nearby just in the complete of broadcast state The bluetooth equipment data searched are sent to the operation abstraction unit 107 by portion's bluetooth equipment;
The data transmission unit 103 is coupled with described instruction dispensing unit 101 and operation 107 phase of abstraction unit respectively, Data transfer instruction for receiving the transmission of described instruction dispensing unit 101, actual data transfer is abstract single to the operation Member 107;
Mobile terminal is by Bluetooth transmission to information such as the data of medicine box, such as medicine box token
Described instruction control unit 104 is coupled with described instruction dispensing unit 101 and operation 107 phase of abstraction unit respectively, Operational order for receiving the transmission of described instruction dispensing unit 101, the completion operation that cooperates with the operation abstraction unit 107 refer to It enables;Here operational order refers specifically to binding instruction, sends the medicine boxs control instruction such as Planning Directive, unbinding.
The hardware push unit 105 is coupled with described instruction dispensing unit 101 and operation 107 phase of abstraction unit respectively, Hardware trigger for receiving the transmission of described instruction dispensing unit 101 pushes instruction, hardware trigger push operation is executed, by hardware Trigger data is sent to operation abstraction unit 107;
The switch unit 106 is used for respectively with described instruction dispensing unit 101 and operation 107 phase of abstraction unit coupling The switch order that described instruction dispensing unit 101 is sent is received, will determine the data transfer instruction, operational order and hard The switch order whether part triggering push instruction is transmitted is sent to the operation abstraction unit 107;
Switch unit open and close state is determined that acquiescence is factory set conditions by hardware firmware, passes through later stage firmware version This upgrading can change assigned switch order and determine that switch is to open or close.
The operation abstraction unit 107, respectively with the parallel described search unit 102, data transmission unit 103, Instruction control unit 104, hardware push unit 105 and switch unit 106 and status control unit 108 mutually couple, for connecing Receive the bluetooth equipment data of 102 transmission of described search unit, the real data that the data transmission unit 103 is sent, instruction control Whether the operational order of unit 104 processed, the hardware trigger data of the transmission of hardware push unit 105 and the transmission of switch unit 106 The switch order of transmission is sent to the status control unit 108 after processing;
The status control unit 108 is coupled with the operation abstraction unit 107 and 109 phase of Date Conversion Unit respectively, After instruction that treated for receiving the operation abstraction unit 107 and data, judged whether normally to get specified number According to, it is normal obtain after be sent to the Date Conversion Unit 109;
Middle finger fixed number of the present invention is according to being the practical clothes for returning to application program for mobile terminal after the complete instruction of medicine box hardware handles The information such as medicine record are packaged and return to the state successfully to fail.
The Date Conversion Unit 109 is coupled with 108 phase of the status control unit, for receiving the state control The data normally obtained in unit 108 are converted to readable data.
Described search unit 102, data transmission unit 103, instruction control unit 104, hardware push unit 105 and switch Unit 106 is encapsulated in the same package module, and the package module is abstract single with described instruction dispensing unit 101 and operation respectively First 107 phases coupling, data transmission and data conversion for being uniformly processed between bluetooth equipment.
The bluetooth communication further includes bluetooth module communication interface, is located in the package module, with the Encapsulation Moulds Block connects, for according to Bluetooth commands blue-teeth data transmitting good defined in instruction dispensing unit 101.
Bluetooth commands include binding, unbundlings, send the practical operations such as plan instruction, and blue-teeth data refers to according to Bluetooth protocol The scrutable data of specified bluetooth equipment, such as including detailed associated datas such as binding, unbundlings, practical dosing regimens.
The Date Conversion Unit 109 is also coupled with 110 phase of Basic API, for character string to be converted to byte, then general Byte conversion is 16 system bytes, and is sent to the Basic API 110.Command mode in the application refers to java design moulds " command mode " inside formula, when application software and hardware device on mobile terminal (mobile phone) interact, there are four types of behaviors:Search Bluetooth equipment, to equipment transmission data (instruction and general data may be referred to collectively as transmission data), the data of receiving device.
By taking the medicine box of applicant as an example, application program of mobile phone APP can formulate a dosing regimens and be sent to pill box storage, Medicine box can also be controlled to go to play an order, can also be when medicine box detect that user has eaten medicine, proactive notification mobile phone Application APP, although these interactive processes are all different operation, essence be all send instructions, receive data, search, Connect this four most basic behaviors (can be understood as all be by these behavior combinations at).Different parameters can be set To generate different operations.
So, it is the package module that a software has been fabricated separately in the application, these types behavior is respectively packaged into one A object, application program (APP) need not carry out data interaction with the API of bluetooth bottom again.One specific application APP The order of control bluetooth equipment of course not sends individual instructions, it may be necessary to and several instructing combinations are got up, such as:It is set with bluetooth Standby connect is to need first to search for, and then establishes connection, then the switch that data are received inside bluetooth is opened.These three steps It has been combined into a complete behavior.These three behaviors are packaged into a complete object (Encapsulation Moulds so in the application Block), this object, which just becomes, at this time has a command object of concrete behavior (operation), this is order described herein Pattern.When need this behavior (operation) when, call this package module it is all right, used compared to assembling bluetooth Each step will save many steps.
Bluetooth interaction is an asynchronous process, and application APP interface is stuck in order to prevent, and the application is using response type Literary style writes this module, application APP can be prevented to be stuck.Key technology is that several asynchronous operations are ined succession progress When, response type frame is after having executed first step, and second step is triggered by first, then after second step Third step is triggered, in the management of step, response type it is with better function.
Search unit 102 is called by instruction control unit 104 after searching and binds bluetooth equipment instruction, is operated abstract single Member 107 encapsulates binding information, and binding data (such as token information) is sent to data conversion by data transmission unit 103 Unit 109 converts the data into the data that hardware device can identify, equipment receives the data of the transmission of data transmission unit 103 And after instruction corresponding hardware logic processing is carried out by 110 Basic APIs, and treated result and state are pushed by hardware Unit 105 returns to status control unit 108, and switch unit 106 is a hardware manufacture configuration information, can pass through hardware Firmware upgrade adjusts some on off states.
Embodiment 2:
In conjunction with Fig. 2, a kind of Bluetooth communication method based on response type is present embodiments provided, is applied between bluetooth equipment Communication, including step:
Step 201:Instruction configuration is carried out, described instruction includes search instruction, data transfer instruction, operational order, hardware Triggering push instruction and switch order;
Step 202:To described search instruction, data transfer instruction, operational order, hardware trigger push instruction, Yi Jikai Instruction is closed to be packaged;
By described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch order envelope In a package module, by between the package module and bluetooth equipment carry out data transmission and data conversion.
Step 203:Execute described search instruction, data transfer instruction, operational order, hardware trigger push instruct and Switch order:It obtains nearby just in whole bluetooth equipments of broadcast state, the bluetooth equipment data searched is sent to operation Level of abstraction;By actual data transfer to the operation level of abstraction;It cooperates with the operation level of abstraction and completes operational order, the behaviour Make binding instruction, the Planning Directive and unbinding that the application program that instruction refers to the mobile terminal is sent out;Execute hardware Push operation is triggered, hardware trigger data transmission to operation is abstracted single layer;Determine the data transfer instruction, operational order, And whether hardware trigger push instruction is transmitted, and it is sent to operation level of abstraction;
Step 204:Operation level of abstraction pushes away the search instruction after execution, data transfer instruction, operational order, hardware trigger It send instruction and switch order to carry out data processing, state control layer is sent to after processing;
Step 205:State control layer judges whether normally to get specified data, it is normal obtain after be sent to the data Conversion layer;
Step 206:Data conversion layer receives the data normally obtained in the state control layer, is converted to readable number According to.Character string is converted to byte by the data conversion layer, then by byte conversion is 16 system bytes.
It further include step 207:Data conversion coating is by 16 system bytes and is sent to Basic API.
Binding bluetooth equipment instruction, behaviour are called by instruction control unit after search unit searches in actual application Make abstraction unit to encapsulate binding information, binding data (such as token information) is sent to data by data transmission unit to be turned It changes unit and converts the data into data such as 16 system bytes, bluetooth equipment that hardware device can identify and receive data transmission list Corresponding hardware logic processing is carried out by Basic API after the data of member transmission and instruction, and treated result and state are led to It crosses hardware push unit and returns to status control unit, switch unit is a hardware manufacture configuration information, can pass through hardware Firmware upgrade adjust some on off states.
Embodiment 3:
On the basis of embodiment 1, the present embodiment is Application Example, and the bluetooth communication provided in the present embodiment is One service medicine box that can influence application APP, medicine box mentioned in the present invention are comprising fixer system (Basic API) Intelligent hardware, function is mainly to receive the incoming data in upper layer and various orders are simultaneously handled, and replying mobile terminal (mobile phone) needs The response wanted simultaneously reminds (such as sounding reminding) from the dosing regimens of main response user setting.
For medicine box when binding, the application APP interface prompts user binding of mobile terminal (mobile phone) notifies medicine box Preparing to be bound, after medicine box has received the instruction of preparation, sounding reminding user taps medicine box and is confirmed with showing, after user taps, medicine Box notice application APP user has tapped.After application program of mobile phone APP is notified, change interface display binding is completed.
Using the mode of response type, these steps all completely carry out one by one, previous not complete Cheng Shi, program can wait for, and this waiting will not cause main thread to block, this is response type is used in the application good Place.What the bluetooth communication based on response type and command mode framework of the application was is exactly that application APP is allowed to use When function of Bluetooth communication, the object for simply calling some to order is adjusted back without repeating.
For medicine box under binding state, the application program of mobile terminal (mobile phone) is synchronized pre-set carry with medicine box It wakes up information, is reminded the moment when time is up, medicine box actively triggering can remind operation, and pushed information is to mobile terminal (mobile phone), After opening medicine box and opening medicine box stop operation triggering in 10 seconds, medicine box can generate a practical medication and record user, and will clothes Medicine record information is pushed to mobile terminal (mobile phone), and mobile terminal through the invention can be by transformed letter after module data processing Breath is synchronized to mobile terminal (mobile phone) interface, reaches medicine box prompting and the visible practical medication state of mobile phone.
Compared with prior art, bluetooth communication and Bluetooth communication method of the present invention based on response type, reach Following effect is arrived:
1) encapsulation has been carried out to bluetooth communication in the application, code is write using response type, is avoided multiple Readjustment, can significantly simplified code;
2) module that this encapsulation is designed using the framework of command mode, makes the use of module more succinct;
3) with command mode framework in the application, Bluetooth communication (news) module is write using response type, it is logical using the bluetooth Believe that module can be that the application program of Bluetooth communication (news) is needed to bring more smooth user experience and simpler use, avoids Application program interim card.
Several preferred embodiments of the present invention have shown and described in above description, but as previously described, it should be understood that the present invention Be not limited to form disclosed herein, be not to be taken as excluding other embodiments, and can be used for various other combinations, Modification and environment, and the above teachings or related fields of technology or knowledge can be passed through in the scope of the invention is set forth herein It is modified.And changes and modifications made by those skilled in the art do not depart from the spirit and scope of the present invention, then it all should be in this hair In the protection domain of bright appended claims.

Claims (6)

1. a kind of bluetooth communication based on response type is located in mobile terminal, which is characterized in that single including instruction configuration Member, search unit, data transmission unit, instruction control unit, hardware push unit, switch unit, operation abstraction unit, state Control unit and Date Conversion Unit, described search unit, data transmission unit, instruction control unit, hardware push unit and Switch unit is encapsulated in the same package module, the package module respectively with described instruction dispensing unit and operation abstraction unit It mutually couples, the data transmission for being uniformly processed between bluetooth equipment, wherein
Described instruction dispensing unit, respectively with parallel described search unit, data transmission unit, instruction control unit, hardware Push unit is mutually coupled with switch unit, for being pushed away to described search unit, data transmission unit, instruction control unit, hardware It send unit and switch unit to carry out instruction configuration, sends search instruction to search unit, transmission data transmission instruction to the number According to transmission unit, operational order is sent to described instruction control unit, transmission hardware trigger push instruction to hardware push Unit and switch order is sent to the switch unit;
Described search unit mutually couples respectively with described instruction dispensing unit and operation abstraction unit, for receiving described instruction The search instruction that dispensing unit is sent, and execute search instruction and obtain nearby just in whole bluetooth equipments of broadcast state, it will search Rope to bluetooth equipment data be sent to the operation abstraction unit;
The data transmission unit is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, described for receiving The data transfer instruction for instructing dispensing unit to send, by actual data transfer to the operation abstraction unit, the real data Refer to the data transmitted when the mobile terminal is interacted with bluetooth equipment;
Described instruction control unit is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, described for receiving The operational order for instructing dispensing unit to send, cooperates with the operation abstraction unit and completes operational order, and the operational order is Refer to binding instruction, Planning Directive that the application program of the mobile terminal sends out and unbinding;
The hardware push unit is mutually coupled with described instruction dispensing unit and operation abstraction unit respectively, described for receiving The hardware trigger push instruction that dispensing unit is sent is instructed, executes hardware trigger push operation, extremely by hardware trigger data transmission Operate abstraction unit;
The switch unit mutually couples respectively with described instruction dispensing unit and operation abstraction unit, for receiving described instruction The switch order that dispensing unit is sent will determine that the data transfer instruction, operational order and hardware trigger push instruction are The switch order of no transmission is sent to the operation abstraction unit;
The operation abstraction unit, respectively with the parallel described search unit, data transmission unit, instruction control unit, Hardware push unit is mutually coupled with switch unit and status control unit, the bluetooth for receiving the transmission of described search unit Device data, the real data that the data transmission unit is sent, the operational order of instruction control unit, hardware push unit hair It is single to be sent to the state control for the switch order whether transmitted that the hardware trigger data and switch unit sent are sent after processing Member;
The status control unit is mutually coupled with the operation abstraction unit and Date Conversion Unit respectively, described for receiving After operating abstraction unit treated instruction and data, judged whether normally to get the data, it is normal obtain after send out It send to the Date Conversion Unit;
The Date Conversion Unit is mutually coupled with the status control unit, normal in the status control unit for receiving The data of acquisition are converted to readable data.
2. the bluetooth communication according to claim 1 based on response type, which is characterized in that further include that bluetooth module is logical Believe interface, be located in the package module, connect with the package module, for the bluetooth defined in instruction dispensing unit It is binding, unbundlings, the operational order for sending plan to instruct blue-teeth data transmitting, the Bluetooth commands, and the blue-teeth data refers to The scrutable data of bluetooth equipment.
3. the bluetooth communication according to claim 1 based on response type, which is characterized in that the data conversion list Member is also mutually coupled with Basic API, is 16 system bytes for character string to be converted to byte, then by byte conversion, and be sent to The Basic API.
4. according to the method that any bluetooth communication based on response type carries out Bluetooth communication in claims 1 to 3, Applied between mobile terminal and bluetooth equipment, which is characterized in that including step:
Carry out instruction configuration, described instruction include search instruction, data transfer instruction, operational order, hardware trigger push instruction, And switch order;
Described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch order are sealed Dress;
Execute described search instruction, data transfer instruction, operational order, hardware trigger push instruction and switch order:It obtains Nearby just in whole bluetooth equipments of broadcast state, the bluetooth equipment data searched are sent to operation level of abstraction;It will be practical Data transmission is to the operation level of abstraction;It cooperates with the operation level of abstraction and completes operational order, the operational order refers to institute State binding instruction, Planning Directive that the application program of mobile terminal sends out and unbinding;Execute hardware trigger push behaviour Make, by hardware trigger data transmission to operating level of abstraction;Determine the data transfer instruction, operational order and hardware trigger Whether push instruction is transmitted, and is sent to operation level of abstraction;
Operate level of abstraction to after execution search instruction, data transfer instruction, operational order, hardware trigger push instruction and Switch order carries out data processing, and state control layer is sent to after processing;
State control layer judges whether normally to get the data, it is normal obtain after be sent to the data conversion layer;
Data conversion layer receives the data obtained in the state control layer, is converted to readable data.
5. according to the Bluetooth communication method based on response type described in claim 4, which is characterized in that refer to described search Enable, data transfer instruction, operational order, hardware trigger push instruction and switch order be encapsulated in a package module, lead to Cross between the package module and bluetooth equipment carry out data transmission and data conversion.
6. according to the Bluetooth communication method based on response type described in claim 4, which is characterized in that the data conversion layer Character string is converted into byte, then by byte conversion is 16 system bytes, and is sent to Basic API.
CN201610821225.2A 2016-09-13 2016-09-13 Bluetooth communication based on response type and Bluetooth communication method Active CN106385273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610821225.2A CN106385273B (en) 2016-09-13 2016-09-13 Bluetooth communication based on response type and Bluetooth communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610821225.2A CN106385273B (en) 2016-09-13 2016-09-13 Bluetooth communication based on response type and Bluetooth communication method

Publications (2)

Publication Number Publication Date
CN106385273A CN106385273A (en) 2017-02-08
CN106385273B true CN106385273B (en) 2018-08-07

Family

ID=57936562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610821225.2A Active CN106385273B (en) 2016-09-13 2016-09-13 Bluetooth communication based on response type and Bluetooth communication method

Country Status (1)

Country Link
CN (1) CN106385273B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111060901A (en) * 2019-11-05 2020-04-24 安徽工程大学 AGV (automatic guided vehicle) distance measuring system based on low-power consumption

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7855952B2 (en) * 2008-11-20 2010-12-21 At&T Intellectual Property I, L.P. Silent failure identification and trouble diagnosis
CN105101061A (en) * 2015-08-07 2015-11-25 深圳市广和通无线股份有限公司 Bluetooth communication realization method by means of AT command
CN105846863A (en) * 2016-05-31 2016-08-10 青岛海信电器股份有限公司 Bluetooth based operation method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7855952B2 (en) * 2008-11-20 2010-12-21 At&T Intellectual Property I, L.P. Silent failure identification and trouble diagnosis
CN105101061A (en) * 2015-08-07 2015-11-25 深圳市广和通无线股份有限公司 Bluetooth communication realization method by means of AT command
CN105846863A (en) * 2016-05-31 2016-08-10 青岛海信电器股份有限公司 Bluetooth based operation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
响应式网页设计初探;王愉;《北京印刷学院学报》;20140630;第22卷(第3(2014)期);全文 *
基于Android平台的蓝牙通信***的研究与实现;罗富财;《中国优秀硕士学位论文全文数据库》;20131215(第S2(2013)期);全文 *

Also Published As

Publication number Publication date
CN106385273A (en) 2017-02-08

Similar Documents

Publication Publication Date Title
US20190306275A1 (en) Methods for Software Development, Installation, and Management in Computer Systems and Methods for Controlling Input and Output Data Transfer in Computer Systems
CN105677335B (en) Improve the method and device that mobile terminal first powers on speed
CN105243407B (en) Read and write the method and device of smart card
CN101980152A (en) Mobile middleware system and implementation method thereof
CN108124475A (en) Virtual system Bluetooth communication method and device, virtual system, storage medium and electronic equipment
CN103513976B (en) Service flowpath modelling approach and device
CN108549560A (en) Switching method and apparatus, storage medium, the electronic device of interface state
CN108874677A (en) A kind of android terminal and its test method and system
CN110058850A (en) A kind of development approach of application, device and storage medium
KR101036760B1 (en) Mobile Terminal Comprising Layered Architecture
CN106657101A (en) SDK and method for remote control of different protocol types of wireless communication modules
CN106649446A (en) Information pushing method and device
CN108429006A (en) Electronic equipment with coil antenna
CN106385273B (en) Bluetooth communication based on response type and Bluetooth communication method
CN101415251B (en) Apparatus for implementing data transmission based on Bluetooth
CN110187953A (en) A kind of operation method and device of application program
CN107526584A (en) Data cut-in method and device
CN108733468A (en) Timed task Dynamic Configuration and device, storage medium and server cluster
CN109901830A (en) A kind of symbol arranging method and system for scada system development
CN206350033U (en) A kind of system of rapid build Internet of Things application
CN109445384A (en) A kind of more apparatus control systems
CN104052528B (en) The apparatus and method communicated with multiple terminals in Intelligent worn device
CN109669763A (en) The method, apparatus and system of virtual input control
Buono et al. EUDroid: a formal language specifying the behaviour of IoT devices
CN110275701A (en) Data processing method, device, medium and calculating equipment

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
TR01 Transfer of patent right

Effective date of registration: 20201218

Address after: No. l101, 102-79, Honggao world, No. 792, section 4, Furong South Road, Muyun street, Tianxin District, Changsha City, Hunan Province

Patentee after: Changsha Zhiai Yaohe Medical Technology Co.,Ltd.

Address before: Room 215, 2 / F, building 14, Wenhui Beiyuan, Haidian District, Beijing 100082

Patentee before: BEIJING DINGCARE TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220818

Address after: 100123 2-28, floor 2, building 9, No.3 courtyard, Qingnian Road, Chaoyang District, Beijing

Patentee after: Kangtai Zhiai (Beijing) medical Holding Co.,Ltd.

Address before: No. l101, 102-79, Honggao world, No. 792, section 4, Furong South Road, Muyun street, Tianxin District, Changsha City, Hunan Province

Patentee before: Changsha Zhiai Yaohe Medical Technology Co.,Ltd.

TR01 Transfer of patent right