CN109413626B - Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment - Google Patents
Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment Download PDFInfo
- Publication number
- CN109413626B CN109413626B CN201811168750.4A CN201811168750A CN109413626B CN 109413626 B CN109413626 B CN 109413626B CN 201811168750 A CN201811168750 A CN 201811168750A CN 109413626 B CN109413626 B CN 109413626B
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- white list
- reconnection
- remote
- automatic
- 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
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/19—Connection re-establishment
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W80/00—Wireless network protocols or protocol adaptations to wireless operation
- H04W80/08—Upper layer protocols
- H04W80/12—Application layer protocols, e.g. WAP [Wireless Application Protocol]
Abstract
The invention discloses a method for automatically reconnecting a white list and a non-white list of remote Bluetooth equipment, which comprises the following steps: in the Android system, the characteristic that a Bluetooth protocol stack, namely a layer c, and an Android application layer, namely a layer java, can access and modify the same attribute value of the system is utilized, and the condition of a switching mode is set as the system attribute, so that the automatic reconnection state can be switched by changing the change of the attribute value, and the reconnection state of the remote Bluetooth equipment is managed. The automatic reconnection mode support of the Android device to the Bluetooth device is perfected, the use of other original users is not influenced while the reconnection experience is optimized, the product competitiveness is improved, and the stability is improved.
Description
Technical Field
The invention relates to a Bluetooth device reconnection method, in particular to a remote Bluetooth device white list and non-white list automatic reconnection compatible method.
Background
An existing android system belongs to an android intelligent voice television compared with an intelligent terminal relying on Bluetooth, and because a Bluetooth remote controller can transmit voice data to a television end from a remote controller end, an infrared remote controller and a radio frequency remote controller cannot collect the voice data. In order to improve the user experience, it is necessary to ensure that commonly used remote bluetooth devices such as a bluetooth remote controller can be immediately reconnected after being connected or disconnected, and it is very important to select a proper automatic reconnection mode. Conventional backhaul is divided into two ways, as shown in fig. 1, including white list backhaul of BLE device and non-white list backhaul of bluetooth application. The former has a fast connection back time but does not distinguish the content of the broadcast packet sent when the remote bluetooth device is disconnected. The latter is slow in the backhaul time relative to the former, but distinguishes the content of broadcast packets sent when the remote bluetooth device is disconnected.
Different platforms require inconsistency to the automatic back connection of the remote Bluetooth equipment, and the automatic back connection intelligent management of the remote Bluetooth equipment is realized. Two automatic connection modes are integrated into one system, and a variable which can be accessed and changed by an application layer, namely a java layer, and a bluetooth protocol stack, namely a C + + layer is arranged. When the application layer is required to download the connection command, the Bluetooth protocol stack cannot download the connection command until the application layer calls the connection command to establish connection; however, when the BLE white list is linked back, the upper layer application does not need to send a connect command when receiving the linked back packet, and the connection is directly established by fw. In order to dynamically switch the two methods without influencing pairing and connection management of the Bluetooth equipment by the platform, the invention designs a method which can ensure that a contact command is downloaded at only one position when the Android system switches different automatic return links.
Disclosure of Invention
In a normal mode of an Android system, an automatic reconnection mode of a specific remote Bluetooth device is optimized, and in the optimization process, the automatic reconnection time of a BLE white list is found to be short, but a reconnection packet or a pairing packet sent by the specific remote Bluetooth device cannot be distinguished, so that a replacement pairing error is caused. The BLE white list is automatically reconnected, and the Bluetooth protocol stack does not actively issue a null connect command under the condition that the link is not detected. In the original automatic reconnection scheme, links are stored at the android system end and the specific remote Bluetooth device, and if technology is required to be replaced, the original user is required to be ensured not to be influenced. Therefore, a compatible scheme is required to be designed, the BLE white list automatic loopback and the application layer non-white list automatic loopback can be integrated into the Android system, and the two automatic loopback modes are not affected by each other and can be freely switched.
The invention provides a method for automatically connecting a white list and a non-white list of remote Bluetooth equipment.
The invention is realized by the following steps:
the starting process of the Bluetooth module of the Android equipment is as follows: and after the Linux is started, loading a System Server of an Android system, and starting the Bluetooth system service in the System Server. The Bluetooth system service initializes the Bluetooth module, the application layer Bluetooth device connection management app utilizes the Bluetooth system service connection management remote Bluetooth device, and connection of the remote Bluetooth device after starting up is completed. The remote bluetooth device needs to switch the automatic loopback mode before the remote bluetooth loopback succeeds. Therefore, the flow charts of the two automatic loop modes need to be sorted out, and the difference between the two implementation principles needs to be contrasted and analyzed.
The principle of BLE white list realization is that after the connection of remote Bluetooth equipment is successful, the address of the Bluetooth equipment is stored in the BLE white list, if the disconnection of the equipment in the BLE white list is detected, a Bluetooth protocol stack issues a connect command which does not carry an address to the Bluetooth driver, and after a connection packet of the remote Bluetooth equipment is received, the address is analyzed and directly connected.
The realization principle of the automatic reconnection of the non-white list of the application layer is as follows: the remote Bluetooth equipment sends a connection-back packet after being disconnected, the Bluetooth protocol stack directly uploads the connection-back packet to the application layer after receiving the connection-back packet, the application layer analyzes the connection-back packet after receiving the connection-back packet and sends a connection command to the Bluetooth protocol stack, and the Bluetooth protocol stack establishes connection with the remote equipment after receiving the connection command. A comparison of the two automatic reconnecting schemes is shown in figure 1.
Through comparison, the greatest difference between the two automatic reconnection modes is the position of the command issued by the contact, and the free switching between the two automatic reconnection schemes can be controlled by controlling the position of the command issued by the contact. In the Android system, system attributes can be accessed and modified by a java layer and an C, C + + layer at the same time, so that the automatic back connection mode of the remote equipment can be switched simply and quickly by setting the condition of the switching mode as the system attributes and changing the values of the system attributes. The specific implementation is shown in fig. 2.
The invention provides a method for automatically reconnecting a white list and a non-white list of remote Bluetooth equipment, which comprises the following steps:
in the Android system, the characteristic that a Bluetooth protocol stack, namely a layer c, and an Android application layer, namely a layer java, can access and modify the same attribute value of the system is utilized, and the condition of a switching mode is set as the system attribute, so that the automatic reconnection state can be switched by changing the change of the attribute value, and the reconnection state of the remote Bluetooth equipment is managed.
The method specifically comprises the following steps:
firstly, modifying system attributes in an Android system, and setting the system attributes as a switching mode of Bluetooth connection;
the Android system provides a system property SystemProperties interface which is a global shared interface. The set method in the systemoproperties interface can be called to set the name of the attribute variable and the corresponding attribute variable value, and then the name of the attribute variable and the corresponding attribute value are obtained through the get method in the systemoproperties interface. The attribute variable name can be self-defined, and the attribute value can be set and changed according to the type of the remote controller configured by the whole machine and the type of the remote controller after the pairing connection is successful. Such specific arrangements and modifications are not technically difficult for those skilled in the art and can be accomplished directly. The remote controller configured in the whole machine is preset in the system in advance.
Secondly, before starting the Bluetooth, initializing attribute values for switching automatic reconnection, switching the reconnection modes of the Bluetooth, and then initializing a Bluetooth module;
before the Bluetooth is started, the attribute value can be set according to the model of the remote controller configured by the whole machine. After the Bluetooth is started and the Bluetooth remote control pairing connection is successful, the model of the Bluetooth remote controller equipment can be accessed through a gatt protocol, and then the attribute is changed according to the obtained model value.
Finally, a specific remote bluetooth is looped back.
The invention provides an automatic reconnection method which is compatible with an automatic reconnection mode of remote Bluetooth equipment of an Android system and can be freely switched according to requirements in the same environment. The automatic reconnection mode support of the Android device to the Bluetooth device is perfected, the use of other original users is not influenced while the reconnection experience is optimized, the product competitiveness is improved, and the stability is improved.
Drawings
Fig. 1 is a schematic diagram for implementing automatic back connection of a ble white list of a remote bluetooth device and an application layer non-white list.
Fig. 2 is an experimental schematic diagram of automatic reconnection of a table name list of remote bluetooth equipment and automatic reconnection switching of a non-white list of an application layer.
Detailed Description
The method is mainly compatible with an automatic connection mode of the remote Bluetooth equipment of the Android system, and can be freely switched to the automatic connection mode according to requirements in the same environment. The specific implementation mode comprises the following steps:
1. white list loop-back flow for sorting out ble
2. Non-white list reconnection process for sorting application layer
3. In the Android system, the same attribute value of the system can be accessed and modified by using a Bluetooth protocol stack, namely a layer c, and an Android application layer, namely a layer java. The loop connection state of the remote Bluetooth device is managed by switching the automatic reconnection state by changing the change of the attribute value.
4. Before starting Bluetooth, the attribute value of automatic reconnection is initialized and switched. The bluetooth module is then initialized.
5. A specific remote bluetooth is looped back.
Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.
Claims (1)
1. A method for automatically linking and compatible a white list and a non-white list of remote Bluetooth equipment is characterized by comprising the following steps: in the Android system, the characteristic that a Bluetooth protocol stack, namely a layer c, and an Android application layer, namely a layer java, can access and modify the same attribute value of the system is utilized, the condition of a switching mode is set as the system attribute, so that the automatic reconnection state is switched by changing the change of the attribute value, and the reconnection state of the remote Bluetooth equipment is managed;
firstly, modifying system attributes in an Android system, and setting the system attributes as a switching mode of Bluetooth connection;
secondly, before starting the Bluetooth, initializing attribute values for switching automatic reconnection, switching the reconnection modes of the Bluetooth, and then initializing a Bluetooth module;
finally, a specific remote bluetooth is looped back.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811168750.4A CN109413626B (en) | 2018-10-08 | 2018-10-08 | Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811168750.4A CN109413626B (en) | 2018-10-08 | 2018-10-08 | Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109413626A CN109413626A (en) | 2019-03-01 |
CN109413626B true CN109413626B (en) | 2021-06-22 |
Family
ID=65466025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811168750.4A Active CN109413626B (en) | 2018-10-08 | 2018-10-08 | Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109413626B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110381487B (en) * | 2019-07-15 | 2022-06-21 | 珠海市杰理科技股份有限公司 | Bluetooth connection method and device |
CN114173315B (en) * | 2022-02-14 | 2022-06-14 | 荣耀终端有限公司 | Bluetooth reconnection method and terminal equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105323383A (en) * | 2015-11-17 | 2016-02-10 | 小米科技有限责任公司 | Mobile phone ringing volume adjusting method and device |
US9414426B2 (en) * | 2014-02-10 | 2016-08-09 | Samsung Electronics Co., Ltd. | Method and apparatus for reconnection in short-range wireless communication |
CN107454563A (en) * | 2017-09-08 | 2017-12-08 | 歌尔科技有限公司 | A kind of Bluetooth communication method, device and bluetooth equipment |
-
2018
- 2018-10-08 CN CN201811168750.4A patent/CN109413626B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9414426B2 (en) * | 2014-02-10 | 2016-08-09 | Samsung Electronics Co., Ltd. | Method and apparatus for reconnection in short-range wireless communication |
CN105323383A (en) * | 2015-11-17 | 2016-02-10 | 小米科技有限责任公司 | Mobile phone ringing volume adjusting method and device |
CN107454563A (en) * | 2017-09-08 | 2017-12-08 | 歌尔科技有限公司 | A kind of Bluetooth communication method, device and bluetooth equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109413626A (en) | 2019-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102938818B (en) | Household appliance intelligent controlling method based on smart mobile phone | |
KR101462739B1 (en) | Host/peripheral local interconnect that is compatible with self-configurable peripheral device | |
KR19980081848A (en) | Large capacity radio platform | |
CN103517110A (en) | Multi-screen interaction communication system and method | |
CN111447602B (en) | Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium | |
JP2005514832A (en) | Method and apparatus for separating control content and media content from cellular network connection | |
CN109413626B (en) | Automatic back-connection compatible method for white list and non-white list of remote Bluetooth equipment | |
CN103501506A (en) | Terminal self-adaptive data transmission system and method for Internet of Vehicles service | |
CN104202714A (en) | Mobile terminal near field communication method and system for heterogeneous operating system | |
CN105635472A (en) | Mobile terminal, and wireless local area network and mobile network concurrent method of mobile terminal | |
US20110106956A1 (en) | Communication System and Communication Method | |
CN104754674A (en) | Method and system for intelligent mobile terminal to access Wi-Fi accessory equipment and 3G/4G network at same time | |
CN105812185A (en) | Communication connection method for playing device | |
WO2012094853A1 (en) | Method, device and system for installing terminal software | |
EP3979071A1 (en) | Method, user equipment, and application server for downloading application | |
CN107919979B (en) | Controller state processing method and device | |
CN103796080B (en) | A kind of data processing method and electronic equipment | |
CN103781138B (en) | Method, apparatus and system for connecting WiMo sending terminal to WLAN | |
JP2010251854A (en) | Communication system, terminal, program, and communication method | |
EP0931426B1 (en) | Method and apparatus for configuring a modem | |
CN109587709B (en) | Local data network discovery and configuration method, terminal, core network equipment and base station | |
CN108540519B (en) | Balanced download control method and device | |
CN104065726A (en) | Client data updating method and system thereof | |
CN103841085A (en) | Method and device for implementation of web real-time communication | |
US20080244082A1 (en) | Contents communication method for transmitting contents by using a predetermined communication protocol, and contents transmitting apparatus and contents receiving apparatus using the method |
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 |