CN114980057B - Method for quickly connecting system equipment with low-power consumption Bluetooth equipment - Google Patents
Method for quickly connecting system equipment with low-power consumption Bluetooth equipment Download PDFInfo
- Publication number
- CN114980057B CN114980057B CN202210704691.8A CN202210704691A CN114980057B CN 114980057 B CN114980057 B CN 114980057B CN 202210704691 A CN202210704691 A CN 202210704691A CN 114980057 B CN114980057 B CN 114980057B
- Authority
- CN
- China
- Prior art keywords
- ble
- hong
- connection
- bluetooth
- monte
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. TPC [Transmission Power Control], power saving or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a method for quickly connecting system equipment with low-power consumption Bluetooth equipment, which comprises the following steps: developing and realizing BLE GATT server-side programs based on hong Meng Lanya API at hong Mongolian equipment end; starting a guide component function adding service component through hong Meninit; executing a BLE server program to broadcast out the BLE GATT service added by the hong Monte device; the BLE server program registers a callback method for monitoring the connection information of the GATT; bluetooth control equipment end scans and initiates BLE connection; the BLE service at the hong Monte device end receives connection; the hong Monte device end establishes connection after starting up, wherein the Bluetooth control device end sends a control instruction, and the hong Monte device end is connected with the control instruction. The invention can realize the capability of quickly supporting the connection of other BLE devices, and can automatically establish the BLE connection when the device is started on some hong Monte system devices which use the BLE device as a control end.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a method for quickly connecting system equipment with low-power consumption Bluetooth equipment.
Background
Bluetooth low energy is a personal area network technology designed and marketed by the bluetooth technology alliance, and is intended for emerging applications in the fields of healthcare, sports fitness, beacons, security, home entertainment, etc. Compared with classical bluetooth, bluetooth with low energy aims at significantly reducing power consumption and cost while maintaining an equivalent communication range.
Bluetooth Low Energy (BLE) connections are typically built on top of the GATT protocol, which defines that two BLE devices communicate via a property [1] called Service and chacteristic.
OpenHarmony is an open-source project hatched and operated by an open-atom open-source foundation, and aims to face the full-scene, full-connection and full-intelligent times, and based on an open-source mode, a framework and a platform of an intelligent terminal equipment operating system are built, so that the prosperous development of the everything interconnection industry is promoted.
In the device based on the hong system, when another BLE device is used as a control end role, control capability of the hong system device needs to be obtained quickly in some situations, but a control command is normally transmitted through BLE communication, and the communication with the BLE device can be performed only after the hong system is completely started and after a service program of related BLE communication is started.
Therefore, a scheme for supporting the connection and communication of BLE equipment based on fast start of BLE function of the hong Monte system is designed.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present invention is to provide a method for quickly connecting a system device to a bluetooth low energy device, so as to solve the drawbacks of the prior art.
In order to achieve the above object, the present invention provides a method for a system device to connect with a bluetooth low energy device quickly, comprising the following steps:
step 1: developing and realizing BLE GATT server-side programs based on hong Meng Lanya API at hong Mongolian equipment end;
step 2: starting a guide component function adding service component through hong Meninit;
step 3: executing a BLE server program to broadcast out the BLE GATT service added by the hong Monte device;
step 4: the BLE server program registers a callback method for monitoring the connection information of the GATT;
step 5: bluetooth control equipment end scans and initiates BLE connection;
step 6: the BLE service at the hong Monte device end receives connection;
step 7: the hong Monte device end establishes connection after starting up, wherein the Bluetooth control device end sends a control instruction, and the hong Monte device end is connected with the control instruction.
Furthermore, in the step 1, the development of C/C++ is used to realize the starting of BLE according to the Bluetooth state of the hong Monte device end, initialize the Bluetooth protocol stack, and use the Bluetooth module of the hong Monte device end as the BLE GATT Server end.
Further, the step 2 starts the guiding component function adding service component through hong Meninit, specifically: adding a service configuration script for realizing the BLE server program into cfg configuration files of the hong system init, cfg and import, adding the configuration script into the cfg files, sequentially adding and executing the configuration script, completing initialization of Bluetooth module equipment and configuration file path authority, executing the configuration script of the cfg configuration file after the hong system init starts a bootstrap program, executing the service configuration script to the BLE server program, and starting the BLE server program.
Further, the step 3 specifically includes: and initializing a hong Mongolian equipment end Bluetooth module by a BLE server end program, adding BLE GATT service according to a specified UUID after initializing a Bluetooth protocol library, starting BLE GATT service, and broadcasting the added BLE GATT service.
Further, the step 4 specifically includes: the BLE server program establishes a new callback method for registering and monitoring the connection information of the GATT by the process, and the connection is automatically carried out when the Bluetooth control equipment end requests the connection.
Further, the step 5 specifically includes: and the Bluetooth control equipment end scans and obtains BLE GATT service broadcast sent by a BLE server end program, and after judgment, BLE connection with the hong Monte equipment end is initiated.
Further, the step 6 specifically includes: and the BLE server program of the hong Mongolian equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT connection is successful.
The beneficial effects of the invention are as follows:
the invention can realize the capability of quickly supporting the connection of other BLE devices after the HongMonte system device is started, can automatically establish the BLE connection between the BLE device control end and the HongMonte system device end when the BLE device is started on some HongMonte system devices which use the BLE device as the control end, and greatly improves the operation experience and steps of the HongMonte system device which is controlled by BLE communication based on external BLE devices.
The conception, specific structure, and technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, features, and effects of the present invention.
Drawings
Fig. 1 is a system schematic block diagram of the present invention.
Fig. 2 is a flow chart of the method of the present invention.
Detailed Description
As shown in fig. 1, in the method for quickly connecting a system device with a bluetooth low energy device, a service of a BLE GATT Server function is implemented and broadcasted at a hong device end, then a guide component function is started through hong init, a configuration script for implementing the service of the BLE GATT Server function is added into a cfg configuration file of init.cfg and import, the service is started after the init starts a guide program, and then the bluetooth control device end requests to initiate connection. So as to realize the earliest connection with the Bluetooth control equipment after the Hongmon equipment is started, as shown in fig. 2, the method specifically comprises the following steps:
step 1: developing and realizing BLE GATT server-side programs based on hong Meng Lanya API at hong Mongolian equipment end;
step 2: starting a guide component function adding service component through hong Meninit;
step 3: executing a BLE server program to broadcast out the BLE GATT service added by the hong Monte device;
step 4: the BLE server program registers a callback method for monitoring the connection information of the GATT;
step 5: bluetooth control equipment end scans and initiates BLE connection;
step 6: the BLE service at the hong Monte device end receives connection;
step 7: the hong Monte device end establishes connection after starting up, wherein the Bluetooth control device end sends a control instruction, and the hong Monte device end is connected with the control instruction.
In this embodiment, step 1 uses C/c++ development to realize BLE opening according to bluetooth state of hong-mo device, initialize bluetooth protocol stack, and use bluetooth module of hong-mo device as BLE GATT Server.
In this embodiment, step 2 starts the guide component function adding service component through hong Meninit, specifically: adding a service configuration script for realizing the BLE server program into cfg configuration files of the hong system init, cfg and import, adding the configuration script into the cfg files, sequentially adding and executing the configuration script, completing initialization of Bluetooth module equipment and configuration file path authority, executing the configuration script of the cfg configuration file after the hong system init starts a bootstrap program, executing the service configuration script to the BLE server program, and starting the BLE server program.
In this embodiment, step 3 specifically includes: and initializing a hong Mongolian equipment end Bluetooth module by a BLE server end program, adding BLE GATT service according to a specified UUID after initializing a Bluetooth protocol library, starting BLE GATT service, and broadcasting the added BLE GATT service.
In this embodiment, step 4 specifically includes: the BLE server program establishes a new callback method for registering and monitoring the connection information of the GATT by the process, and the connection is automatically carried out when the Bluetooth control equipment end requests the connection.
In this embodiment, step 5 specifically includes: and the Bluetooth control equipment end scans and obtains BLE GATT service broadcast sent by a BLE server end program, and after judgment, BLE connection with the hong Monte equipment end is initiated.
In this embodiment, step 6 specifically includes: and the BLE server program of the hong Mongolian equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT connection is successful.
According to the technical scheme and the steps, the implementation key points of the invention are as follows:
1. a BLE-based hong Monte application is compiled, and the functions of starting BLE, initializing a Bluetooth protocol stack and opening the BLE GATT Server are realized and broadcasted.
2. The HongMong system init promoter system module promoter system is responsible for the construction and process guidance of each process running time environment of the whole system, and configures corresponding init.cfg configuration files of the init promoter system to automatically start the written BLE application after the system is started.
3. And adjusting the starting priority of the BLE application after the Hongmon system is started, ensuring that the BLE application is started after the Bluetooth driver is loaded, initializing a Bluetooth protocol stack, starting the service of a BLE GATT Server function, broadcasting, and automatically receiving connection.
4. Furthermore, the priority of the drive loading after the hong Monte system is started can be adjusted, and the Bluetooth drive loading is advanced as much as possible.
By the method, the Bluetooth module driver can be loaded at the highest speed after the HongMong system is started, the Bluetooth protocol stack is initialized, BLE GATT connection is recommended, and BLE communication after the HongMong system is started is realized at the highest speed. For some control ends based on BLE keyboard remote controllers such as televisions or tablets based on the hong Mongolian system, control input can be realized fastest, and user experience is optimized.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention by one of ordinary skill in the art without undue burden. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.
Claims (4)
1. A method for quickly connecting a system device to a bluetooth low energy device, comprising the steps of:
step 1: developing and realizing BLE GATT server-side programs based on hong Meng Lanya API at hong Mongolian equipment end;
step 2: the guiding component function adding service component is started through hong Meninit, and specifically comprises the following steps: adding a service configuration script for realizing a BLE server program into cfg configuration files of a hong system init, cfg and import, adding the configuration script into the cfg file, sequentially adding and executing the configuration script, completing initialization of Bluetooth module equipment correlation and configuration file path authority correlation by an init module, executing the configuration script of the cfg configuration file after the hong system init starts a bootstrap program, executing the service configuration script to the BLE server program, and starting the BLE server program;
step 3: executing a BLE server program to broadcast out the BLE GATT service added by the hong Monte device, specifically: the BLE server-side program initializes a hong Mongolian device-side Bluetooth module, adds BLE GATT service according to a specified UUID after initializing a Bluetooth protocol library, starts BLE GATT service, and broadcasts the added BLE GATT service;
step 4: the callback method for the BLE server program to register and monitor the connection information of the GATT specifically comprises the following steps: the BLE server program establishes a new callback method for registering and monitoring the connection information of the GATT by the process, and the connection is automatically carried out when the Bluetooth control equipment end requests the connection;
step 5: bluetooth control equipment end scans and initiates BLE connection;
step 6: the BLE service at the hong Monte device end receives connection;
step 7: the hong Monte device end establishes connection after starting up, wherein the Bluetooth control device end sends a control instruction, and the hong Monte device end is connected with the control instruction.
2. The method for quickly connecting a system device to a bluetooth low energy device according to claim 1, wherein: and step 1 is developed by using C/C++, so that BLE is started according to the Bluetooth state of the hong Monte device end, a Bluetooth protocol stack is initialized, and a Bluetooth module of the hong Monte device end is used as a BLE GATT Server end.
3. The method for quickly connecting a system device to a bluetooth low energy device according to claim 1, wherein the step 5 specifically comprises: and the Bluetooth control equipment end scans and obtains BLE GATT service broadcast sent by a BLE server end program, and after judgment, BLE connection with the hong Monte equipment end is initiated.
4. The method for quickly connecting a system device to a bluetooth low energy device according to claim 1, wherein the step 6 is specifically: and the BLE server program of the hong Mongolian equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT connection is successful.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210704691.8A CN114980057B (en) | 2022-06-21 | 2022-06-21 | Method for quickly connecting system equipment with low-power consumption Bluetooth equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210704691.8A CN114980057B (en) | 2022-06-21 | 2022-06-21 | Method for quickly connecting system equipment with low-power consumption Bluetooth equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114980057A CN114980057A (en) | 2022-08-30 |
CN114980057B true CN114980057B (en) | 2023-07-07 |
Family
ID=82966142
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210704691.8A Active CN114980057B (en) | 2022-06-21 | 2022-06-21 | Method for quickly connecting system equipment with low-power consumption Bluetooth equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114980057B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115696637A (en) * | 2022-10-21 | 2023-02-03 | Oppo广东移动通信有限公司 | Information acquisition method and device, bluetooth device, terminal device and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106412656B (en) * | 2016-10-26 | 2019-08-06 | 四川长虹电器股份有限公司 | The method that Android smart machine quickly connects bluetooth |
CN106714084B (en) * | 2016-12-19 | 2019-11-12 | 四川长虹电器股份有限公司 | The method that Android intelligent equipment quickly connects bluetooth |
CN108319480A (en) * | 2018-02-01 | 2018-07-24 | 微鲸科技有限公司 | Bluetooth service starts method, apparatus and electronic equipment |
CN113825123A (en) * | 2020-06-19 | 2021-12-21 | 阿里巴巴集团控股有限公司 | Communication method, communication device, electronic equipment and computer storage medium |
CN111918262B (en) * | 2020-08-15 | 2024-05-03 | 北京百瑞互联技术股份有限公司 | Method and system for quickly discovering low-power-consumption Bluetooth communication of GATT service |
-
2022
- 2022-06-21 CN CN202210704691.8A patent/CN114980057B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114980057A (en) | 2022-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111880870B (en) | Method and device for controlling electronic equipment and electronic equipment | |
US10750349B2 (en) | Device linking | |
CN102665123B (en) | A kind of TV control method, handheld device, TV and TV control system | |
CN114980057B (en) | Method for quickly connecting system equipment with low-power consumption Bluetooth equipment | |
CN109348167B (en) | Wireless auxiliary stream data transmission method and system based on video conference system | |
KR20130119377A (en) | Apparatus and method for determining a wireless device's location after shutdown | |
JP2023017926A (en) | Software upgrade management method, server, terminal, device, and storage medium | |
CN103634660A (en) | Method and device for controlling video playing of smart television through mobile communication terminal | |
CN103618967A (en) | Method and device for interaction of mobile terminal and television end | |
US20090312029A1 (en) | Wireless communication device configured to enter an active state based upon a detection of a potential request for communication session resources | |
WO2016150191A1 (en) | Data sharing method and device | |
CN113038593B (en) | Connection establishment method, device and user equipment | |
CN109150956B (en) | Method, device and equipment for realizing SDK pushing and computer storage medium | |
CN104333807A (en) | Application processing method and device and smart television | |
CN112328492A (en) | Interaction control method and device between anchor and electronic equipment | |
CN104424036A (en) | Synchronous operation method and device of smart terminal | |
US20080137588A1 (en) | Optimistic access procedure at dormant target handset in a cdma2000 1x network with f-qpch enabled | |
CN108702366A (en) | Equipment connection method and terminal | |
CN103686282A (en) | Method and device for starting browser in smart television | |
CN114116571B (en) | Bridging platform for mobile device | |
CN101640602B (en) | Management method for network television | |
KR20090083103A (en) | Dual mode terminal and method for processing data service thereof | |
CN113194450A (en) | Bluetooth device management method and device | |
CN114466230B (en) | Display equipment function expanding method and device, screen projector and storage medium | |
CN105792009A (en) | Multi-screen interaction type remote input method, mobile terminal, and intelligent device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |