페이지 선택
Generic selectors
Exact matches only
Search in title
Search in content
Search in pages
AT Commands For BT

 

Command Description
AT+BTPOWER Open/Close BT
AT+BTHOST Get/Set host name
AT+BTSCAN Scan BT devices
AT+BTIOCAP IOCAP Mode Setting
AT+BTPAIR Pair with the paired BT devices
AT+BTUNPAIR Unpair with the paired BT devices
AT+BTPAIRED Get Paired BT devices
AT+BTSPPSRV Active/Deactive spp server
AT+BTSPPPROF Get remote device spp status
AT+BTSPPCONN SPP connect/disconnect
AT+BTSPPSEND SPP send data
AT+BTGATTREG GATT Register
AT+BTGATTACT GATT Active
AT+BTGATTCREDB GATT Create DB
AT+BTGATTCRESRV GATT Create Service
AT+BTGATTCRECHAR Create Service characteristic
AT+BTGATTCRECHARDES Create Service characteristic description
AT+BTGATTSRVADD DB Add To GATT Server
AT+BTGATTREADCFM Response to BTGATTREADIND
AT+BTGATTWRCFM Response to BVTGATTWRIND
AT+BTGATTNOTIFY Send Notification to client
AT+BTGATTSENDIND Send Indication to client
+BTSPPRECV SPP receive data
+BTGATTCONN Client connect status
+BTGATTREADIND Receive client read request
+BTGATTWRIND Receive client write request
 

 

 

 

AT+BTPOWER     Open/Close BT

 

T) AT+BTPOWER=?

+BTPOWER: (0-1)

 

OK

R) AT+BTPOWER?

+BTPOWER: <flag>

 

OK

W) AT+BTPOWER=<flag>[,<debug_switch>]

OK

or

ERROR

 

 

<flag >

0     Stop bt csr app

1     Start bt csr app

<debug_switch > Only allowed set to 1, means to save bt log file after csr app is start.

 

 

Example

AT+BTPOWER?

+BTPOWER: 1

OK

 

AT+BTPOWER=0

OK

 

AT+BTPOWER=1,1

OK

 

 

NOTE

When <flag> set to 0, <debug_switch> can not be set.

 

 

 

 

AT+BTHOST     Get/Set Host Name

 

R) AT+BTHOST?

+BTHOST: <host_name>,<host mac addr>

 

OK

W) AT+BTHOST=<”btname”>

OK

or

ERROR

 

 

<btname>

new Bluetooth name string.

Support Chinese characters.

Max length    64

<host mac addr>

Bluetooth mac address format(xx:xx:xx:xx:xx:xx), x(0-9,A-F)

The default value is SIM7600_BT_xxxxxx(mac addr 3 lower bytes).

 

 

Example

AT+BTHOST?

+BTHOST: SIM7600_BT_AC8DD9, 00:02:5B:AC:8D:D9

OK

 

AT+BTHOST =”abc”

OK

 

 

 

 

AT+BTSCAN     Scan BT Devices

 

T) AT+BTSCAN=?

+BTSCAN: (0-1),(0-1),(6-60)

 

OK

W) AT+BTSCAN=<”doscan”>[,<mode>[,<timeout>]]

OK

+BTSCAN: <scan status>, <index1>, <BT name>, <Mac Addr>, <RSSI level>

+BTSCAN: <scan status>, <index2>, <BT name>, <Mac Addr>, <RSSI level>

[…]]

+BTSCAN: 1 //scan end flag

or

ERROR

 

 

<doscan>

0     stop scan

1     scan

<mode>

0     don’t hide paired devices

1     hide paired devices

<timeout>

Timeout seconds.

Default value is 10

<scan status>

0     scanning

1     scan ended

<index> The index of remote bluetooth device, the value start with 1.
<BT name> The bluetooth name of remote device.
<Mac Addr> The bluetooth mac address of the remote device.
<RSSI level> the rssi level of the device
 

 

Example

AT+BTSCAN=1,0,10

OK

 

+BTSCAN: 0, 1, MKRJ2B-GONGYONG, B8:86:87:43:4B:6A, 186

+BTSCAN: 0, 2, MK-JUMPING, 00:19:86:00:08:60, 184

+BTSCAN: 0, 3, OPPO A57, 4C:18:9A:89:88:7E, 174

+BTSCAN: 0, 4, ww, C4:0B:CB:3E:68:62, 173

+BTSCAN: 0, 5, ofo, F7:51:3B:1F:AF:B5, 165

+BTSCAN: 1

AT+BTSCAN=0,0,10

OK

 

 

 

 

AT+BTIOCAP     IOCAP Mode Setting

 

T) AT+BTIOCAP=?

+BTIOCAP: (0-3)

 

OK

W) AT+BTIOCAP=<mode>

+BTIOCAP: 1

 

OK

or

ERROR

 

 

<mode>

0     Display Only Device

1     Display and Yes and No Capable

2     Keyboard Only

3     No Display or Input Device

 

 

Example

AT+BTIOCAP=3

+BTIOCAP: 1

OK

 

 

 

 

AT+BTPAIR     Pair With Other BT Device

 

T) AT+BTPAIR=?

+BTPAIR: (index)

 

OK

P) AT+BTPAIR=0,<scan index>

OK

+BTPAIRING: <mode>, <device name>,<device mac>,[<passkey>]

or

ERROR

A) AT+BTPAIR=<mode>,<accept>[,<pakey>]

OK

+BTPAIR: <pair result>[,<device name>,<device mac>]

or

ERROR

 

 

<mode>

1     Compare mode need user send accept command

2     Passkey mode need user send accept command and passkey

3     Rebond mode need user send accept command

4     Notify mode just notify user pairing status, user do nothing

5     Just work mode will not receive this mode, user do nothing

6     Pin code mode need user send accept command and pin code

<passkey> Random generate 6 numberic code
<scan index> BTSCAN response index
<device name> The bluetooth name of connected device
<device mac> The bluetooth mac address of the connected device
<pair result>

0     fail

1     success

<accept>

0     reject

1     accept

 

 

Example

AT+BTSCAN=1,0,10

+BTSCAN: 0, 1, OPPO R7Plusm, 2C:5B:B8:1A:33:3C, 189

+BTSCAN: 0, 2, MK-JUMPING, 00:19:86:00:08:60, 183

+BTSCAN: 0, 3, MI Band 2, C8:EB:37:B3:56:57, 179

+BTSCAN: 0, 4, BU3-ZHANGWEI, 00:1A:7D:DA:71:11, 178

+BTSCAN: 0, 5, ww, C4:0B:CB:3E:68:62, 174

+BTSCAN:1

OK

 

AT+BTPAIR=0,5

OK

 

+BTPAIRING: 1, ww, C4:0B:CB:3E:68:62, 623850

AT+BTPAIR=1,1

OK

 

+BTPAIR: 1, ww, C4:0B:CB:3E:68:62

 

 

NOTE

The time out of pairing is about 30 seconds

Whether the pairing is initiative or passive, “AT+BTPAIR” Accept command must be execute after “+BTPAIRING: <mode>, <device name>, <device mac>, [<passkey>]” urc was reported.

 

 

 

 

AT+BTUNPAIR     Unpair With Other BT Device

 

T) AT+BTUNPAIR=?

+BTUNPAIR: (index)

 

OK

W) AT+BTUNPAIR=<paired index>

OK

+BTUNPAIR: <status>

or

ERROR

 

 

<index> Interger, the response of AT+BTPAIRED.
<status>

0     fail

1     success

 

 

Example

AT+BTUNPAIR=1

+BTUNPAIR: 1

OK

 

 

 

 

AT+BTPAIRED     Get Paired With BT Device

  

R) AT+BTPAIRED?

OK

+BTPAERED: <paired devices num>,<index>,<BT name>,<MAC addr>

 

 

<paired devices num> The total number of bonded devices
<index> The index of current bond device
<BT name> refer to AT+BTSCAN
<MAC addr> refer to AT+BTSCAN

 

 

Example

AT+BTPAIRED?

OK

 

+BTPAIRED: 2, 1, Honor V8, 60:83:34:82:CC:A3

+BTPAIRED: 2, 2, ww C4:0B:CB:3E:68:62

 

 

 

 

AT+BTSPPSRV     Active/Deactive Spp Server

 

T) AT+BTSPPSRV=?

+BTSPPSRV: (0-1)

 

OK

R) AT+BTSPPSRV?

+BTSPPSRV: <status>

 

OK

W) AT+BTSPPSRV=<flag>

OK

+BTSPPSRV: <status>

or

ERROR

 

 

<flag>

0     deactive

1     active

<status>

0     deactived

1     actived

 

 

Example

AT+BTSPPSRV?

+BTSERVER: 0

OK

 

AT+BTSPPSRV=1

OK

 

+BTSPPSRV: 1

 

 

 

 

AT+BTSPPPROF     Get Remote Device Spp Status

 

R) AT+BTSPPPROF=<index>

+BTSPPPROF: <status>

 

OK

or

ERROR

 

 

<index> the index of response list of AT+BTPAIRED command
<status>

0     device SPP service is not active

1     device SPP service is active

 

 

Example

AT+BTPAIRED?

OK

 

+BTPAIRED: 2, 1, Honor V8, 60:83:34:82:CC:A3

+BTPAIRED: 2, 2, ww C4:0B:CB:3E:68:62

AT+BTSPPPROF=2

OK

 

+BTSPPPROF:1

 

 

 

 

AT+BTSPPCONN      SPP Connect/Disconnect

  

T) AT+BTSPPCONN=?

+BTSPPCONN: (0-1)

 

OK

R) AT+BTSPPCONN?

+BTSPPCONN: <status>

 

OK

W) AT+BTSPPCONN=<action>[,<paired index>]

OK

+BTSPPCONN: <status>[,<max frame size>][,<device mac>]

or

ERROR

 

 

<action>

0     disconect

1     connect

<paired index>

The response of AT+BTPAIRED.

The max value is 64.

<status>

0     disconnected

1     connected

 

 

Example

AT+BTSPPCONN?

+BTSPPCONN: 0

OK

 

AT+BTSPPCONN=1,1

OK

 

+BTSPPCONN: 1, 990, C4:07:2F:C5:D1:8A

 

 

NOTE

The device may receive +BTSPPCONN:<status>[,<max frame size>] [,<device mac>] when other device connected successfully.

 

 

 

 

AT+BTSPPSEND     SPP Send Data

 

W) AT+BTSPPSEND=<data>

OK

+BTSPPSEND: <result>

 

or

ERROR

 

 

<data>

Format     ucs2

“ucs2”     16-bit universal multiple-octet coded character set;

UCS2 character strings are converted to hexadecimal number from 0000 to FFFF.

For examples :

If we want to send a string “123abc”

The data is : 003100320033006100620063

<result>

0     send fail

1     send success

 

 

Example

AT+BTSPPSEND=003100320033006100620063

OK

 

AT+BTSPPSEND: 1

 

 

 

 

AT+BTGATTREG     GATT Register

 

W) AT+BTGATTREG=<status>

+BTGATTREG: <status>

 

OK

or

ERROR

 

 

<status>

1     register

0     unregister

 

 

Example

AT+BTGATTREG=1

+BTGATTREG: 1

OK

 

 

 

 

AT+BTGATTACT     GATT Active

 

E) AT+BTGATTACT

+BTGATTACT: <status>

 

OK

or

ERROR

W) AT+BTGATTACT=<auto_broadcast>[,<perferedMTU>]

OK

or

ERROR

 

 

<status>

1     active

0     not avtive

<auto_brodcast>

0     disable auto activate GATT after a connection was closed

1     enable auto activate GATT after a connection was closed

<perferedMTU>

A integer value from 24 to 512, means to the maximum size of any packet sent between a client and a

server.

If not set, default packet size is 23bytes.

The details refer to Note.

 

 

Example

AT+BTGATTACT

+BTGATTACT: 1

OK

 

 

 

 

AT+BTGATTCREDB     GATT Create DB

  

E) AT+BTGATTCREDB

+BTGATTCREDB: <status>

 

OK

or

ERROR

 

 

<status>

1     sucess

0     fail

 

 

Example

AT+BTGATTCREDB

+BTGATTCREDB: 1

OK

 

 

 

 

AT+BTGATTCRESRV     GATT Create Service

  

W) AT+BTGATTCRESRV=<uuid> 

+BTGATTCRESRV: <status>

 

OK

or

ERROR

 

 

<uuid> Service id,4 Hex character or 32 Hex character
<status>

1     success

0     fail

 

 

Example

AT+BTGATTCRESRV=34A3

+BTGATTCRESRV: 1

OK

 

 

 

 

AT+BTGATTCRECHAR     Create Service Characteristic

  

W) AT+BTGATTCRECHAR=<uuid>,<property>,<permission> 

+BTGATTCRECHAR: <status>,<0Xuuid>,<handle>

 

OK

or

ERROR

 

 

<uuid>

UUID of this characteristic.

A string with  hex  value.

The  length of it only can be set 4 or 32.

<property> Properties of this characteristic.
<permission> Permission of this characteristic.
<status>

1     sucess

0     fail

<handle> Int, Characteristic handle
 

 

Example

AT+BTGATTCRECHAR=34567,2,16

+BTGATTCRECHAR: 1,0X4567,13

OK

 

 

 

 

AT+BTGATTCRECHARDES     Create Service Characteristic Description

 

E) AT+BTGATTCRECHARDES

+BTGATTCRECHARDES: <status>

 

OK

or

ERROR

 

 

<status>

1     success

0     fail

 

 

Example

AT+BTGATTCRECHARDES

+BTGATTCRECHARDES: 1

OK

 

 

 

 

AT+BTGATTSRVADD     DB Add To GATT Server

 

E) AT+BTGATTSRVADD

+BTGATTSRVADD: <status>

 

OK

or

ERROR

 

 

<status>

1     success

0     fail

 

 

Example

AT+BTGATTSRVADD

+BTGATTSRVADD: 1

OK

 

 

 

 

AT+BTGATTREADCFM     Response To BTGATTREADIND

  

W) AT+BTGATTREADCFM=<respCode>,<data>

+BTGATTREADCFM: 1

 

OK

or

ERROR

 

 

<respCode>

Response result for client request.

The range is 0-255.

0     success

Others     not support, invalid parameter

<data>

character, Response data to BTGATTREADIND,if data length less than maxlen(BTGATTREADIND return),

data will be send immediately to client , if data length equal to maxlen ,

the module will receive BTGATTREADIND again till data length less than maxlen.

 

 

Example

+BTGATTREADIND: 13,22

AT+BTGATTREADCFM=0,123456

+BTGATTREADCFM:1

OK

 

 

 

 

AT+BTGATTWRCFM     Response To BTGATTWRIND

 

W) AT+BTGATTWRCFM=<result >

+BTGATTWRCFM: <status>

 

OK

or

ERROR

 

 

<result> 0     success
<status> 1     success

 

 

Example

+BTGATTWRIND: 15,DB12C8

AT+BTGATTWRCFM=0

+BTGATTWRCFM: 1

OK

 

 

 

 

AT+BTGATTNOTIFY     Send Notification To Client

 

W) AT+BTGATTNOTIFY=<handle>,<data>

+BTGATTNOTIFY: <status>

 

OK

or

ERROR

 

 

<handle> Int, Characteristic handle, (2.17 response returns, nd the characteristic’s property is indication)
<data> character, Data to be send, (max length is 20)
<status>

1     sucess

0     fail

 

 

Example

AT+BTGATTNOTIFY=17,34567

+BTGATTNOTIFY:1

OK

 

 

 

 

AT+BTGATTSENDIND     Send Indication To Client

 

W) AT+BTGATTSENDIND=<handle>,<data>

+BTGATTSENDIND: <status>

 

OK

or

ERROR

 

 

<handle> Int, Characteristic handle, (2.17 response returns, nd the characteristic’s property is indication)
<data> character, Data to be send, (max length is 20)
<status>

1     success

0     fail

 

 

Example

AT+BTGATTSENDIND=19,34567

+BTGATTSENDIND: 1

OK

 

 

 

 

+BTSPPRECV     SPP Receive Data

  

  +BTSPPRECV: <data len>,<data>

 

 

<data len> Integer type,0 – 100
<data>

Format     ucs2

For examples :

If we have received a string 003100320033006100620063

Means receive a string “123abc”

 

 

Example

+BTSPPRECV=12, 003100320033006100620063

+BTGATTSENDIND: 1

 

 

 

 

+BTGATTCONN     Client Connect Status

  

  +BTGATTCONN: <status>,<device mac>

 

 

<status>

1     connected

0     disconnected

 

 

Example +BTGATTCONN: 1, 68:68:79:6D:75:26                       

                                                                         

 

 

 

+BTGATTREADIND      Receive Client Read Request

 

  +BTGATTREADIND: <handle>,<maxlen>

 

 

<handle> Int, Characteristic handle
<maxlen> The maximum length that the value of the attribute must have.

 

 

Example +BTGATTREADIND: 13,22              

                                                                                            

 

 

 

 +BTGATTWRIND      Receive Client Write Request

  

  +BTGATTWRIND: <handle>,<data>

 

 

<handle> Int, Characteristic handle
<data> Data to be writed (Hex charcters)

 

 

Example +BTGATTWRIND: 15, DB12C8
 

 

 

 

Adsense

EMW3070

Viewed Page List