Method and device for bluetooth communication
A communication device, a technology of Bluetooth communication, applied in the field of communication, can solve the problems of Bluetooth data packet loss, saturation of Bluetooth slave device receiving capability, and timeout of receiving data, etc., to achieve the effects of good experience, increased stability, and guaranteed communication rate
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0024] This embodiment provides a Bluetooth communication method, see figure 1 ,include:
[0025] Step S1, the communication device waits for the call of the upper-layer application, receives the operation data sent by the upper-layer application when the data interaction interface is called, and executes step S2;
[0026] Step S2, the communication device sends the operation data to the Bluetooth device in a non-responsive manner;
[0027] Step S3, the communication device judges whether the operation result returned by the Bluetooth device is successfully received, and if yes, returns the received operation result to the upper application, and ends; otherwise, execute step S4;
[0028] Step S4, the communication device sends the operation data to the Bluetooth device in a responsive manner, and judges whether the operation data is successfully sent, and if yes, executes step S5; otherwise, the communication fails and ends;
[0029] Step S5, the communication device judges ...
Embodiment 2
[0076] This embodiment provides a Bluetooth communication method, see figure 2 ,include:
[0077] Step 101, the communication device receives the call of the upper layer application, when the scanning interface is called, execute step 102; when the connection interface is called, execute step 103; when the disconnection interface is called, execute step 104; when the data interaction interface When called, execute step 105;
[0078] Step 102, the communication device scans the surrounding Bluetooth devices, and returns the Bluetooth device information of the scanned Bluetooth devices to the upper application; return to step 101;
[0079] Specifically, the communication device calls the [_managerscanForPeripheralsWithServices:@[[CBUUID UUIDWithString:@"12340001-0001-00c3-0000-465453414645"]]options:@{CBCentralManagerScanOptionAllowDuplicatesKey:@YES}] interface of the CBCentralManager object to scan the surrounding Bluetooth devices. The value of the first parameter NSArray*...
Embodiment 3
[0155] This embodiment provides a communication device, see image 3 ,include:
[0156] The receiving module 11 is used to wait for the call of the upper layer application, and receive the operation data sent by the upper layer application when the data interaction interface is called;
[0157] The sending module 12 is used to send the operation data received by the receiving module 11 to the bluetooth device in a non-responsive manner;
[0158] The first judging module 13 is used for judging whether the operation result returned by the bluetooth device is successfully received after the sending module 12 sends the operation data received by the receiving module 11 to the bluetooth device in a non-responsive manner;
[0159] The sending module 12 is also used to return the received operation result to the upper layer application when the first judging module 13 judges that the operation result returned by the Bluetooth device is successfully received; When the Bluetooth devi...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


