



Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!




Test AT OK None -
Reset AT+RESET OK None -
Get the software version AT+VERSION? +VERSION:Param OK Param1: Version number -
AT+VERSION\r\n
+VERSION:2.0- OK
Restore default status AT+ORGL OK None
The parameter of default status:
Get module bluetooth address
+ADDR:Param OK
Param1: Bluetooth address Bluetooth address will show as this way: NAP: UAP: LAP(Hexadecimal)
Module Bluetooth address: 12:34:56:ab:cd:ef. AT+ADDR?\r\n
+ADDR:1234:56:abcdef OK
AT+NAME=Param1 OK
If Success: +NAME:Param OK
If Failure : FAIL
Inquire remote bluetooth device’s name AT+RNAME?Param
If Success: +NAME:Param OK
If Failure: FAIL
Param1: Remote Bluetooth device address Param2: Remote Bluetooth device name
Bluetooth address will show as this way: NAP:UAP:LAP (Hexadecimal)
Bluetooth device address: 00:02:72:od:22:24; device name: Bluetooth. AT+RNAME?0002,72,od2224\r\n
+RNAME:Bluetooth OK
AT+ROLE=Param1 OK
+ROLE:Param OK
AT+CLASS=Param1 OK
If Success:
If Failure: FAIL
Set/Inquire device’s name Param1: Bluetooth device name
Length up to 32 bytes; Supports special characters;
AT+NAME="HC-05" Is the same as AT+NAME=HC- Default: “HC-05”
Set the module device name to "HC-05": AT+NAME=HC-05\r\n
AT+NAME?\r\n
Set/Inquire module role
Param1: module role: 0 -> Slave 1 -> Master 2 -> Slave-Loop
Role introduction: Slave: Passive connection; Slave-Loop: Passive connection, receive the remote Bluetooth master device data and send it back to the master device; Master: Inquire the near SPP Bluetooth slave device, build connection with it positively, and build up the transparent data transmission between master and slave device.
Default: 0
Set the module device role to Slave: AT+ROLE= 0
Set/Inquire device type Param1: Device type
Bluetooth device type is a 32-bit parameter indicates the device type and what type can be supported. For inquiring the custom Bluetooth device from around Bluetooth devices quickly and effectively, user can set the module to be non-standard Bluetooth device type, such as 0x1f1f (Hexadecimal).
More information is provided at the appendix 1(device type introduction).
Default: 0
AT+IAC=Param
If Success: OK
If Failure: FAIL
+IAC: Param OK
AT+INQM=Param1, Param2, Param
If Success: OK
If Failure: FAIL
+INQM:Param1,Param2,Param OK
AT+PSWD=Param1 OK
+PSWD:Param OK
AT+UART=Param1, Param2, Param
+UART=Param1, Param2, Param OK
AT+CMODE=Param1 OK
+CMODE:Param OK
Set/Inquire inquire access code Param1: Inquire access code
Access code is set to be GIAC type (General Inquire Access Code:0x9e8b33), and used for seeking ( or being sought by ) all the Bluetooth devices around. For inquiring (or being inquiring by) the custom Bluetooth device from around Bluetooth devices quickly and effectively, user can set the inquire access code to be the other type number (not GIAC nor LIAC), such as 9e8b3f.
The more information is provided at the appendix 2(Inquire access code introduction).
Default: 9e8b
AT+IAC=9e8b3f\r\n
_AT+IAC?\r_ n
+IAC: 9e8b3f OK
Set/Inquire inquire access mode
Param1: Inquire access mode: 0 -> Standard 1 -> RSSI
Param2: The maximum of Bluetooth devices response
Param3: The maximum of limited inquiring time
The range of limited time: 1~48 (Corresponding time:1.28s~61.44s)
Default: 1, 1, 48
Set Inquire access mode: 1) has RSSI signal intensity indicator, 2) stop inquiring once more than 9 devices response, 3) limited time is 48*1.28=61.44s: AT+INQM=1,9,48\r \n
AT+INQM\r \n
+INQM:1, 9, 48 OK
Set/Inquire passkey Param1: Passkey Default: “1234”
Set the module device passkey to "1234" : AT+PWD=1234\r\n (or AT+PSWD="1234"\r\n)
AT+PSWD?\r\n
Set/Inquire serial parameter
Param1: Baud rate: 4800 -> 4800 bits/s 9600 -> 9600 bits/s 19200 -> 19200 bits/s 38400 -> 38400 bits/s 57600 -> 57600 bits/s 115200 -> 115200 bits/s 230400 -> 230400 bits/s 460800 -> 460800 bits/s 921600 -> 921600 bits/s 1382400 -> 1382400 bits/s
Param2: Stop bit: 0 -> 1 bit 1 -> 2 bits
Param3: Parity bit: 0 -> None 1 -> Odd parity 2 -> Even parity
Default: 9600, 0, 0
Set baud rate to be 115200, stop bit to be 2 bits, parity bit to be even parity : AT+UART=115200,1,2,\r\n
Set/Inquire connection mode
Param1: Connection mode: 0 -> Connect the module to the specified Bluetooth address. (Bluetooth address can be specified by the binding command) 1 -> Connect the module to any address (The specifying address has no effect for this mode.) 2 -> Slave-Loop
Default connection mode: 0
Set the module device connection mode to Slave-Loop: AT+CMODE=
AT+IPSCAN=Param1, Param2, Param3, Param
+IPSCAN:Param1, Param2, Param3, Param
AT+SNIFF=Param1, Param2, Param3, Param
+SNIFF: Param1, Param2, Param3, Param
AT+SENM=Param1, Param
If Success: OK
If Failure: FAIL
+SENM:Param1,Param OK
Delete authenticated device in the Bluetooth pair list
AT+RMSAD=Param1 OK Param1: Bluetooth device address -
Delete the device (12:34:56:ab:cd:ef) in the blue pair list: AT+RMSAD=1234,56,abcdef\r\n
If Success : OK
If Failure : FAIL
Delete all authenticated devices in the pair list
AT+RMAAD OK None -
Move all devices away from the pair list: AT+RMAAD\r\n
Seek the authenticated device in the Bluetooth pair list
AT+FSAD=Param
If Success: OK
If Failure: FAIL
Param1: Bluetooth device address -
Seek the authenticated device (address: 12:34:56:ab:cd:ef) in the pair list
AT+FSAD=1234,56,abcdef\r\n
If Success : OK
If Failur e: FAIL
Get the authenticated device count from the pair list
+ADCN:Param OK Param1: Authenticated Device Count -
Get the Bluetooth address of Most Recently Used Authenticated Device
+MRAD:Param OK
Param1: the Bluetooth address of Most Recently Used Authenticated Device
Set/ Inquire page scan and inquire scan parameter
Param1:time interval of inquiring
Param2: duration in inquiring
Param3: time interval of paging
Param4: duration in paging
The above parameters are decimal.
Default:1024,512,1024,
_AT+IPSCAN=1234,500,1200,250\r_ n
OK
Set/ Inquire—SNIFF energy parameter
Param1: maximum time Param2: minimum time Param3: test time Param4: limited time The above parameters are decimal.
Default : 0,0,0,
Set/ Inquire safe and encryption mode
Param1: the value of safe mode: 0 -> sec_mode0+off 1 -> sec_mode1+non_secure 2 -> sec_mode2_service 3 -> sec_mode3_link 4 -> sec_mode_unknown
Param2: the value of encryption mode: 0 -> hci_enc_mode_off 1 -> hci_enc_mode_pt_to_pt 2 -> hci_enc_mode_pt_to_pt_and_bcast
Default: 0,
Get the work status of Bluetooth module
+STATE:Param OK
Param1: work status of module: “INITIALIZED” -> initialized status “READY” -> ready status “PAIRABLE” -> pairable status “PAIRED” -> paired status “INQUIRING” -> inquiring status “CONNECTING” -> connecting status “CONNECTED” -> connected status “DISCONNECTED” -> disconnected status “NUKNOW" -> unknown status
Initialize the SPP profile lib AT+INIT
If Success: OK
If Failure: FAIL
None -
AT+INIT\r\n
Inquire Bluetooth device AT+INQ
+INQ:Param1, Param2, Param ... OK
Param1: Bluetooth address Param2: Device type Param3: RSSI signal intensity
AT+INIT\r\n
OK
AT+IAC=9e8b33\r\n
AT+CLASS=0\r\n
AT+INQM=1,3,48\r\n
AT+INQ\r\n
Cancel Bluetooth device AT+INQC OK - - -
Set pair AT+PAIR=Param1, Param
If Success: OK
If Failure: FAIL"
Param1: Bluetooth address of remote device Param2: limited time of connection (second)
Make pair with the remote Bluetooth device(address:12:34:56:ab:cd:ef), the limited time is 20s: AT+PAIR=1234,56,abcdef,20\r\n
Connect device AT+LINK=Param
If Success: OK
If Failure: FAIL"
Param1: Bluetooth address of remote device
Connect with the remote Bluetooth device (address: 12:34:56:ab:cd:ef): AT+FSAD=1234,56,abcdef\r\n
OK
AT+LINK=1234,56,abcdef\r \n