Home / Reference / HC-05 Bluetooth AT Command List
Advertisement
Arduino Bluetooth Module

HC-05 Bluetooth AT Command List

Test command

Command Response Parameter
AT OK -

Reset

Command Response Parameter
AT+RESET OK -

 

Get firmware version

Command Response Parameter
AT+VERSION? +VERSION:<Param>

OK

Param : firmware version

Example:

 

Restore default

Command Response Parameter
AT+ORGL OK -

Default state:

Slave mode, pin code :1234, device name: H-C-2010-06-01 ,Baud 38400bits/s.

Get module address

Command Response Parameter
AT+ADDR? +ADDR:<Param> OK Param: address of Bluetooth module

Bluetooth address: NAP: UAP : LAP

Example:

Set/Check module name:

Command Response Parameter
AT+NAME=<Param> OK Param: Bluetooth module name (Default :HC-05)
AT+NAME? +NAME:<Param>

OK

or

FAIL

Example:

 

Get the Bluetooth device name:

Command Response Parameter
AT+RNAME?<Param1> +NAME:<Param2>

OK

or

FAIL

Param1,Param 2 : the address of Bluetooth device

Example: (Device address 00:02:72:od:22:24,name:HC-05)

 

Set/Check module mode:

Command Response Parameter
AT+ROLE=<Param> OK 0 - Slave

1 - Master

2 - Slave-Loop

AT+ ROLE? +ROLE:<Param>

OK

 

Set/Check device class

Command Response Parameter
AT+CLASS=<Param> OK Param: Device Class
AT+CLASS? +CLASS:<Param>

OK

or

FAIL

 

Set/Check GIAC (General Inquire Access Code)

Command Response Parameter
AT+IAC=<Param> OK

or

FAIL

Param: GIAC (Default : 9e8b33)
AT+IAC +IAC:<Param>

OK

Example:

Set/Check -- Query access patterns

Command Response Parameter
AT+INQM=<Param>,<Param2>,

<Param3>

OK

or

FAIL

Param:

0 -- inquiry_mode_standard

1 -- inquiry_mode_rssi Param2: Maximum number of Bluetooth devices to respond to

Param3:

Timeout (1-48 : 1.28s to 61.44s)

AT+ INQM? +INQM :<Param>,<Param2>,

<Param3>

OK

Example:

 

Set/Check PIN code:

Command Response Parameter
AT+PSWD=<Param> OK Param: PIN code

(Default 1234)

AT+PSWD? + PSWD : <Param>

OK

 

Set/Check serial parameter:

Command Response Parameter
AT+UART=<Param>,<Param2>,< Param3> OK Param1: Baud

Param2: Stop bit

Param3: Parity

+UART=<Param>,<Param2>,

<Param3>

OK

Example:

 

Set/Check connect mode:

Command Response Parameter
AT+CMODE=<Param> OK Param:

0 - connect fixed address

1 - connect any address

2 - slave-Loop

+ CMODE:<Param>

OK

 

Set/Check fixed address:

Command Response Parameter
AT+BIND=<Param> OK Param: Fixed address

(Default

00:00:00:00:00:00)

AT+BIND? + BIND:<Param>

OK

 

 

Example:

Set/Check LED I/O

Command Response Parameter
AT+POLAR=<Param1,<Param2> OK Param1:

0- PIO8 low drive LED

1- PIO8 high drive LED

Param2:

0- PIO9 low drive LED

1- PIO9 high drive LED

+ POLAR=<Param1>,<Param2>

OK

 

Set PIO output

Command Response Parameter
AT+PIO=<Param1>,<Param2> OK Param1: PIO number

Param2: PIO level

0- low

1- high

Example:

 

Set/Check – scan parameter

Command Response Parameter
AT+IPSCAN=<Param1>,<Param2

>,<Param3>,<Param4>

OK Param1: Query time interval

Param2: Query duration

Param3: Paging interval

Param4: Call duration

AT+IPSCAN? +IPSCAN:<Param1>,<Param2>,<Param3>,<Param4>
OK

Example:

 

Set/Check – SHIFF parameter

Command Response Parameter
AT+SNIFF=<Param1>,<Param2>,

<Param3>,<Param4>

OK Param1: Max time

Param2: Min time

Param3: Retry time

Param4: Time out

AT+SNIFF? +SNIFF:<Param1>,<Param2>,<Param3>,<Param4>

OK

 

Set/Check security mode

Command Response Parameter
AT+SENM=<Param1>,<Param2> OK

or

FAIL

Param1:

0 --sec_mode0+off

AT+ SENM? + SENM:<Param1>,<Param2> 1——sec_mode1+non_secure

2 -- sec_mode2_service

3 -- sec_mode3_link

4 -- sec_mode_unknown

Param2:

0 -- hci_enc_mode_off

1 -- hci_enc_mode_pt_to_pt

2 -- hci_enc_mode_pt_to_pt_and_bcast

Delete Authenticated Device

Command Response Parameter
AT+PMSAD=<Param> OK Param:

Authenticated Device Address

Example:

 

Delete All Authenticated Device

Command Response Parameter
AT+ RMAAD OK

 

Search Authenticated Device

Command Response Parameter
AT+FSAD=<Param> OK

or

FAIL

Param: Device address

 

Get Authenticated Device Count

Command Response Parameter
AT+ADCN? +ADCN:<Param>

OK

Param: Device Count

 

Most Recently Used Authenticated Device

Command Respond Parameter
AT+MRAD? + MRAD:<Param>

OK

Param: Recently Authenticated Device Address

 

Get the module working state

Command Response Parameter
AT+ STATE? + STATE:<Param>

OK

Param:

“INITIALIZED”

“READY”

“PAIRABLE”

“PAIRED”

“INQUIRING”

“CONNECTING” “CONNECTED”

“DISCONNECTED”

“NUKNOW”

Initialize the SPP profile lib

Command Response Parameter
AT+INIT OK

or

FAIL

-

 

Inquiry Bluetooth Device

Command Response Parameter
AT+INQ +INQ: <Param1>, <Param2>, <Param3>

….

OK

Param1:Address

Param2:Device Class

Param3:RSSI Signal strength

Example:

 

Cancel Inquiring Bluetooth Device

Command Response Parameter
AT+ INQC OK -

 

Equipment Matching

Command Response Parameter
AT+PAIR=<Param1>,<Param2> OK

or

FAIL

Param1:Device Address

Param2:Time out

 

Connect Device

Command Response Parameter
AT+LINK=<Param> OK

or

FAIL

Param:Device Address

Example:

Disconnect

Command Response Parameter
AT+DISC +DISC:SUCCESS

OK

or

+DISC:LINK_LOSS

OK

or

+DISC:NO_SLC

OK

or

+DISC:TIMEOUT

OK

or

+DISC:ERROR

OK

Param:Device Address

 

Energy-saving mode

Command Response Parameter
AT+ENSNIFF=<Param> OK Param:Device Address

 

Exerts Energy-saving mode

Command Response Parameter
AT+ EXSNIFF =<Param> OK Param:Device Address

 

Check Also

ESP8266 WiFi AT Command List

Contents1 Test command2 Reset3 Get firmware version4 WiFi mode 5 List APs 6 Connect to …

One comment

  1. Hello, I'm working on a projet:
    i have an arduino uno and 2 BT modules (HC-05 & HM-10)

    I should be able via (arduino+ Bluetooth module) to discover all nearby smartphones (android & ios) then to notify them (send message or picture) but without installing any app or doing any config on those smartphones (only bluetooth should be activated on them).

    The HC-05 doesn't support the AT+DISC command and the BLE HM-10 discover only BLE devices (no smartphone discovered)

    Is there any way to do this using this hardware?
    Should i get a specific Bluetooth module ? if yes which model?

Leave a Reply

Your email address will not be published. Required fields are marked *