Bluetooth SIMCOM

From ElectroDragon
Jump to navigation Jump to search

Bluetooth Commands

Slave mode

2018-01-26 212825.png
  • 1, AT + BTPOWER = 1 / / open the Bluetooth power supply

Normal return "OK", if the module Bluetooth power has been turned on, it will return ERROR.

  • 2, AT + BTHOST? / / Query module name and address

return: AT + BTHOST? + BTHOST: SIM800C, 38: 1c: 4a: ae: 5e: 56 OK You can also modify the Bluetooth device name using this command

  • 3, the phone open Bluetooth assistant APP, click on "connect device";
  • 4, click "scan new equipment", wait for scanning to SIM800C;
  • 5, click "SIM800C", and confirm pairing;
  • 6, the computer will receive the request of the PC serial port matching information

+ BTPAIRING: "MEIZU MX3", 22: 22: f1: 6a: b7: 12,263153

  • 7, send AT + BTPAIR = 1,1, to allow mobile phone pairing

Back AT + BTPAIR = 1,1 OK

  • 8, after the receipt of APP's successful matching and request link service

+ BTPAIR: 1, "MEIZU MX3", 22: 22: f1: 6a: b7: 12 + BTCONNECTING: "22: 22: f1: 6a: b7: 12", "SPP"

  • 9, confirm the link AT + BTACPT = 1 / / confirmation and APP to establish SPP link

return AT + BTACPT = 1 OK

  • 10, AT + BTSPPSEND / / send data

There are two ways to send data, fixed length and non-fixed length Fixed-length mode: AT + BTSPPSEND = 5 // Send 5 bytes of data After receiving the symbol '>', enter 5 bytes of data, more than 5 bytes will be lost behind the data, only send the first 5 bytes return: AT + BTSPPSEND = 5 > 12345 SEND OK Non-fixed-length mode: AT + BTSPPSEND / / send data commands sent, without length After receiving the symbol '>', enter the data you want to send, such as "1234567890" After sending the data, switch to the hexadecimal send mode, send hexadecimal 1A; AT + BTSPPSEND > 1234567890 SEND OK

  • 11, receive data, received the data sent to the phone module, the module will automatically report the received data, the format is as follows

+ BTSPPDATA: 1,5, electrodragon


Master mode: The SIM800C has only slave mode

  • 1, AT + BTPOWER = 1 / / open the Bluetooth power supply

Normal return "OK", if the module Bluetooth power has been turned on, it will return ERROR.

  • 2, AT + BTHOST? / / Query module name and address

return: AT + BTHOST? + BTHOST: electrodragon, 27: a7: 2c: 90: 62: 60 OK You can also modify the Bluetooth device name using this command

  • 3, AT + BTSCAN = 1,10 / / Bluetooth cable accessories, cable time 10S

return: AT + BTSCAN = 1,10 OK + BTSCAN: 0,1, "MEIZU MX3", 22: 22: 4e: 73: 13: 84, -45 // The retrieved device, device ID: 1 + BTSCAN: 1 // Closing ends Note: Here you need to wait for the return + BTSCAN: 1 to represent the end of the cable.

  • 4, AT + BTPAIR = 0,1 // active request matching set ID: 1 Bluetooth settings

AT + BTPAIR = 0,1 OK + BTPAIRING: "MEIZU MX3", 22: 22: 4e: 73: 13: 84,573342 Note: when the phone will receive the matching request submitted by the module, the phone can be confirmed pairing

  • 5, AT + BTPAIR = 1,1 // response to the connection request

AT + BTPAIR = 1,1 OK + BTPAIR: 1, "MEIZU MX3", 22: 22: 4e: 73: 13: 84

  • 6, AT + BTGETPROF = 1 / / access to paired Bluetooth devices provide services

return: AT + BTGETPROF = 1 AT + BTGETPROF = 1 + BTGETPROF: 10, "PBAP" + BTGETPROF: 1, "A2DP (Source)" + BTGETPROF: 2, "HFP (AG)" + BTGETPROF: 8, "AVRCP (Target)" OK Note: There is no SPP service we need in the service list. To do this, first turn on the Bluetooth serial assistant of the mobile phone, open the Bluetooth assistant and retrieve the service again. return: AT + BTGETPROF = 1 + BTGETPROF: 10, "PBAP" + BTGETPROF: 1, "A2DP (Source)" + BTGETPROF: 2, "HFP (AG)" + BTGETPROF: 8, "AVRCP (Target)" + BTGETPROF: 4, "SPP" / / You can see the new SPP service OK

  • 7, AT + BTCONNECT = 1, 4 // the service that connects the bluetooth apparatus automatically, bluetooth ID: 1, serve 4 "SPP"

return: AT + BTCONNECT = 1,4 OK + BTCONNECT: 1, "MEIZU MX3", 22: 22: 4e: 73: 13: 84, "SPP"

  • 8, AT + BTSPPSEND / / send data

There are two ways to send data, fixed length and non-fixed length Fixed-length mode: AT + BTSPPSEND = 5 // Send 5 bytes of data After receiving the symbol '>', enter 5 bytes of data, more than 5 bytes will be lost behind the data, only send the first 5 bytes return: AT + BTSPPSEND = 5 > 12345 SEND OK Non-fixed-length mode: AT + BTSPPSEND / / send data commands sent, without length After receiving the symbol '>', enter the data you want to send, such as "1234567890" After sending the data, switch to the hexadecimal send mode, send hexadecimal 1A; AT + BTSPPSEND > 1234567890 SEND OK

  • 9, receive data, received the data sent to the phone module, the module will automatically report the received data, the format is as follows

+ BTSPPDATA: 1,5, electrodragon