BT Classic Command Format
- This section explains the general command format, commands should be sent to the module in the specified format.
- Format is same for both Classic and LE modes.
- Commands are sent to the module and responses are read from the module using frame write/ frame read (as mentioned in the preceding sections), these commands are called as command frames.
-
The format of the command frames are divided into two parts:
- Frame descriptor (16 bytes)
- Frame Body / Payload (multiples of 4 bytes)
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
Word | Frame 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.
-
Request/Command Frames - These are sent from Host to Module. Each Request/ Command has an associated response with it.
-
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.
-
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 BT Classic mode.
In both the modes, the corresponding code is to be filled in W1 [15:0] mentioned in the Table above.
Command IDs In BT Classic Mode
Command | Command ID |
---|---|
Set Local Name | 0x0001 |
Query Local Name | 0x0002 |
Set Local COD | 0x0003 |
Query Local COD | 0x0004 |
Query RSSI | 0x0005 |
Query Link Quality | 0x0006 |
Query Local BD Address | 0x0007 |
Set Profile Mode | 0x0008 |
Set Device Discover Mode | 0x0009 |
Get Device Discover Mode | 0x000A |
Set Connection Mode | 0x000B |
Get Connection Mode | 0x000C |
Set Pair Mode | 0x000D |
Get Pair Mode | 0x000E |
Remote Name Request | 0x000F |
Remote Name Request Cancel | 0x0010 |
Inquiry | 0x0011 |
Inquiry Cancel | 0x0012 |
Bond or Create Connection | 0x0013 |
Bond Cancel or Create Connection Cancel | 0x0014 |
Unbond or Disconnect | 0x0015 |
Set Pin Type | 0x0016 |
Get Pin Type | 0x0017 |
User Confirmation | 0x0018 |
Passkey Reply | 0x0019 |
Pincode Reply | 0x001A |
Get Local Device Role | 0x001B |
Set Local Device Role | 0x001C |
Get Service List | 0X001D |
Search Service | 0X001E |
SPP connect | 0X001F |
SPP Disconnect | 0X0020 |
SPP Transfer | 0X0021 |
Initialize BT Module | 0x008D |
Deinitialize BT Module | 0x008E |
Antenna Select | 0x008F |
Linkkey Reply | 0x0091 |
PER Transmit | 0x0098 |
PER Receive | 0x0099 |
PER Stats | 0x009A |
PER CW mode | 0x009B |
Sniff Mode | 0x009D |
Sniff Exit | 0x009E |
Sniff Subrating | 0x009F |
Feature Bit map | 0x00A6 |
Set Antenna Tx Power Level | 0x00A7 |
AFH channel Classification | 0x00D2 |
Set SSP mode | 0x00A0 |
Set EIR data | 0X00A9 |
A2DP Connect | 0x0022 |
A2DP Disconnect | 0x0023 |
A2DP Start | 0x00CE |
A2DP Suspend | 0x00CF |
A2DP PCM Data | 0x00D0 |
A2DP SBC Data | 0x00D1 |
AVRCP Connect | 0X0024 |
AVRCP Disconnect | 0X0025 |
AVRCP Play | 0X0026 |
AVRCP Pause | 0X0027 |
AVRCP Stop | 0X0028 |
AVRCP Next | 0X0029 |
AVRCP Previous | 0X002A |
HFP Connect | 0x002D |
HFP Disconnect | 0x002E |
HFP Phone Operator | 0x002F |
HFP Call Accept | 0x0030 |
HFP Call Reject | 0x0031 |
HFP Dial Number | 0x0032 |
HFP Dial Member | 0x0033 |
HFP Redial | 0x0034 |
HFP Voice Recognition Active | 0x0035 |
HFP Voice Recognition Deactive | 0x0036 |
HFP Speak Gain | 0x0037 |
HFP Mic Gain | 0x0038 |
HFP Get Calls | 0x0039 |
HFP Audio | 0x003A |
PBAP Connect | 0x003B |
PBAP Disconnect | 0x003C |
PBAP Contacts | 0x003D |
Set AFH Channel Classification | 0x00D2 |
AVRCP Get Capabilities | 0x00D3 |
AVRCP Get Attributes List | 0x00D4 |
AVRCP Get Attributes Values List | 0x00D5 |
AVRCP Get Current Attribute Value | 0x00D6 |
AVRCP Set Current Attribute Value | 0x00D7 |
AVRCP Get Element Attributes | 0x00D8 |
AVRCP Get Play Status | 0x00D9 |
AVRCP Get Register Notification | 0x00DA |
AVRCP Get Version | 0x00DB |
AVRCP Get Attribute Text | 0x00DC |
AVRCP Get Attribute Value Text | 0x00DD |
AVRCP Get Battery Status | 0x00DE |
AVRCP Get Character Sets | 0x00DF |
AVRCP Capabilities Response | 0x00E0 |
AVRCP Attributes List Response | 0x00E1 |
AVRCP Attributes Values List Response | 0x00E2 |
AVRCP Get Current Attributes Values List Response | 0x00E3 |
AVRCP Set Current Attributes Values List Response | 0x00E4 |
AVRCP Get Element Attributes Response | 0x00E5 |
AVRCP Get Play Status Response | 0x00E6 |
AVRCP Get Register Notification Response | 0x00E7 |
AVRCP Get Attribute Text Response | 0x00E8 |
AVRCP Get Attribute Value Text Response | 0x00E9 |
AVRCP Get Battery Status Response | 0x00EA |
AVRCP Get Character Sets Response | 0x00EB |
AVRCP Notification | 0x00EC |
AVRCP CMD Reject | 0x00ED |
Add Device ID | 0x00EE |
A2DP Get Config | 0x00FE |
A2DP Set Config | 0x00FF |
NOTE:
A2DP, AVRCP and HFP command IDs are not supported in the v2.1 version of the document.
Response IDs In BT Classic Mode
Response | Response ID |
---|---|
Set Local Name | 0x0001 |
Query Local Name | 0x0002 |
Set Local COD | 0x0003 |
Query Local COD | 0x0004 |
Query RSSI | 0x0005 |
Query Link Quality | 0x0006 |
Query Local BD Address | 0x0007 |
Set Profile Mode | 0x0008 |
Set Device Discover Mode | 0x0009 |
Get Device Discover Mode | 0x000A |
Set Connection Mode | 0x000B |
Get Connection Mode | 0x000C |
Set Pair Mode | 0x000D |
Get Pair Mode | 0x000E |
Remote Name Request | 0x000F |
Remote Name Request Cancel | 0x0010 |
Inquiry | 0x0011 |
Inquiry Cancel | 0x0012 |
Bond or Create Connection | 0x0013 |
Bond Cancel or Create Connection Cancel | 0x0014 |
Unbond or Disconnect | 0x0015 |
Set Pin Type | 0x0016 |
Get Pin Type | 0x0017 |
User Confirmation | 0x0018 |
Passkey Reply | 0x0019 |
Pincode Reply | 0x001A |
Get Local Device Role | 0x001B |
Set Local Device Role | 0x001C |
Get Service List | 0X001D |
Search Service | 0X001E |
SPP Connect | 0X001F |
SPP Disconnect | 0X0020 |
SPP Transfer | 0X0021 |
Initialize BT Module | 0x008D |
Deinitialize BT Module | 0x008E |
Antenna Select | 0x008F |
Linkkey Reply | 0x0091 |
PER Transmit | 0x0098 |
PER Receive | 0x0099 |
PER Stats | 0x009A |
PER CW Mode | 0x009B |
Sniff Mode | 0x009D |
Sniff Exit | 0x009E |
Sniff Subrating | 0x009F |
Feature Bit map | 0x00A6 |
Set Antenna Tx Power Level | 0x00A7 |
AFH channel Classification | 0x00D2 |
Set SSP mode | 0x00A0 |
Set EIR data | 0X00A9 |
A2DP Connect | 0x0022 |
A2DP Disconnect | 0x0023 |
A2DP Start | 0x00CE |
A2DP Suspend | 0x00CF |
A2DP PCM Data | 0x00D0 |
A2DP SBC Data | 0x00D1 |
AVRCP Connect | 0X0024 |
AVRCP Disconnect | 0X0025 |
AVRCP Play | 0X0026 |
AVRCP Pause | 0X0027 |
AVRCP Stop | 0X0028 |
AVRCP Next | 0X0029 |
AVRCP Previous | 0X002A |
HFP Connect | 0x002D |
HFP Disconnect | 0x002E |
HFP Phone Operator | 0x002F |
HFP Call Accept | 0x0030 |
HFP Call Reject | 0x0031 |
HFP Dial Number | 0x0032 |
HFP Dial Member | 0x0033 |
HFP Redial | 0x0034 |
HFP Voice Recognition Active | 0x0035 |
HFP Voice Recognition Deactive | 0x0036 |
HFP Speak Gain | 0x0037 |
HFP Mic Gain | 0x0038 |
HFP Get Calls | 0x0039 |
HFP Audio | 0x003A |
PBAP Connect | 0x003B |
PBAP Disconnect | 0x003C |
PBAP Contacts | 0x003D |
Set AFH Channel Classification | 0x00D2 |
AVRCP Get Capabilities | 0x00D3 |
AVRCP Get Attributes List | 0x00D4 |
AVRCP Get Attributes Values List | 0x00D5 |
AVRCP Get Current Attribute Value | 0x00D6 |
AVRCP Set Current Attribute Value | 0x00D7 |
AVRCP Get Element Attributes | 0x00D8 |
AVRCP Get Play Status | 0x00D9 |
AVRCP Get Register Notification | 0x00DA |
AVRCP Get Version | 0x00DB |
AVRCP Get Attribute Text | 0x00DC |
AVRCP Get Attribute Value Text | 0x00DD |
AVRCP Get Battery Status | 0x00DE |
AVRCP Get Character Sets | 0x00DF |
AVRCP Capabilities Response | 0x00E0 |
AVRCP Attributes List Response | 0x00E1 |
AVRCP Attributes Values List Response | 0x00E2 |
AVRCP Get Current Attributes Values List Response | 0x00E3 |
AVRCP Set Current Attributes Values List Response | 0x00E4 |
AVRCP Get Element Attributes Response | 0x00E5 |
AVRCP Get Play Status Response | 0x00E6 |
AVRCP Get Register Notification Response | 0x00E7 |
AVRCP Get Attribute Text Response | 0x00E8 |
AVRCP Get Attribute Value Text Response | 0x00E9 |
AVRCP Get Battery Status Response | 0x00EA |
AVRCP Get Character Sets Response | 0x00EB |
AVRCP Notification | 0x00EC |
AVRCP CMD Reject | 0x00ED |
Add Device ID | 0x00EE |
A2DP Get Config | 0x00FE |
A2DP Set Config | 0x00FF |
NOTE:
A2DP, AVRCP and HFP Response IDs are not supported in the v2.1 version of the document.
Table 4. Event IDs In BT Classic Mode
Event | Event ID |
---|---|
Role Change Status | 0x1000 |
Unbond or Disconnect | 0x1001 |
Bond Response | 0x1002 |
Inquiry Response | 0x1003 |
Remote Device Name | 0x1004 |
Remote Name Request Cancelled | 0x1005 |
Disconnected | 0x1006 |
User Confirmation Request | 0x1007 |
User Passkey Display | 0x1008 |
User Pincode Request | 0x1009 |
User Passkey Request | 0x100A |
Inquiry Complete | 0x100B |
Authentication Complete | 0x100C |
User Linkkey Request | 0x100D |
User Linkkey Save | 0x100E |
SSP Complete | 0x100F |
BT Mode Changed | 0x1010 |
BT Sniff Subrating Changed | 0x1011 |
BT User Passkey Notify | 0x1012 |
SPP Receive Data | 0x1100 |
SPP Connected | 0x1101 |
SPP Disconnected | 0x1102 |
A2DP Connected | 0x1200 |
A2DP Disconnected | 0x1201 |
A2DP Configured | 0x1202 |
A2DP Open | 0x1203 |
A2DP Start | 0x1204 |
A2DP Suspend | 0x1205 |
A2DP Abort | 0x1206 |
A2DP Close | 0x1207 |
A2DP Encoded data | 0x1208 |
A2DP PCM data | 0x1209 |
A2DP More data request | 0x120A |
A2DP Codec Config | 0x120B |
AVRCP Connected | 0x1300 |
AVRCP Disconnected | 0x1301 |
AVRCP Play | 0x1302 |
AVRCP Pause | 0x1303 |
AVRCP Next | 0x1304 |
AVRCP Previous | 0x1305 |
AVRCP Stop | 0x1306 |
AVRCP Notify | 0x1310 |
AVRCP Capabilities Request | 0x1311 |
AVRCP Attributes List Request | 0x1312 |
AVRCP Values List Request | 0x1313 |
AVRCP Current Attribute Value Request | 0x1314 |
AVRCP Set Attribute Value Request | 0x1315 |
AVRCP Attribute Text Request | 0x1316 |
AVRCP Value Text Request | 0x1317 |
AVRCP Character Set Request | 0x1318 |
AVRCP Battery Status Request | 0x1319 |
AVRCP Element Attribute Request | 0x131A |
AVRCP Player Status Request | 0x131B |
AVRCP Register Notification | 0x131C |
HFP Connected | 0x1400 |
HFP Disconnected | 0x1401 |
HFP Ring | 0x1402 |
HFP Call caller id | 0x1403 |
HFP Audio Connected | 0x1404 |
HFP Audio Disconnected | 0x1405 |
HFP Dial Complete | 0x1406 |
HFP Answer Complete | 0x1407 |
HFP Hang Up Complete | 0x1408 |
HFP Send DTMF Complete | 0x1409 |
HFP Call wait | 0x140A |
HFP Voice Recognition Deactivated | 0x140B |
HFP Voice Recognition Activated | 0x140C |
HFP Service Not Found | 0x140D |
HFP Call Status | 0x140E |
HFP Signal Strength | 0x140F |
HFP Battery Level | 0x1410 |
HFP Phone Service | 0x1411 |
HFP Roaming Status | 0x1412 |
HFP Call Setup | 0x1413 |
HFP Call Held Status | 0x1414 |
PBAP Connected | 0x1450 |
PBAP Disconnected | 0x1451 |
PBAP Data | 0x1452 |
NOTE:
A2DP, AVRCP and HFP Response IDs are not supported in the v2.1 version of the document.