BLE Command Format

The Command frame format is shown below. This description is for a Little Endian System.

Figure 1 - Command Frame Format

The following table provides the general description of the frame descriptor.

Frame Descriptor

WordFrame Descriptor
Word0 W0[15:0]Bits [11:0] – Length of the frame
Bits [15:12] – 2 (indicates Bluetooth packet).
Word1 W1[15:0]Bits [15:0] – Packet type
Word2 W2[15:0]Reserved
Word3 W3[15:0]Reserved
Word4 W4[15:0]Reserved
Word5 W5 [15:0]Reserved
Word6 W6 [15:0]1. (0x0000) when sent from host to module.
2. When sent from module to host (as response frame), it contains the status.
Word7 W7 [15:0]Reserved

Three types of frames will get exchanged between the module and the host.

  1. Request/Command Frames - These are sent from Host to Module. Each Request/ Command has an associated response with it.

  2. Response Frames – These are sent from Module to Host. These are given in response to the previous Request/Command from the Host. Each command has a single response.

  3. Event Frames – These are sent from Module to Host. These are given when there are multiple responses for a particular Request/Command frame. There is an Asynchronous message to be sent to host.

The following are the types of frame requests and responses and the corresponding codes. The commands are different for both Classic and LE modes. The below Table lists the Command, Response and Event frames in LE mode.

In both the modes, the corresponding code is to be filled in W1 [15:0] mentioned in the Table above.

Frame Request Types and Responses together with corresponding Codes

CommandCommand ID
Set Local Name0x0001
Get Local Name0x0002
Get RSSI0x0005
Get Local BD Address0x0007
Advertise0x0075
scan0x0076
connect0x0077
disconnect0x0078
Query Device State0x0079
connection parameter update0x007A
Start Encryption0x007B
SMP Pair Request0x007C
SMP Response0x007D
SMP Passkey0x007E
Query Profiles list0x007F
Query Profile0x0080
Query Characteristic Services0x0081
Query Include Services0x0082
Read Characteristic Value by UUID0x0083
Query Attribute Descriptor0x0084
Query Attribute Value0x0085
Query Multiple Attribute Values0x0086
Query Long Attribute Values0x0087
Set Attribute Value0x0088
Set Attribute Value No Ack0x0089
Set Long Attribute Value0x008A
Set Prepare Long Attribute Value0x008B
Execute Long Attribute Value Write0x008C
Initialize BLE module0x008D
De-initialize BLE module0x008E
Antenna Select0x008F
Add New Service0x0092
Add New Attribute0x0093
Set local attribute value0x0094
Get local attribute value0x0095
Notify request0x0096
Set advertise data0x009C
Get LE ping timeout0x00A1
Set LE ping timeout0x00A2
Set Random Address0x00A3
Data Encrypt0x00A4
GATT Read0x00A5
scan Response0X00A8
White List0X00AA
Remove Service0X00AB
Remove Attribute0X00AC
Resolvlist0X00AD
Get Resolvlist Size0X00AE
Set Resolution Enable0X00AF
Read Phy0X00B0
Set Phy0X00B1
Set Data Length0x00B2
Read Data Length0x00B3
Set Privacy Mode0x00B4
CBFC connection Request0x00B5
CBFC connection Response0x00B6
CBFC Tx Data0x00B7
CBFC disconnect0x00B8
LE LTK Request Reply0x00BA
Rx Test Mode0x00BB
Tx Test Mode0x00BC
End Test Mode0x00BD
Vendor Specific0x00BE
PER Tx Mode0x00BF
PER Rx Mode0x00C0
Profiles Async Request0x00F2
Profile Async Request0x00F3
Get char services Async0x00F4
Get Include services Aync0x00F5
Read char value by UUID Async0x00F6
Get attribute Async0x00F7
Get Descriptor value async0x00F8
Get multiple values Async0x00F9
Get Long desc values Async0x00FA
Set desc value Async0x00FB
Set prepare write Async0x00FC
Execute Long desc write Async0x00FD

Response IDs in BLE Mode

ResponseResponse ID
Card Ready0x0505
Set Local Name0x0001
Get Local Name0x0002
Get RSSI0x0005
Get Local BD Address0x0007
Advertise0x0075
scan0x0076
connect0x0077
disconnect0x0078
Query Device State0x0079
connection parameter update0x007A
Start Encryption0x007B
SMP Pair Request0x007C
SMP Response0x007D
SMP Passkey0x007E
Query Profiles list0x007F
Query Profile0x0080
Query Characteristic Services0x0081
Query Include Services0x0082
Read Characteristic Value by UUID0x0083
Query Attribute Descriptor0x0084
Query Attribute Value0x0085
Query Multiple Attribute Values0x0086
Query Long Attribute Values0x0087
Set Attribute Value0x0088
Set Attribute Value No Ack0x0089
Set Long Attribute Value0x008A
Set Prepare Long Attribute Value0x008B
Execute Long Attribute Value Write0x008C
Initialize BLE module0x008D
Deinitialize BLE module0x008E
Antenna Select0x008F
Add New Service0x0092
Add New Attribute0x0093
Set local attribute value0x0094
Get local attribute value0x0095
Notify Response0x0096
Indicate value0x0097
Set advertise data0x009C
Get le ping timeout0x00A1
Set le ping timeout0x00A2
Set Random Address0x00A3
Data Encrypt0x00A4
GATT Read0x00A5
scan Response0X00A8
White List0X00AA
Remove Service0X00AB
Remove Attribute0X00AC
Resolvlist0X00AD
Get Resolvlist Size0X00AE
Set Resolution Enable0X00AF
Read Phy0X00B0
Set Phy0X00B1
Set Data Length0x00B2
Read Data Length0x00B3
Set Privacy Mode0x00B4
CBFC connect Request0x00B5
CBFC connect Response0x00B6
CBFC Tx Data0x00B7
CBFC disconnect0x00B8
LE LTK Request Reply0x00BA
Rx Test Mode0x00BB
Tx Test Mode0x00BC
End Test Mode0x00BD
Vendor Specific0x00BE
PER Tx Mode0x00BF
PER Rx Mode0x00C0
Profiles Async Request0x00F2
Profile Async Request0x00F3
Get char services Async0x00F4
Get Include services Aync0x00F5
Read char value by UUID Async0x00F6
Get attribute Async0x00F7
Get Descriptor value async0x00F8
Get multiple values Async0x00F9
Get Long desc values Async0x00FA
Set desc value Async0x00FB
Set prepare write Async0x00FC
Execute Long desc write Async0x00FD

Event IDs in BLE Mode

EventEvent ID
disconnected0x1006
GATT Error Response0x1500
GATT Desc Val Response0x1501
GATT Primary Service by UUID0x1502
GATT Read Char Services0x1503
GATT Read Include Services0x1504
GATT Read Val by UUID0x1505
GATT Read Response0x1506
GATT Read Blob Response0x1507
GATT Read Multiple Response0x1508
GATT Primary Service list0x1509
GATT Write Response0x150A
GATT Prepare Write Response0x150B
GATT Execute Write Response0x150C
scan Response0x150E
connection Status0x150F
SMP Request0x1510
SMP Response0x1511
SMP Passkey0x1512
SMP Failed0x1513
GATT Notification0x1514
GATT Indication0x1515
Encrypt Status0x1516
GATT Write0x1517
LE ping timeout expired0x1518
Prepare Write0x1519
Execute Write0x151A
GATT Read0x151B
MTU size0x151C
SMP passkey display0x151D
Phy Update Complete0x151E
Data length change event0x151F
SMP SC Passkey0x1520
Enhanced connection Event0x1521
Directed Advertising Report0x1522
Security Keys0x1523
PSM connection Request0x1524
PSM connection Complete0x1525
PSM Rx Data0x1526
PSM disconnect0x1527
LE LTK Request0x152A
connection Update Complete0x152B
Remote Features0x152C
BLE More Data Request0x152D