CN105141686B - A kind of method and device for realizing Bluetooth communication - Google Patents

A kind of method and device for realizing Bluetooth communication Download PDF

Info

Publication number
CN105141686B
CN105141686B CN201510510494.2A CN201510510494A CN105141686B CN 105141686 B CN105141686 B CN 105141686B CN 201510510494 A CN201510510494 A CN 201510510494A CN 105141686 B CN105141686 B CN 105141686B
Authority
CN
China
Prior art keywords
ble
sdk
terminal device
agreement
manufacturer
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
CN201510510494.2A
Other languages
Chinese (zh)
Other versions
CN105141686A (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.)
Guiyang Longmaster Information and Technology Co ltd
Original Assignee
Guiyang Longmaster Information and 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 Guiyang Longmaster Information and Technology Co ltd filed Critical Guiyang Longmaster Information and Technology Co ltd
Priority to CN201510510494.2A priority Critical patent/CN105141686B/en
Publication of CN105141686A publication Critical patent/CN105141686A/en
Application granted granted Critical
Publication of CN105141686B publication Critical patent/CN105141686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

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

Abstract

The invention discloses a kind of method and devices for realizing Bluetooth communication, which comprises the bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers is encapsulated into bottom packet;The request for receiving the calling BLE SDK that application is sent, judges manufacturer belonging to the BLE agreement of terminal device, calls corresponding BLE SDK from the bottom packet according to manufacturer belonging to the BLE agreement of terminal device;Data are obtained from BLE equipment using corresponding BLE SDK, the data that will acquire are adjusted back to the application.The present invention can largely guarantee that BLE communication communicates in various equipment.

Description

A kind of method and device for realizing Bluetooth communication
Technical field
The present invention relates to wireless communication technique, espespecially a kind of method and device for realizing Bluetooth communication.
Background technique
Android (Android) system supports bluetooth low energy consumption (BLE) since 4.3 (API18), and provides for applying Program looks equipment, query service and the interface with read/write.Since Android is open source, Google (Google) is powerless always Propulsion 4.3 is popularized, so that Android also becomes the state wrestled, fallen apart in many ways to the support of bluetooth 4.0.In addition to Google is provided on Android 4.3 outside primary support BLE, and there are also Samsungs and Liang Jia manufacturer, Botong in early stage BLE support is also achieved on the basis of Android4.1~4.2.But Samsung and Botong two are not compatible to the support of BLE.
Since the customization of each manufacturer is different from, variant on each system version, compatibility not can guarantee yet, according to The application for the different SDK exploitation that each manufacturer provides can only just adapt to certain a kind of mobile phone, for different vendor due to mutually not simultaneous Hold with regard to needing to re-start exploitation.Therefore, many energy are just wasted in compatibility in the exploitation of application.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method and device for realizing Bluetooth communication, Neng Goubao The progress BLE communication in various terminal equipment is applied in card exploitation.
In order to reach the object of the invention, the present invention provides a kind of methods for realizing Bluetooth communication, comprising:
The bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers is encapsulated into bottom packet;
The request for receiving the calling BLE SDK that application is sent, judges manufacturer belonging to the BLE agreement of terminal device, according to Corresponding BLE SDK calls from the bottom packet in manufacturer belonging to the BLE agreement of terminal device;
Data are obtained from BLE equipment using corresponding BLE SDK, the data that will acquire are adjusted back to the application.
Further, manufacturer belonging to the BLE agreement of the judgement terminal device, comprising:
By calling the application programming interface API of the system development platform of the terminal device, terminal device is judged BLE agreement belonging to manufacturer.
Further, the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK。
Further, the method also includes:
After the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, unified calling is also provided to application in top layer Interface.
Further, the terminal device is the terminal device of Android system.
Further, a kind of device for realizing Bluetooth communication, comprising: encapsulation unit, receiving unit, judging unit, calling Unit and data capture unit, in which:
The encapsulation unit, for the bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers to be encapsulated into bottom In layer packet;
The receiving unit, for receiving the request using the calling BLE SDK sent;
The judging unit, for judging manufacturer belonging to the BLE agreement of terminal device;
The call unit calls phase from the bottom packet for manufacturer belonging to the BLE agreement according to terminal device The BLE SDK answered;
The data capture unit, for obtaining data, the data that will acquire from BLE equipment using corresponding BLE SDK It adjusts back to the application.
Further, the judging unit judges manufacturer belonging to the BLE agreement of terminal device, comprising:
By calling the application programming interface API of the system development platform of the terminal device, terminal device is judged BLE agreement belonging to manufacturer.
Further, the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK。
Further, the encapsulation unit is also used to after the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, Unified calling interface is also provided to application in top layer.
Further, the terminal device is the terminal device of Android system.
Compared with prior art, the present invention includes by the bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers It is encapsulated into bottom packet;The request for receiving the calling BLE SDK that application is sent, judges factory belonging to the BLE agreement of terminal device Quotient calls corresponding BLE SDK according to manufacturer belonging to the BLE agreement of terminal device from the bottom packet;Using corresponding BLE SDK obtains data from BLE equipment, and the data that will acquire are adjusted back to the application.The present invention can be protected largely Card BLE communication is communicated in various equipment.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart of the method for realization Bluetooth communication of the invention;
Fig. 2 is the architecture diagram of the device of realization Bluetooth communication of the invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
As shown in Figure 1, the method for realization Bluetooth communication of the invention, comprising:
Step 101: the bluetooth Low Energy Software development kit (BLE SDK) of a variety of manufacturers is encapsulated into bottom packet;
Since support of each manufacturer to BLE is not compatible, opened in the exploitation of application according to the SDK that some manufacturer provides The application of hair can only just adapt to certain a kind of mobile phone, need to re-start exploitation for different vendor.It therefore, will be a variety of in the present invention The BLE SDK of manufacturer is encapsulated into the bottom packet of application, can the manufacturer according to belonging to the BLE agreement of terminal device again from bottom Corresponding BLE SDK is called in packet.
Step 102: receiving the request for the calling BLE SDK that application is sent;
When application needs to carry out bluetooth data communication with BLE equipment, the request for calling BLE SDK is sent.BLE equipment can To be various smart machines, such as blood glucose meter, healthy bracelet.
Step 103: judging manufacturer belonging to the BLE agreement of terminal device;
It can be sentenced by the application programming interface (API) of the system development platform of calling terminal device in the present invention Manufacturer belonging to the disconnected BLE agreement of terminal device out.
Step 104: calling corresponding BLE SDK from bottom packet according to manufacturer belonging to the BLE agreement of terminal device;
BLE SDK calls from bottom packet in the manufacturer according to belonging to the BLE agreement of terminal device in the present invention, realizes and answers With the support for being directed to various vendor-protocols, solves the compatibility issue to each manufacturer's different agreement.
Step 105: data being obtained from BLE equipment using corresponding BLE SDK, the data that will acquire are adjusted back to application.
It calls corresponding BLE SDK to realize the bluetooth connection with BLE equipment in the present invention, obtains data from BLE equipment, and The data that will acquire are adjusted back to application.
Further, the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK。
At least three compatible bluetooth 4.0BLE SDK of mainstream are packaged in the present invention.
Further, after the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, system also is provided to application in top layer One calling interface.Application in from the present invention to top layer provides unified calling interface and is encapsulated in bottom so that application can call BLE SDK in packet.
Further, the terminal device in the present invention is the terminal device of Android system.
As shown in Fig. 2, present invention also provides a kind of devices for realizing Bluetooth communication, comprising: encapsulation unit receives list Member, judging unit, call unit and data capture unit, in which:
Encapsulation unit, for the bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers to be encapsulated into bottom packet In;
Receiving unit, for receiving the request using the calling BLE SDK sent;
Judging unit, for judging manufacturer belonging to the BLE agreement of terminal device;
Call unit calls corresponding BLE for manufacturer belonging to the BLE agreement according to terminal device from bottom packet SDK;
Data capture unit, for obtaining data from BLE equipment using corresponding BLE SDK, the data readjustment that will acquire To application.
Further, judging unit judges manufacturer belonging to the BLE agreement of terminal device, comprising:
By calling the application programming interface API of the system development platform of terminal device, the BLE of terminal device is judged Manufacturer belonging to agreement.
Further, the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK。
Further, encapsulation unit is also used to after the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, also exists Top layer provides unified calling interface to application.
Further, terminal device is the terminal device of Android system.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use Embodiment is not intended to limit the invention.Technical staff in any fields of the present invention is taken off not departing from the present invention Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.

Claims (10)

1. a kind of method for realizing Bluetooth communication characterized by comprising
The bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers is encapsulated into the bottom packet of terminal device;
The request for receiving the calling BLE SDK that application is sent, judges manufacturer belonging to the BLE agreement of terminal device, according to terminal Corresponding BLE SDK calls from the bottom packet in manufacturer belonging to the BLE agreement of equipment;
Data are obtained from BLE equipment using corresponding BLE SDK, the data that will acquire are adjusted back to the application.
2. the method according to claim 1, wherein it is described judgement terminal device BLE agreement belonging to manufacturer, Include:
By calling the application programming interface API of the system development platform of the terminal device, the BLE of terminal device is judged Manufacturer belonging to agreement.
3. the method according to claim 1, wherein the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK.
4. the method according to claim 1, wherein the method also includes:
After the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, unified calling interface is also provided to application in top layer.
5. the method described in one of any according to claim 1~4, which is characterized in that the terminal device is Android system Terminal device.
6. a kind of device for realizing Bluetooth communication characterized by comprising encapsulation unit, receiving unit, judging unit, calling Unit and data capture unit, in which:
The encapsulation unit is set for the bluetooth Low Energy Software development kit BLE SDK of a variety of manufacturers to be encapsulated into terminal In standby bottom packet;
The receiving unit, for receiving the request using the calling BLE SDK sent;
The judging unit, for judging manufacturer belonging to the BLE agreement of terminal device;
The call unit is called from the bottom packet corresponding for manufacturer belonging to the BLE agreement according to terminal device BLE SDK;
The data capture unit, for obtaining data from BLE equipment using corresponding BLE SDK, the data readjustment that will acquire To the application.
7. device according to claim 6, which is characterized in that the judging unit judges the BLE agreement institute of terminal device The manufacturer of category, comprising:
By calling the application programming interface API of the system development platform of the terminal device, the BLE of terminal device is judged Manufacturer belonging to agreement.
8. device according to claim 6, which is characterized in that the BLE SDK of a variety of manufacturers includes at least Google BLE SDK, Samsung BLE SDK and Botong BLE SDK.
9. device according to claim 6, it is characterised in that:
The encapsulation unit is also used to after the BLE SDK of a variety of manufacturers is encapsulated into bottom packet, also in top layer to application Unified calling interface is provided.
10. according to claim 6~9 it is one of any described in device, which is characterized in that the terminal device is Android system Terminal device.
CN201510510494.2A 2015-08-19 2015-08-19 A kind of method and device for realizing Bluetooth communication Active CN105141686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510510494.2A CN105141686B (en) 2015-08-19 2015-08-19 A kind of method and device for realizing Bluetooth communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510510494.2A CN105141686B (en) 2015-08-19 2015-08-19 A kind of method and device for realizing Bluetooth communication

Publications (2)

Publication Number Publication Date
CN105141686A CN105141686A (en) 2015-12-09
CN105141686B true CN105141686B (en) 2019-04-09

Family

ID=54726889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510510494.2A Active CN105141686B (en) 2015-08-19 2015-08-19 A kind of method and device for realizing Bluetooth communication

Country Status (1)

Country Link
CN (1) CN105141686B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105846863B (en) * 2016-05-31 2019-07-05 青岛海信电器股份有限公司 A kind of operating method and equipment based on bluetooth
CN106059635A (en) * 2016-07-15 2016-10-26 北京海誉动想科技股份有限公司 Bluetooth setting method and device for electronic equipment and Bluetooth connection method
CN107643954B (en) * 2016-07-20 2020-08-04 平安科技(深圳)有限公司 SDK access system and method
CN107529132B (en) * 2017-09-05 2021-04-30 北京京东尚科信息技术有限公司 Method and device for transmitting data between Bluetooth device and application program
CN108366127B (en) * 2018-03-07 2021-05-04 北京奇艺世纪科技有限公司 Method and device for acquiring software package
CN109218393B (en) * 2018-07-24 2021-09-21 百度在线网络技术(北京)有限公司 Push implementation method, device, equipment and computer storage medium
CN114025340B (en) * 2021-11-19 2024-03-26 天翼数字生活科技有限公司 Low-power consumption Bluetooth data transmission method, device, equipment and readable storage medium
CN116828435B (en) * 2023-08-30 2023-11-14 北京柚果星空科技有限公司 Equipment forwarding method and system of soft Bluetooth gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724356A (en) * 2012-05-25 2012-10-10 中兴通讯股份有限公司 Information synchronization method and device of access device
CN103559040A (en) * 2013-11-12 2014-02-05 厦门卓讯信息技术有限公司 System and method based on SDK for rapidly building mobile internet application module
CN104144317A (en) * 2013-05-08 2014-11-12 北京航天长峰科技工业集团有限公司 Massive heterogeneous video resource integration method
CN104216839A (en) * 2014-08-29 2014-12-17 宇龙计算机通信科技(深圳)有限公司 Information interaction method, device and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130055308A1 (en) * 2011-08-30 2013-02-28 Devkumar Gandhi Television Media Application Integration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724356A (en) * 2012-05-25 2012-10-10 中兴通讯股份有限公司 Information synchronization method and device of access device
CN104144317A (en) * 2013-05-08 2014-11-12 北京航天长峰科技工业集团有限公司 Massive heterogeneous video resource integration method
CN103559040A (en) * 2013-11-12 2014-02-05 厦门卓讯信息技术有限公司 System and method based on SDK for rapidly building mobile internet application module
CN104216839A (en) * 2014-08-29 2014-12-17 宇龙计算机通信科技(深圳)有限公司 Information interaction method, device and terminal

Also Published As

Publication number Publication date
CN105141686A (en) 2015-12-09

Similar Documents

Publication Publication Date Title
CN105141686B (en) A kind of method and device for realizing Bluetooth communication
US11626748B2 (en) Electronic device and method for wired and wireless charging in electronic device
KR102532366B1 (en) Device for Performing Wireless Charging and Method thereof
CN108702559B (en) Ear wearable type wireless device and system supporting the same
KR102232279B1 (en) Cradle for electronic device
KR102406686B1 (en) Antenna device and electronic device with the same
KR102397407B1 (en) Antenna device and electronic device with the same
US9743226B2 (en) Method for short-range wireless communication and electronic device using the same
KR102270129B1 (en) Wireless control method, control apparatus and server thereof
CN109691151A (en) For controlling the method and system of UICC and EUICC
KR102277460B1 (en) Method for sharing a display and electronic device thereof
KR102279036B1 (en) Wireless data input and output method and apparatus
KR102373225B1 (en) Electronic apparatus and method for providing function
CN104298532B (en) A kind of method for upgrading software and system
CN108476533A (en) Wireless communications method and the electronic equipment that the wireless communications method is provided
US20150220247A1 (en) Electronic device and method for providing information thereof
KR102408649B1 (en) Configuration setting method and device
KR20150098383A (en) Electronic device and operating method thereof
KR102341149B1 (en) Operating method for communication and Electronic device supporting the same
US11368360B2 (en) Electronic device, and software setting method based on subscriber identity module in electronic device
US20200280614A1 (en) Electronic device and method for providing ip network service
US12032938B2 (en) Plug-in installation method, apparatus, and storage medium
KR20150086150A (en) User interface controlling method and apparatus
KR102231851B1 (en) A method for recharging one or more eelectronic devices and a recharging apparatus therefor
KR20160037019A (en) Electronic device, controlling method thereof and recording medium

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