A kind of Bluetooth control method and system based on bulb audio amplifierTechnical field
The present invention relates to Baffle Box of Bluetooth control field, be specifically related to a kind of Bluetooth control method and system based on bulb audio amplifier.
Background technology
The modern life is now towards intellectuality. the future development of energy-saving and simplification, increasing user has experienced the facility and glamour that new science and technology product brings, along with the demand that progress and the people of science and technology live for intellectuality, also start some changes occur.The demand of family and personal audio amusement equipment changes from conventional Bluetooth sound equipment to multi-functional audio.Lamp light loudspeaker box based on Bluetooth control belongs to the one of multi-functional audio, and because it has multi-functional, therefore the setting of control mode is the problem needing to solve with compatibility.
Summary of the invention
In order to overcome the deficiencies in the prior art, the object of the present invention is to provide a kind of Bluetooth control method and system based on bulb audio amplifier, while the operating state realizing control audio amplifier and bulb, the Android system equipment on compatible market and IOS system equipment, meet the demand of most of user.
For solving the problem, the technical solution adopted in the present invention is as follows:
Scheme one:
Based on a Bluetooth control method for bulb audio amplifier, comprise the steps:
Step S1: the bluetooth module in bulb audio amplifier end initiates broadcast, receives the connection request that outside bluetooth equipment is initiated, and establishes a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform step S2, if this bluetooth equipment is ios device, then perform step S3;
Step S2: this Android device sends the first control command by SPP agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end;
Step S3: this ios device sends the second control command by BLE agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end.
Preferably, further comprising the steps of before step S1:
Step S0: the bluetooth module in bulb audio amplifier end initiates reconnection requests according to the bluetooth equipment information in caching record to this bluetooth equipment, if reconnect successfully, if then this bluetooth equipment is Android device, perform step S2, if this bluetooth equipment is ios device, perform step S3; If reconnect failure, then perform step S1.
Scheme two:
Based on a Bluetooth control system for bulb audio amplifier, comprise with lower module:
Bluetooth link block, be located at bulb audio amplifier end, broadcast is initiated for making bluetooth module wherein, receive the connection request that outside bluetooth equipment is initiated, and establish a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform Android control module, if this bluetooth equipment is ios device, then perform IOS control module;
Android control module, is located at Android device, for sending the first control command by SPP agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end;
IOS control module, is located at ios device, for sending the second control command by BLE agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end.
Preferably, also comprised with lower module before bluetooth link block,
Bluetooth reconnects module, be located at bulb audio amplifier end, reconnection requests is initiated according to the bluetooth equipment information in caching record to this bluetooth equipment for making bluetooth module wherein, if reconnect successfully, if then this bluetooth equipment is Android device, perform Android control module, if this bluetooth equipment is ios device, perform IOS control module, if reconnect failure, then perform bluetooth link block.
Scheme three:
Based on a Bluetooth control method for bulb audio amplifier, comprise the following steps:
The bluetooth module of the step S1: the first bulb audio amplifier end initiates Bluetooth connection request to the bluetooth module of the second bulb audio amplifier end, and connect with the second bulb audio amplifier end, to make the first bulb audio amplifier end control one of them sound channel, the second bulb audio amplifier controls another sound channel;
Bluetooth module in step S2: the first bulb audio amplifier end initiates broadcast, receives the connection request that outside bluetooth equipment is initiated, and establishes a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform step S3, if this bluetooth equipment is ios device, then perform step S5;
Step S3: this Android device sends the first control command by SPP agreement to the bluetooth module in the first bulb audio amplifier end, to control the bulb operating state in the first bulb audio amplifier end;
First control command to be sent to the bluetooth module in the second bulb audio amplifier end by the bluetooth module in the step S4: the first bulb audio amplifier end by AVRCP agreement, with the bulb operating state in Synchronization Control second bulb audio amplifier end;
Step S5: this ios device is set up bluetooth with the second bulb audio amplifier end and is connected, and sends the second control command by BLE agreement to the bluetooth module in the second bulb audio amplifier end, to control the bulb operating state in the second bulb audio amplifier end;
Second control command to be sent to the bluetooth module in the first bulb audio amplifier end by the bluetooth module in the step S6: the second bulb audio amplifier end by AVRCP agreement, with the bulb operating state in Synchronization Control first bulb audio amplifier end.
Preferably, also comprise between step S1 and step S2:
Bluetooth module in step S11: the first bulb audio amplifier end initiates reconnection requests according to the bluetooth equipment information in caching record to this bluetooth equipment, if reconnect successfully, if then this bluetooth equipment is Android device, perform step S3, if this bluetooth equipment is ios device, perform step S5; If reconnect failure, then perform step S2.
Scheme four:
Based on a Bluetooth control system for bulb audio amplifier, comprise with lower module:
Double-tone case link block, be located at the first bulb audio amplifier end, Bluetooth connection request is initiated to the bluetooth module of the second bulb audio amplifier end for making bluetooth module wherein, and connect with the second bulb audio amplifier end, to make the first bulb audio amplifier end control one of them sound channel, the second bulb audio amplifier controls another sound channel;
Bluetooth link block, be located at the first bulb audio amplifier end, broadcast is initiated for making bluetooth module wherein, receive the connection request that outside bluetooth equipment is initiated, and establish a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform Android control module, if this bluetooth equipment is ios device, then perform IOS control module;
Android control module, is located at Android device, for sending the first control command by SPP agreement to the bluetooth module in the first bulb audio amplifier end, to control the bulb operating state in the first bulb audio amplifier end;
First light synchronization module, is located at the first bulb audio amplifier end, by AVRCP agreement the first control command to be sent to bluetooth module in the second bulb audio amplifier end, with the bulb operating state in Synchronization Control second bulb audio amplifier end for making bluetooth module wherein;
IOS control appliance, is located at ios device, is connected, and sends the second control command by BLE agreement to the bluetooth module in the second bulb audio amplifier end for setting up bluetooth with the second bulb audio amplifier end, to control the bulb operating state in the second bulb audio amplifier end;
Second light synchronization module, is located at the second bulb audio amplifier end, by AVRCP agreement the second control command to be sent to bluetooth module in the first bulb audio amplifier end, with the bulb operating state in Synchronization Control first bulb audio amplifier end for making bluetooth module wherein.
Preferably, also comprise between double-tone case link block and bluetooth link block:
Bluetooth reconnects module, be located at the first bulb audio amplifier end, reconnection requests is initiated according to the bluetooth equipment information in caching record to this bluetooth equipment for making bluetooth module wherein, if reconnect successfully, if then this bluetooth equipment is Android device, perform Android control module, if this bluetooth equipment is ios device, perform IOS control module; If reconnect failure, then perform bluetooth link block.
Compared to existing technology, beneficial effect of the present invention is: 1, Android device and ios device to divide the bulb portion in bulb audio amplifier respectively by different communication protocol and control, and realize good compatibility.2, when utilizing two bulb audio amplifier composition stereo speakers, Android device passes through the connection control bulb operating state of SPP agreement and the first bulb audio amplifier, ios device then passes through the connection control bulb operating state of BLE agreement and the second bulb audio amplifier, by such mode, the stability that BLE agreement connects can be increased, utilize the second bulb audio amplifier end to share a part of controlled pressure simultaneously, the use resource of the first bulb audio amplifier end can be saved.
Accompanying drawing explanation
Fig. 1 is the method flow diagram of embodiments of the invention 1.
Fig. 2 is the method flow diagram of embodiments of the invention 3.
Embodiment
Below, by reference to the accompanying drawings and embodiment, the present invention is described further:
Embodiment 1:
Fig. 1 is a kind of Bluetooth control method based on bulb audio amplifier of the present invention, comprises the following steps:
Step S0: the bluetooth module in bulb audio amplifier end initiates reconnection requests according to the bluetooth equipment information in caching record to this bluetooth equipment, if reconnect successfully, if then this bluetooth equipment is Android device, perform step S2, if this bluetooth equipment is ios device, perform step S3; If reconnect failure, then perform step S1.
Step S1: the bluetooth module in bulb audio amplifier end initiates broadcast, receives the connection request that outside bluetooth equipment is initiated, and establishes a connection with this bluetooth equipment.Wherein, bluetooth equipment comprises Android device and ios device, if Android device, performs step S2, if ios device, performs step S3.
Step S2: this Android device sends audio signal by A2DP agreement to the bluetooth module in bulb audio amplifier end, and sends the first control command by SPP agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end.
Step S3: this ios device sends audio signal by A2DP agreement to the bluetooth module in bulb audio amplifier end, and sends the second control command by BLE agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end.
In above-mentioned method step, bulb audio amplifier end is the audio amplifier with adjustable lamp light, when unlatching bulb audio amplifier end, whether bluetooth module wherein can be searched for has caching record, if have, then can initiate reconnection requests according to the bluetooth equipment information in caching record to this bluetooth equipment, reconnect and successfully then carry out exchanges data with corresponding bluetooth equipment, otherwise will broadcast mode be opened, wait for that other bluetooth equipment is connected with it.In this scenario, bluetooth equipment comprises Android device and ios device, when be connected with bulb audio amplifier end be Android device time, Android device utilizes the APP program preset by A2DP (Advanced Audio Distribution Profile, i.e. Bluetooth audio frequency mode) agreement to bulb audio amplifier end send audio signal, simultaneously by SPP (Standard Parallel Port, i.e. Bluetooth Serial Port) agreement sends control command for controlling bulb operating state to bulb audio amplifier end, the brightness of adjustable bulb; When be connected with bulb audio amplifier end be ios device time, ios device utilizes the APP program preset to send audio signal by A2DP agreement to bulb audio amplifier end, pass through BLE (Bluetooth LowEnergy, i.e. low-power consumption bluetooth) agreement to the control command of bulb audio amplifier end transmission for controlling bulb operating state simultaneously.
As can be seen from above-mentioned scheme, the lamp light loudspeaker box end of this programme had both supported the control of Android device, also supported the control of ios device.Wherein, Android device is controlled by the global function of A2DP and SPP protocol realization lamp light loudspeaker box end, and ios device is controlled by the global function of A2DP and BLE protocol realization lamp light loudspeaker box end, and global function controls to refer to control audio amplifier operating state and bulb operating state simultaneously.Because more existing Android device do not support BLE, therefore adopt SPP protocol transmission, and ios device is supported better to BLE, if ios device adopts SPP, then need adopt apple certification IC and carry out certification, comparatively numerous and diverse, therefore adopt BLE protocol transmission.
Embodiment 2:
Based on the method in embodiment 1, present embodiment discloses a kind of Bluetooth control system based on bulb audio amplifier, comprise with lower module:
Bluetooth reconnects module, be located at bulb audio amplifier end, reconnection requests is initiated according to the bluetooth equipment information in caching record to this bluetooth equipment for making bluetooth module wherein, if reconnect successfully, if then this bluetooth equipment is Android device, perform Android control module, if this bluetooth equipment is ios device, perform IOS control module, if reconnect failure, then perform bluetooth link block.
Bluetooth link block, be located at bulb audio amplifier end, broadcast is initiated for making bluetooth module wherein, receive the connection request that outside bluetooth equipment is initiated, and establish a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform Android control module, if this bluetooth equipment is ios device, then perform IOS control module;
Android control module, be located at Android device, for sending audio signal by A2DP agreement to the bluetooth module in bulb audio amplifier end, and send the first control command by SPP agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end;
IOS control module, be located at ios device, for sending audio signal by A2DP agreement to the bluetooth module in bulb audio amplifier end, and send the second control command by BLE agreement to the bluetooth module in bulb audio amplifier end, to control the bulb operating state in bulb audio amplifier end.
Embodiment 3:
Present embodiment discloses the another kind of Bluetooth control method based on bulb audio amplifier, comprise the following steps:
The bluetooth module of the step S1: the first bulb audio amplifier end initiates Bluetooth connection request to the bluetooth module of the second bulb audio amplifier end, and connect with the second bulb audio amplifier end, make the first bulb audio amplifier end control one of them sound channel by TWS technology, the second bulb audio amplifier controls another sound channel.
Bluetooth module in step S11: the first bulb audio amplifier end initiates reconnection requests according to the bluetooth equipment information in caching record to this bluetooth equipment, if reconnect successfully, if then this bluetooth equipment is Android device, perform step S3, if this bluetooth equipment is ios device, perform step S5; If reconnect failure, then perform step S2.
Bluetooth module in step S2: the first bulb audio amplifier end initiates broadcast, receives the connection request that outside bluetooth equipment is initiated, and establishes a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform step S3, if this bluetooth equipment is ios device, then perform step S5.
Step S3: this Android device sends audio signal by A2DP agreement to the bluetooth module in the first bulb audio amplifier end, and send the first control command by SPP agreement to the bluetooth module in the first bulb audio amplifier end, to control the bulb operating state in the first bulb audio amplifier end.
First control command to be sent to the bluetooth module in the second bulb audio amplifier end by the bluetooth module in the step S4: the first bulb audio amplifier end by AVRCP agreement, with the bulb operating state in Synchronization Control second bulb audio amplifier end.
Step S5: this ios device sends audio signal by A2DP agreement to the bluetooth module in the first bulb audio amplifier end, and set up bluetooth with the second bulb audio amplifier end and be connected and send the second control command by BLE agreement to the bluetooth module in the second bulb audio amplifier end, to control the bulb operating state in the second bulb audio amplifier end.
Second control command to be sent to the bluetooth module in the first bulb audio amplifier end by the bluetooth module in the step S6: the second bulb audio amplifier end by AVRCP agreement, with the bulb operating state in Synchronization Control first bulb audio amplifier end.
In above-mentioned method step, first two bulb audio amplifier ends are carried out bluetooth connection, which using TWS (True Wireless) technology makes one of them bulb audio amplifier end control one of them sound channel, another bulb audio amplifier end controls another sound channel, such as, first bulb audio amplifier end initiates to connect to the second bulb audio amplifier end, after successful connection, first bulb audio amplifier end controls L channel, second bulb audio amplifier end controls R channel, first bulb audio amplifier end is connected with other bluetooth equipment as main frame simultaneously, audio signal is also passed through A2DP protocol transmission to the second bulb audio amplifier end by received audio signal.
After the first bulb audio amplifier end is connected with bluetooth equipment, the operation principle of its transmission of audio signal section is substantially identical with the operation principle of the bulb audio amplifier end in embodiment 1 and bluetooth equipment, after first bulb audio amplifier termination receives audio signal, retain the audio signal of L channel, the audio signal of R channel is sent to the second bulb audio amplifier end, thus the array output of two bulb audio amplifier ends is stereo.
About bulb control section, Android device sends control signal for controlling bulb operating state by SPP agreement to the first bulb audio amplifier end, by the first bulb audio amplifier end, this control signal is passed through AVRCP (Audio/Video Remote Control Profile, i.e. audio/video Long-distance Control specification) protocol synchronization to the second bulb audio amplifier end realizes light Synchronization Control, ios device is then carried out bluetooth and is connected and is transmitted control signal to the second bulb audio amplifier end by BLE agreement with the second bulb audio amplifier end, by the second bulb audio amplifier end, control signal is realized light Synchronization Control by AVRCP protocol synchronization to the first bulb audio amplifier end.By such control mode, ios device is monopolized and is connected with the BLE of the second bulb audio amplifier end, can increase the stability that BLE agreement connects, utilize the second bulb audio amplifier end to share a part of controlled pressure simultaneously, can save the use resource of the first bulb audio amplifier end.
In fact, bulb audio amplifier end in the first bulb audio amplifier end, the second bulb audio amplifier end and embodiment 1 in the present embodiment all can be the bulb audio amplifier of same structure, this bulb audio amplifier has three gears, one of them gear works independently as common Baffle Box of Bluetooth, second gear is that this bulb audio amplifier is set to L channel audio amplifier, and the 3rd gear is that this bulb audio amplifier is set to R channel audio amplifier.A bulb audio amplifier end is set to L channel audio amplifier, and after another bulb audio amplifier end is set to R channel audio amplifier, two bulb audio amplifier ends can be connected by TWS technology automatically.
Embodiment 4:
Based on the method in embodiment 3, present embodiment discloses a kind of Bluetooth control system based on bulb audio amplifier, comprise with lower module:
Double-tone case link block, be located at the first bulb audio amplifier end, Bluetooth connection request is initiated to the bluetooth module of the second bulb audio amplifier end for making bluetooth module wherein, and connect with the second bulb audio amplifier end, make the first bulb audio amplifier end control one of them sound channel by TWS technology, the second bulb audio amplifier controls another sound channel.
Bluetooth reconnects module, be located at the first bulb audio amplifier end, reconnection requests is initiated according to the bluetooth equipment information in caching record to this bluetooth equipment for making bluetooth module wherein, if reconnect successfully, if then this bluetooth equipment is Android device, perform Android control module, if this bluetooth equipment is ios device, perform IOS control module; If reconnect failure, then perform bluetooth link block.
Bluetooth link block, be located at the first bulb audio amplifier end, broadcast is initiated for making bluetooth module wherein, receive the connection request that outside bluetooth equipment is initiated, and establish a connection with this bluetooth equipment, if this bluetooth equipment is Android device, then perform Android control module, if this bluetooth equipment is ios device, then perform IOS control module.
Android control module, is located at Android device, for sending the first control command by SPP agreement to the bluetooth module in the first bulb audio amplifier end, to control the bulb operating state in the first bulb audio amplifier end.
First light synchronization module, is located at the first bulb audio amplifier end, by AVRCP agreement the first control command to be sent to bluetooth module in the second bulb audio amplifier end, with the bulb operating state in Synchronization Control second bulb audio amplifier end for making bluetooth module wherein.
IOS control appliance, is located at ios device, is connected, and sends the second control command by BLE agreement to the bluetooth module in the second bulb audio amplifier end for setting up bluetooth with the second bulb audio amplifier end, to control the bulb operating state in the second bulb audio amplifier end.
Second light synchronization module, is located at the second bulb audio amplifier end, by AVRCP agreement the second control command to be sent to bluetooth module in the first bulb audio amplifier end, with the bulb operating state in Synchronization Control first bulb audio amplifier end for making bluetooth module wherein.
To one skilled in the art, according to technical scheme described above and design, other various corresponding change and deformation can be made, and all these change and deformation all should belong within the protection range of the claims in the present invention.