CN114980057A - 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 PDF

Info

Publication number
CN114980057A
CN114980057A CN202210704691.8A CN202210704691A CN114980057A CN 114980057 A CN114980057 A CN 114980057A CN 202210704691 A CN202210704691 A CN 202210704691A CN 114980057 A CN114980057 A CN 114980057A
Authority
CN
China
Prior art keywords
ble
bluetooth
equipment
service
hongmon
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210704691.8A
Other languages
Chinese (zh)
Other versions
CN114980057B (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.)
Rivotek Technology Jiangsu Co Ltd
Original Assignee
Rivotek Technology Jiangsu 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 Rivotek Technology Jiangsu Co Ltd filed Critical Rivotek Technology Jiangsu Co Ltd
Priority to CN202210704691.8A priority Critical patent/CN114980057B/en
Publication of CN114980057A publication Critical patent/CN114980057A/en
Application granted granted Critical
Publication of CN114980057B publication Critical patent/CN114980057B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing 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: a BLE GATT server program based on Hongmon Bluetooth API is developed and realized at the Hongmon equipment end; starting a guide component function adding service component through hongmengtinit; executing a BLE service end program to broadcast BLE GATT services added by Hongmon equipment ends; a BLE service end program registers a callback method for monitoring the connection information of the GATT; the Bluetooth control equipment terminal scans and initiates BLE connection; the hongmeng equipment end BLE service accepts connection; the Hongmon device end establishes connection as soon as it is started, wherein the Bluetooth control device end sends a control command, and the Hongmon device end receives the control command. The invention realizes the capability of rapidly supporting the connection of other BLE equipment, and can automatically establish the BLE connection on Hongmon system equipment which uses the BLE equipment as a control end when being started.

Description

Method for quickly connecting system equipment with low-power-consumption Bluetooth equipment
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 sold by the Bluetooth technical alliance, and is used for emerging applications in the fields of medical care, sports fitness, beacons, security, home entertainment and the like. Bluetooth low energy is intended to significantly reduce power consumption and cost while maintaining equivalent communication range compared to classical bluetooth.
Bluetooth Low Energy (BLE) connections are generally built on the GATT protocol, which defines that two BLE devices communicate via an attribute 1 called Service and charctertic.
OpenHarmony is an open source project which is hatched and operated by an open atom open source fund, aims at establishing a framework and a platform of an intelligent terminal equipment operating system based on an open source mode facing to a full scene, full connection and full intelligent era, and promotes the prosperous development of the internet of everything industry.
In the hongmeng system-based device, when another BLE device is used as a control terminal role, the control capability of the hongmeng system device needs to be quickly obtained in some scenes, but normally, the BLE communication transmission control instruction needs to be transmitted to the BLE device after the hongmeng system is completely started and a service program of related BLE communication is started, so that the BLE device can be communicated.
Therefore, a scheme for supporting connection and communication of BLE equipment based on quick start of a Hongmon system for BLE functions is designed.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, an object of the present invention is to provide a method for a system device to quickly connect a bluetooth low energy device, so as to solve the deficiencies of the prior art.
In order to achieve the above object, the present invention provides a method for a system device to quickly connect a bluetooth low energy device, comprising the following steps:
step 1: a BLE GATT server program based on Hongmon Bluetooth API is developed and realized at the Hongmon equipment end;
step 2: starting a guide component function adding service component through hongmengtinit;
and step 3: executing a BLE service end program to broadcast BLE GATT services added by Hongmon equipment ends;
and 4, step 4: a BLE service end program registers a callback method for monitoring the connection information of the GATT;
and 5: the Bluetooth control equipment terminal scans and initiates BLE connection;
step 6: the hongmeng equipment end BLE service accepts connection;
and 7: the Hongmon device end establishes connection as soon as it is started, wherein the Bluetooth control device end sends a control command, and the Hongmon device end receives the control command.
Further, step 1 uses C/C + + development to realize that BLE is started according to the bluetooth state of hongmeng equipment, a bluetooth protocol stack is initialized, and a bluetooth module of hongmeng equipment is used as a BLE GATT Server.
Further, step 2 starts the guidance component function addition service component through the hongmeninit, and specifically includes: adding a service configuration script for realizing a BLE service end program into cfg configuration files of the init, cfg and import of the hongmeng system, adding the configuration script into the cfg files in the last sequence for execution, finishing the initialization of the equipment correlation of the Bluetooth module and the path authority correlation of the configuration files by the init module, executing the configuration script of the cfg configuration files after the init of the hongmeng system starts a bootstrap program, executing the service configuration script of the BLE service end program, and starting the BLE service end program.
Further, the step 3 specifically includes: the program of the BLE service end initializes the Hongmon equipment end Bluetooth module, the BLE GATT service is added according to the appointed UUID after the Bluetooth protocol library is initialized, the BLE GATT service is started, and the added BLE GATT service is broadcasted.
Further, the step 4 specifically includes: the BLE service end program establishes a new process registration and monitoring callback method of the connection information of the GATT, and the connection is automatically carried out when the Bluetooth control equipment end requests connection.
Further, the step 5 specifically includes: the Bluetooth control equipment terminal scans to obtain BLE GATT service broadcast sent by a BLE service terminal program, and initiates BLE connection with the Hongmeng equipment terminal after judgment.
Further, the step 6 specifically includes: and the BLE server program of the Hongmen equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT is successfully connected.
The invention has the beneficial effects that:
the invention realizes the capacity of rapidly supporting the connection of other BLE equipment after the Hongmong system equipment is started, can automatically establish the BLE connection between the BLE equipment control end and the Hongmong system equipment end on the Hongmong system equipment using the BLE equipment as the control end after starting, and greatly improves the operation experience and the steps of the Hongmong system equipment controlled by BLE communication based on external BLE equipment.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
FIG. 1 is a schematic block diagram of the system of the present invention.
Fig. 2 is a flow chart of the method of the present invention.
Detailed Description
As shown in fig. 1, the method for a system device to connect a bluetooth low energy device quickly according to the present invention implements a BLE GATT Server function at a hongmeng device end and broadcasts it, then starts a bootstrap component function through hongmeng init, adds a configuration script for implementing the BLE GATT Server function service in an init.cfg and import cfg configuration file, starts a service after init starts a bootstrap program, and then the bluetooth control device end makes a request to initiate a connection and automatically connects. To realize that the connection is established with the bluetooth control device end at the earliest after the hongmeng device end is started, as shown in fig. 2, the method specifically includes the following steps:
step 1: a BLE GATT server program based on Hongmon Bluetooth API is developed and realized at the Hongmon equipment end;
step 2: starting a guide component function adding service component through hongmengtinit;
and step 3: executing a BLE service end program to broadcast BLE GATT services added by Hongmon equipment;
and 4, step 4: a BLE service end program registers a callback method for monitoring the connection information of the GATT;
and 5: the Bluetooth control equipment terminal scans and initiates BLE connection;
step 6: the BLE service of the Hongmon equipment end receives connection;
and 7: the Hongmon device end establishes connection as soon as it is started, wherein the Bluetooth control device end sends a control command, and the Hongmon device end receives the control command.
In this embodiment, step 1 uses C/C + + development to realize that BLE is turned on according to the bluetooth state of hongmeng device side, a bluetooth protocol stack is initialized, and a bluetooth module of hongmeng device side is used as BLE GATT Server side.
In this embodiment, step 2 starts the guidance component function through the hongmennit to add the service component, which specifically includes: adding a service configuration script for realizing a BLE service end program into cfg configuration files of the init, cfg and import of the hongmeng system, adding the configuration script into the cfg files in the last sequence for execution, finishing the initialization of the equipment correlation of the Bluetooth module and the path authority correlation of the configuration files by the init module, executing the configuration script of the cfg configuration files after the init of the hongmeng system starts a bootstrap program, executing the service configuration script of the BLE service end program, and starting the BLE service end program.
In this embodiment, step 3 specifically includes: the program of the BLE service end initializes the Hongmon equipment end Bluetooth module, the BLE GATT service is added according to the appointed UUID after the Bluetooth protocol library is initialized, the BLE GATT service is started, and the added BLE GATT service is broadcasted.
In this embodiment, step 4 specifically includes: the BLE service end program establishes a new process registration and monitoring callback method of the connection information of the GATT, and the connection is automatically carried out when the Bluetooth control equipment end requests connection.
In this embodiment, step 5 specifically includes: the Bluetooth control equipment terminal scans to obtain BLE GATT service broadcast sent by a BLE service terminal program, and initiates BLE connection with the Hongmeng equipment terminal after judgment.
In this embodiment, step 6 specifically includes: and the BLE server program of the Hongmen equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT is successfully connected.
According to the technical scheme and the steps, the implementation key points of the invention are as follows:
1. compiling a Hongmon application based on BLE, realizing starting BLE, initializing a Bluetooth protocol stack, and opening the service of the BLE GATT Server function and broadcasting.
2. The hongmeng system init promoter system module start subsystem is responsible for construction of each process running environment of the whole system and process guidance, and configures an init.cfg configuration file corresponding to the init start subsystem so as to automatically start the written BLE application after starting.
3. The start priority of BLE application after the Hongmon system is started up is adjusted, the BLE application is ensured to be started after the Bluetooth driver is loaded, so that a Bluetooth protocol stack is initialized, the service of a BLE GATT Server function is saved, the service is broadcasted, and the connection is automatically received.
4. Furthermore, the priority of the drive loading after the Hongmon system is started can be adjusted, and the Bluetooth drive loading is carried out as early as possible.
Through the method, the highest speed loading Bluetooth module drive after the Hongmon system is started can be realized, the Bluetooth protocol stack is initialized, the BLE GATT connection is suggested, and the BLE communication after the Hongmon system is started can be realized at the highest speed. For some control terminals based on a BLE keyboard remote controller, such as a TV or a flat panel based on a Hongmon system, control input can be realized most quickly, and user experience is optimized.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (7)

1. A method for quickly connecting a system device with a low-power Bluetooth device is characterized by comprising the following steps:
step 1: a BLE GATT server program based on Hongmon Bluetooth API is developed and realized at the Hongmon equipment end;
step 2: starting a guide component function adding service component through hongmengtinit;
and step 3: executing a BLE service end program to broadcast BLE GATT services added by Hongmon equipment ends;
and 4, step 4: a BLE service end program registers a callback method for monitoring the connection information of the GATT;
and 5: the Bluetooth control equipment terminal scans and initiates BLE connection;
step 6: the hongmeng equipment end BLE service accepts connection;
and 7: the Hongmon equipment end establishes connection after being started, wherein the Bluetooth control equipment end sends a control command, and the Hongmon equipment end is connected with the control command.
2. The method of claim 1, wherein the system device is configured to connect to the bluetooth low energy device quickly, and wherein: step 1 is developed by using C/C + +, BLE is started according to the Bluetooth state of the hongmeng equipment end, a Bluetooth protocol stack is initialized, and a Bluetooth module of the hongmeng equipment end is used as a BLE GATT Server end.
3. The method for a system device to connect to bluetooth low energy device quickly according to claim 1, wherein the step 2 starts the bootstrap component function adding service component by using a hongmenginit, specifically: adding a service configuration script for realizing a BLE service end program into cfg configuration files of the init, cfg and import of the hongmeng system, adding the configuration script into the cfg files in the last sequence for execution, finishing the initialization of the equipment correlation of the Bluetooth module and the path authority correlation of the configuration files by the init module, executing the configuration script of the cfg configuration files after the init of the hongmeng system starts a bootstrap program, executing the service configuration script of the BLE service end program, and starting the BLE service end program.
4. The method for a system device to connect to a bluetooth low energy device quickly according to claim 1, wherein the step 3 is specifically: the program of the BLE service end initializes the Hongmon equipment end Bluetooth module, the BLE GATT service is added according to the appointed UUID after the Bluetooth protocol library is initialized, the BLE GATT service is started, and the added BLE GATT service is broadcasted.
5. The method for a system device to connect to a bluetooth low energy device quickly according to claim 1, wherein the step 4 is specifically: the BLE service end program establishes a new process registration and monitoring callback method of the connection information of the GATT, and the connection is automatically carried out when the Bluetooth control equipment end requests connection.
6. The method for a system device to quickly connect to a bluetooth low energy device according to claim 1, wherein the step 5 is specifically: the Bluetooth control equipment terminal scans to obtain BLE GATT service broadcast sent by a BLE service terminal program, and initiates BLE connection with the Hongmeng equipment terminal after judgment.
7. The method for fast connecting the system device to the bluetooth low energy device according to claim 1, wherein the step 6 specifically comprises: and the BLE server program of the Hongmen equipment end receives the connection request of the Bluetooth control equipment end, and the BLE GATT is successfully connected.
CN202210704691.8A 2022-06-21 2022-06-21 Method for quickly connecting system equipment with low-power consumption Bluetooth equipment Active CN114980057B (en)

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 true CN114980057A (en) 2022-08-30
CN114980057B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024082906A1 (en) * 2022-10-21 2024-04-25 Oppo广东移动通信有限公司 Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412656A (en) * 2016-10-26 2017-02-15 四川长虹电器股份有限公司 Method enabling Android smart device to quickly connect with Bluetooth
CN106714084A (en) * 2016-12-19 2017-05-24 四川长虹电器股份有限公司 Method for rapidly connecting android smart device with Bluetooth
CN108319480A (en) * 2018-02-01 2018-07-24 微鲸科技有限公司 Bluetooth service starts method, apparatus and electronic equipment
CN111918262A (en) * 2020-08-15 2020-11-10 北京百瑞互联技术有限公司 Low-power-consumption Bluetooth communication method and system for rapidly discovering GATT service
CN113825123A (en) * 2020-06-19 2021-12-21 阿里巴巴集团控股有限公司 Communication method, communication device, electronic equipment and computer storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412656A (en) * 2016-10-26 2017-02-15 四川长虹电器股份有限公司 Method enabling Android smart device to quickly connect with Bluetooth
CN106714084A (en) * 2016-12-19 2017-05-24 四川长虹电器股份有限公司 Method for rapidly connecting android smart device with 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
CN111918262A (en) * 2020-08-15 2020-11-10 北京百瑞互联技术有限公司 Low-power-consumption Bluetooth communication method and system for rapidly discovering GATT service

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
风雨BYT: "【转载】Android GATT连接过程源码分析" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024082906A1 (en) * 2022-10-21 2024-04-25 Oppo广东移动通信有限公司 Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium

Also Published As

Publication number Publication date
CN114980057B (en) 2023-07-07

Similar Documents

Publication Publication Date Title
CN111880870B (en) Method and device for controlling electronic equipment and electronic equipment
AU2012322844B2 (en) Device linking
EP2448222A1 (en) Local device redirection
CN103517110B (en) A kind of multi-screen interaction communication system and method
US7818022B2 (en) Communication apparatus and electric power control method
JP2019537322A (en) Network connection method for home appliances, network connection method for home appliances and home systems
CN110012328B (en) Method and device for interacting with smart television
JP4801138B2 (en) Method and apparatus for providing on-demand assistance for wireless devices
CN111314799A (en) Terminal system architecture, communication system, communication method, and storage medium
CN105190591A (en) Transport mode for wireless serial bus (WSB) service
JP2023017926A (en) Software upgrade management method, server, terminal, device, and storage medium
CN103024504A (en) Intelligent remote system based on digital television set-top box
CN102595226A (en) Wireless control method and set-top box
CN110932953A (en) Intelligent household control method and device, computer equipment and storage medium
CN106027631B (en) Data transmission method and device
CN114980057A (en) Method for quickly connecting system equipment with low-power-consumption Bluetooth equipment
CN103618967A (en) Method and device for interaction of mobile terminal and television end
CN114697879B (en) Bluetooth pairing method, electronic device, chip and storage medium
CN109089247A (en) Using starting method, system, terminal device and computer readable storage medium
WO2016150191A1 (en) Data sharing method and device
CN112230943A (en) Application processing method and device and electronic equipment
CN111970389A (en) Screen projection method, device, equipment and storage medium based on mDNS protocol
CN108702366A (en) Equipment connection method and terminal
CN104424036A (en) Synchronous operation method and device of smart terminal
CN108958807A (en) A kind of terminal system starting method and terminal

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