The author's blog address: http://blog.sina.com.cn/samzhen1977
By Sam (zhufeng)
Sam_code@hotmail.com
Write BluetoothProgramYou often need to determine whether to send the Bluetooth package and how the content is. This is the same as packet capture when writing a network program. But with the Network Program (Use
Ethereal) the difference is that Bluetooth is transmitted wirelessly, so Bluetooth
Protocol analyger (Bluetooth analyzer ). Sam is currently using Merlin II Bluetooth protocol
Analyger.
After installing the package capture program on the official website, use USB to connect the computer to the analyzer. Open the catc merlinii software.
1. Obtain the peripheral bluetooth device bdaddr.
Select record-> BT neighborhood in menu
Inquiry. (Bluetooth near inquiry)
As you can see, the device info window contains many bluetooth
Device and Their bdaddr.
2. capture a Bluetooth package between two devices:
2.1: First, you need to know the bdaddr of the two devices. Find them from the device info list and check them.
2.2: In the Bluetooth protocol, the active initiator is the master and passively accepts the connection direction salve. .
Set as master to set as master.
Set as page target (set as connection target) as salve.
3. Packet Capture:
First, make the two devices in the discoverable status. Use the button REC: picont to capture packets.