A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
?? It can also be said that Bluetooth technology. The so-called Bluetooth technology, actually a short-range radio technology, was invented by Ericsson company. The use of "Bluetooth" technology can effectively simplify communication between mobile devices such as handheld computers, laptops and mobile phone devices, and can also successfully simplify communication between these equipment and internet Internet, so that the transmission between these modern communications equipment and the Internet becomes more rapid and efficient , widening the road for wireless communication.Introduction to Bluetooth version
?? Bluetooth development has undergone 8 versions of the update so far. 1.1, 1.2, 2.0, 2.1, 3.0, 4.0, 4.1, 4.2, 5.0. Of course, 5.0 of the Bluetooth module Google has been released, but the market has not seen 5.0 of Bluetooth devices. Then we are looking forward to the arrival of 5.0 Bluetooth devices!
?? So between the 1.x~3.0 we call the traditional Bluetooth, 4.x started Bluetooth we call low-power Bluetooth is Bluetooth ble, of course, 4.x version of Bluetooth is backwards compatible. Android phones must be system version 4.3 and above to support the BLE API.Bluetooth 2.0 Standard:
The 2.1+EDR version has a theoretical transfer rate of 2.1Mbps faster than the 2.0 version. and joined the "Sniff subrating" technology. This technique saves power by setting the transmit interval between 2 devices to confirm the signal to each other. This technology can extend battery life by up to 5 times times for hardware devices that require continuous streaming of data, such as keyboards, mice, and so on.Bluetooth 3.0 Standard:
Bluetooth 4.0 has several modes, and if it is a Bluetooth 4.0 low power mode device (often called ble mode), it is not backwards compatible.Now mainstream 4.0BLE bluetooth ble (4.x) low power Bluetooth
PS: If you have not done traditional Bluetooth development before, it is also possible to get started with low power Bluetooth development directly. Because they have changed in the communication protocol, the correlation is not big. Of course, it is interesting to download some traditional Bluetooth development demo to see
?? Now we are in a Bluetooth 4.x era. Before this, as we often use the Bluetooth headset has crossed a lot of versions of Bluetooth headset has v1.1 v1.2 v2.0 v2.1 ... And so many versions, what are the advantages? Of course, the higher the version, the better the signal, more than 2.0 Bluetooth stereo support.
So now we are in the 4.x of equipment is mostly in the master-slave mode.What is master-slave mode
A main device such as a mobile phone, a Slave device (also become a sub-device or slave) active search from the machine can be sent can also receive, from the machine can also be sent and received, but can only be searched
The active search slave can be sent or received from the machine can also be sent and received but can only be searched.
There are four modes of working with Bluetooth modules that are common to ble single devices:
* ##### Main Device mode
* ##### from Device mode
* ##### Broadcast Mode
* ##### Mesh Networking mode
So what's the situation with these four models, then we continue to drive
?? The usr-ble100 supports the main device mode and can be connected to a slave device. In this mode, you can search around the device and select the connection from the device you want to connect to. You can also set the default connection from the MAC address of the device, so that the module can find and connect to the module after it has been power-up. And the whitelist feature is supported, the user simply needs to write the Mac of the device to be connected to the whitelist, and the module will connect when it searches for a whitelist-compliant device.
?? The user does not need to pay attention to the data conversion between serial data and wireless packets, and can realize the transparent communication between the main device serial port and the serial port of the device through simple parameter setting.
?? The host connection from the device can be divided into 3 different ways:The first way to use search, you need to set the following parameters before using:
(4) After the setup, wait for the light to be steady on behalf of the successful connection, at this time two serial ports can be transparent transmission of data.The second way
?? If you know the MAC address of the slave device you want to connect to, you can also connect in the following way:
(1) Use Mac bind at command to set module power-on default connection from device MAC address at+connadd=ffffffffff11
(2) After the setup is complete, restart the module using the Restart command, and the address of the slave device to which the module is connected after reboot.
?? BLE is supported from device mode, in this mode fully complies with the BLE4.1 protocol, users can develop their own apps according to the protocol. This mode contains a serial port service, the user can find it through the UUID, there are two channels, respectively, is read and write. The user can manipulate the two channels for data transmission.
?? If the user uses USR-BLE100 's main device to connect with the slave device, then there is no need to pay attention to the Protocol, the two devices of the serial port directly to the data transparent transmission, for the user to establish a simple wireless transmission channel.
? In this mode, the user needs to set the module's operating mode to slave device mode. Users who develop their own app need the UUID of our module to connect, the UUID is: 0x31,0x01,0x9b,0x5f,0x80,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0xd0,0xcd,0x03, 0x00 We provide a sample program for the connection.
?? For example, USR-BLE100 supports broadcast mode, in which the module can broadcast more than one pair. The user can set the module broadcast data through the AT command, the module can be broadcast continuously in the low power mode, apply to the very low power consumption, small data volume, unidirectional transmission application, such as wireless meter reading, indoor positioning and other functions.
?? Common Bluetooth module mode of operation
In this mode, the user can set up the module for small data broadcast, the user needs to invoke the BLE standard interface for the app development, and the data needs to be set using the AT command.
-(1) First set the module mode to broadcast mode at+mode=b
-(2) Use the AT command to set the module to send data, data bit 16 binary length of not more than 30 bytes, broadcast format please refer to the BLE protocol. at+advdata=0201041aff4c000215b9407f30f5f8466eaff925556b57fe6d0001000251
-(3) through the Bluetooth monitoring software can get to listen to the packet, as follows
?? USR-BLE100 supports mesh networking mode, in which the module can implement a simple self-set network, each module only need to set the same communication password can be added to the same network, each module can initiate data, each module can receive data and reply. And does not require a gateway, even if a device fails, it skips and selects the closest device for transmission.
?? USR-BLE100 Support mesh Networking mode, can easily add multiple modules to the network, the use of Star network and relay technology, each network can connect more than 65,000 nodes, the network and network can also interconnect, the end can be countless Bluetooth modules through mobile phones, Connected or directly controlled by a tablet or PC. And does not require a gateway, even if a device fails, it skips and selects the closest device for transmission. The entire networking process only need to power on the device and set the communication password can be automatically set up network, truly simple interconnection.
-(1) First we need to switch the module mode to mesh networking mode
-(2) Set the communication password, the inter-module network is differentiated by the password at+pass=123456
-(3) Restart the module, the module into the networking mode At+z
-(4) At this point we will set up a plurality of modules in this way, when a module serial port to send data, the surrounding modules will be received, and then output to the serial port, and then send the data to the surrounding data module, and so on.
-(5) When the device that receives the data needs to reply the direct serial port sends, finally the module that sends the first time receives the reply, completes the network internal communication.
Android ble bluetooth Communication learning "This is an in-depth understanding of Android Bluetooth: Bluetooth" Foundation, has been working with the medical treatment, to do some Bluetooth-related apps, so look up some data research summed up, the application of things summed up a bit. Next, look forward to ——-in-depth understanding of Android Bluetooth: Bluetooth "advanced chapter"
If you feel that this article is helpful to you, welcome to group QQ Exchange Group: 232203809
Public Number: Terminal Research and Development department
(Welcome to learn and Exchange)
Learn more about the basics of Android Bluetooth bluetooth--
Start building with 50+ products and up to 12 months usage for Elastic Compute Service