NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
CC256x VS HCI Commands
Bluetooth CC256x Vendor-Specific HCI Commands User's Guide
Contents
- 1 Introduction
- 2 HCI Commands
- 2.1 HCI Commands List Format
- 2.2 Detailed Description of Supported HCI Commands:
- 2.2.1 HCI_VS_Write_BD_Addr (0xFC06)
- 2.2.2 HCI_VS_Write_CODEC_Config (0xFD06)
- 2.2.3 HCI_VS_Write_CODEC_Config_Enhanced (0xFD07)
- 2.2.4 HCI_VS_DRP_Read_BER_Meter_Result (0xFD13)
- 2.2.5 HCI_VS_DRPb_Tester_Con_RX (0xFD17)
- 2.2.6 HCI_VS_LE_Enable (0xFD5B)
- 2.2.7 HCI_VS_Set_LE_Test_Mode_Parameters (0xFD77)
- 2.2.8 HCI_VS_DRPb_Enable_RF_Calibration (0xFD80)
- 2.2.9 HCI_VS_DRPb_Tester_Con_TX(0xFD84)
- 2.2.10 HCI_VS_DRPb_Tester_Packet_TX_RX (0xFD85)
- 2.2.11 HCI_VS_DRPb_Reset (0xFD88)
- 2.2.12 HCI_VS_DRPb_BER_Meter_Start (0xFD8B)
- 2.2.13 HCI VS LE Read Ber Test Results (0xFDAE)
- 2.2.14 HCI_VS_Read_RSSI (0xFDFC)
- 2.2.15 HCI_VS_Write_SCO_Configuration (0xFE10)
- 2.2.16 HCI_VS_Set_Pcm_Loopback_Enable (0xFE28)
- 2.2.17 HCI_VS_Read_Hardware_Register (0xFF00)
- 2.2.18 HCI_VS_Write_Hardware_Register (0xFF01)
- 2.2.19 HCI_VS_Update_UART_HCI_Baudrate (0xFF36)
- 2.2.20 HCI_VS_Set_Supported_Features (0xFF26)
- 2.2.21 HCI_VS_HCILL_Parameters (0xFD2B)
- 2.2.22 HCI_VS_Sleep_Mode_Configurations (0xFD0C)
- 2.2.23 HCI_VS_Get_System_Status (0xFE1F)
- 2.2.24 HCI_VS_Read_Patch_Version (0xFF22)
- 2.2.25 HCI_VS_DRPb_Set_Power_Vector (0xFD82)
- 2.2.26 HCI_VS_DRPb_Set_Class2_Single_Power (0xFD87)
- 2.2.27 HCI_VS_LE_Output_Power (0xFDDD)
- 2.2.28 HCI_VS_A3DP_Codec_Configuration (0xFD8E)
- 2.2.29 HCI_VS_AVPR_Enable (0xFD92)
- 2.2.30 HCI_VS_A3DP_Open_Stream (0xFD8C)
- 2.2.31 HCI_VS_A3DP_Close_Stream (0xFD8D)
- 2.2.32 HCI_VS_A3DP_Start_Stream (0xFD8F)
- 2.2.33 HCI_VS_A3DP_Stop_Stream (0xFD90)
- 2.2.34 HCI_VS_A3DP_Sink_Codec_Configuration (0xFD9C)
- 2.2.35 HCI_VS_A3DP_Sink_Open_Stream (0xFD9A)
- 2.2.36 HCI_VS_A3DP_Sink_Close_Stream (0xFD9B)
- 2.2.37 HCI_VS_A3DP_Sink_Start_Stream (0xFD9D)
- 2.2.38 HCI_VS_A3DP_Sink_Stop_Stream (0xFD9E)
- 2.2.39 HCI_VS_WBS_Associate (0xFD78)
- 2.2.40 HCI_VS_WBS_Disassociate (0xFD79)
- 2.3 General Hardware Error Codes
- 2.4 Related Documents
Introduction[edit]
Bluetooth systems consists of a host and a controller. The BT SIG has created a standard protocol for the host to communicate with the controller. This is called the Host Controller Interface (HCI) which is specified in the BT Core 4.1 specification Volume 2 Part E. The HCI provides a uniform command interface to a Controller. There are some commands which are not listed in the specifications and they are specific to the device itself. These commands are vendor-specific commands (VS) generally used for testing and debugging purposes. For further details on testing command sequences, refer to CC256x Testing Guide.
As shown in the diagram above, the host (MSP430) sends HCI commands to the controller (CC256x). The controller then sends HCI events to the host as a response to the HCI commands. All HCI commands follows this format for all packets:
First Byte | Next Bytes |
HCI Packet Type | HCI packet (variable length) |
All HCI commands starts with a byte describing type of packet while the remaining bytes is dependent on the type of HCI packet.
Here is a list of important HCI packet types:
HCI Packet Type |
Packet Type Indicator | Direction |
HCI command packet | 0x01 | Host to baseband controller |
HCI event packet | 0x04 | Baseband controller to host |
Command Packet[edit]
Most of the HCI packets consist of command packets. The host sends these command packets according to the structure detailed in the tables below and the controller sends responses through event packets back to the host. Command packets are used to configure many aspects of the Bluetooth system ranging from the link layer to the baseband layer.
You can also refer to the Core 4.1 Specification Volume 2, Part E, for the format of these HCI packets.
After the first byte,the remaining bytes depends on what type of packet it is. Of these two packet types, the structure of the HCI command packet is:
First Last | ||
16 bit Opcode | 8 bit Length | Parameters(0,1,3,...,N) |
Note: Some commands do not have parameters, thus ends with 0x00 as the length.
Here is a description of the above HCI command packet structure:
Fields | Descriptions |
Opcode | 16 bit unique Opcode for HCI command |
Length | Length of parameters in bytes |
Parameters | Specific parameters associated with each command |
Taking the command HCI_Read_BD_ADDR, this is an example of a command packet consisting of outgoing data to the controller:
Packet Type | Opcode | Opcode | Length |
---|---|---|---|
0x01 | 0x09 | 0x10 | 0x00 |
In this case, the length is zero so no parameters follows afterwards.
Event Packet[edit]
After the packet type (0x04) denoting an Event packet, this is the format for HCI events that are returned by the BT controller to the host:
First Byte | Second Byte | Third Byte | N Byte |
---|---|---|---|
Event Code | Length | Param0 | ParamN |
There are many event packet types and each has a unique event code. The parameters for the command complete event (which has event code of 0x0E) is described as follows:
Param 0 (Byte 1) | Param 1 (Byte 2) | Param 1 (Byte 3) | Param 2 (Byte 4) |
---|---|---|---|
Num_HCI_Command_Packets | Command_Opcode (LSB) | Command_Opcode (MSB) | Return_Parameter(s) |
The Command Complete event is used by the Controller for most commands to transmit return status of a command and the other event parameters that are
specified for the issued HCI command.The Num_HCI_Command_Packets parameter tells the number of HCI command packets which are allowed to be sent to the
Controller from the Host.
This is an example of a returned event after the HCI_Read_BD_ADDR command is issued to the controller.
Packet Type | Event Packet Code | Length | Num of HCI Commands | Command_Opcode (LSB) | Command_Opcode (MSB) | Status |
BD_ADDR (LSB) |
BD_ADDR
(MSB) | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0x04 | 0x0E | 0x0A | 0x01 | 0x09 | 0x10 | 0x00 | 0x11 | 0xD1 | 0xF8 | 0xA5 | 0x0D | 0xBC |
So from this example, the event packet tells us the event was successful (Status is 0x00) and the BT Device Address is "BC:0D:A5:F8:D1:11"
HCI Commands[edit]
HCI Commands List Format
[edit]
Command Name (Opcode)[edit]
Description:
Command Description
Command Parameters:
Command Name (Opcode) Parameter 0, ..., Parameter N
Command Parameter | Size (bytes) | Value | Description |
Parameter Name | Size in bytes of parameter starting with first byte to be sent to BT device |
Value 0 Value 1 Value N |
Description 0 Description 1 Description N |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
Param0 Param1 ParamN |
Description1 DescriptionN |
Size in bytes of returned value starting with first byte received from BT device |
Name of event generated due to previous command sent Ex: Command Complete Event |
Note: Parameter 0 is the first byte sent out, then Param 1,...,etc.
Detailed Description of Supported HCI Commands:
[edit]
HCI_VS_Write_BD_Addr (0xFC06)[edit]
Description:
This command writes the value for the BD_ADDR parameter.
Command Parameters:
HCI_VS_Write_BD_Addr (0xFC06) BD address
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
BD address | 6 | 0xXXXXXXXXXXXX | New BD_ADDR to be written to device. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Write_CODEC_Config (0xFD06)[edit]
Description:
This command configures the codec interface parameters and the PCM clock rate, which is relevant when
the Bluetooth core generates the clock. This command must be used by the host to use the PCM
interface.
Command Parameters:
HCI_VS_Write_CODEC_Config (0xFD06) Clock rate, Clock direction, Frame-sync frequency, Frame-sync duty cycle, Frame-sync edge, Frame-sync polarity, Reserved, Channel 1 data out size, Channel 1 data out offset, Channel 1 data out edge, Channel 1 data in size, Channel 1 data in offset, Channel 1 data in edge, Reserved, Channel 2 data out size, Channel 2 data out offset, Channel 2 data out edge, Channel 2 data in size, Channel 2 data in offset, Channel 2 data in edge, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Clock rate | 2 | 64-16,000 | The PCM clock rate in KHz. Valid values are between 64K to 4096K (for master mode) or 64K to 16M (for slave mode). It influences other parameters such as wait cycles and frequency rate calculation and therefore must be configured even if an external clock is used. |
Clock direction | 1 |
0x00 0x01 |
PCM clock and Fsync direction is output (codec_IF is Master on PCM bus) and sampled on rising edge PCM clock and Fsync direction is input |
Frame-sync frequency | 4 | 100 Hz – 173 kHz | Frame-sync frequency in Hz |
Frame-sync duty cycle | 2 |
0x0001-0xFFFF |
50% of Fsync period (I2S Format) Number of cycles of PCM clock |
Frame-sync edge | 1 |
0x00 0x01 |
Driven/sampled at rising edge of the PCM clock Driven/sampled at falling edge of the PCM clock |
Frame-sync polarity | 1 |
0x00 |
Active high |
Reserved | 1 | ||
Channel 1 data out size | 2 | 0x0001 – 0x0280 | Sample size in bits for each codec Fsync The value is between 1 bit and 0x0280 bits. If data size is greater than 24 bits, the size must be divisible by 8 (for example, 1–24, 32, 40, 48, etc.). |
Channel 1 data out offset |
2 | 0x0000 – 0x00FF | Number of PCM clock cycles between rising of frame sync and data start. NOTE: Please note that the offset of CH2 must be a minimum of CH1 DATA LENGHT + 1. This requirement is important also when CH2 is not used. |
Channel 1 data out edge | 1 |
0x00 0x01 |
Data driven at rising edge of the PCM clock Data driven at falling edge of the PCM clock |
Channel 1 data in size | 2 | 0x0001 – 0x0280 | Sample size in bits for each codec Fsync The value is between 1 bit and 0x0280 bits. If data size is greater than 24 bits, the size must be divisible by 8 (for example, 1–24, 32, 40, 48, etc.). |
Channel 1 data in offset | 2 | 0x0000 – 0x00FF | Number of PCM clock cycles between rising of frame sync and data start |
Channel 1 data in edge | 1 | 0x00 0x01 |
Data sampled at rising edge of the PCM clock Data sampled at falling edge of the PCM clock |
Fsynch Multiplier |
1 |
32/64 |
This field is only relevant to CC256XB from SP 0.2 !!!
When setting the values 0x00 or 0xFF the command will act the same as previously, but when entering a value of 32/64 the Clock Rate will be: Clock Rate = Fsynch Multiplier X Frame Synch frequnecy , for example 44,100Hz X 32 = 1441,200Hz |
Channel 2 data out size | 2 | 0x0001 – 0x0280 | Sample size in bits for each codec Fsync The value is between 1 bit and 0x0280 bits. If data size is greater than 24 bits, the size must be divisible by 8 (for example, 1–24, 32, 40, 48, etc.). |
Channel 2 data out offset | 2 | 0x0000 – 0x00FF | Number of PCM clock cycles between rising of frame sync and data start. NOTE: Please note that the offset of CH2 must be a minimum of CH1 DATA LENGHT + 1. This requirment is important also when CH2 is not used. |
Channel 2 data out edge | 1 |
0x00 0x01 |
Data driven at rising edge of the PCM clock Data driven at falling edge of the PCM clock |
Channel 2 data in size | 2 | 0x0001 – 0x0280 | Sample size in bits for each codec Fsync The value is between 1 bit and 0x0280 bits. If data size is greater than 24 bits, the size must be divisible by 8 (for example, 1–24, 32, 40, 48, etc.). |
Channel 2 data in offset | 2 | 0x0000 – 0x00FF | Number of PCM clock cycles between rising of frame sync and data start |
Channel 2 data in edge | 1 | 0x00 0x01 |
Data sampled at rising edge of the PCM clock Data sampled at falling edge of the PCM clock |
Reserved | 1 |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Write_CODEC_Config_Enhanced (0xFD07)[edit]
Description:
This command configures enhanced configuration of the codec interface. This command is optional and
cannot be used when all default parameters are acceptable. When this command is used, it must come
after HCI_VS_Write_CODEC_Config.
Command Parameters:
HCI_VS_Write_CODEC_Config_Enhanced (0xFD07) Clock shutdown, Clock start, Clock stop, Reserved, Channel 1 data in order, Channel 1 data out order, Channel 1 data out mode, Channel 1 data out duplication, Channel 1 TX_dup_value, Channel 1 data quant, Reserved, Channel 2 data in order, Channel 2 data out order, Channel 2 data out mode, Channel 2 data out duplication, Channel 2 TX_dup_value, Channel 2 data quant, Reserved
Command Parameter | Size | Value | Description |
Clock shutdown | 1 |
0x00 0x01 |
PCM clock shutdown feature is disabled. PCM clock shutdown feature is enabled. Time of start/stop is defined in the following |
Clock start | 2 | 0x0000 – 0xFFFF | Number of PCM clock cycles relative to the PCM frame sync to start PCM clock (for example, start two clocks before frame sync) |
Clock stop | 2 | 0x0000 – 0xFFFF | Number of PCM clock cycles relative to the PCM frame sync to stop PCM clock (for example, stop 20 clocks after frame sync) |
Reserved | 1 | 0x00 | Default: 0x00 |
Channel 1 data in order | 1 |
Bit 0 = 0 Bit 0 = 1
Bit 1 = 0 Bit 1 = 1
Bit 2 = 0 Bit 2 = 1 |
Data driven MSB first
Don’t swap bytes within the sample.
Do not shift the sample. Shift the sample by (24|16-dout_size) bits from MSB to LSB (controls sample alignment |
Channel 1 data out order | 1 |
Bit 0 = 0 Bit 0 = 1
Bit 1 = 0 Bit 1 = 1
Bit 2 = 0 Bit 2 = 1 |
Data driven MSB first
Don’t swap bytes within the sample.
Do not shift the sample.
|
Channel 1 data out mode | 1 |
0x00 0x01 0x02 0x03 |
Always 3-state (input) Always output |
Channel 1 data out duplication | 1 |
0x00 0x01 |
Retransmit last sample when no data are available. 0x01 Transmit DUP_VALUE when no data are available. |
Channel 1 TX_dup_value | 4 | 0x00000000 – 0x00FFFFFF | Replacement value to transmit when no data is available |
Channel 1 data quant | 1 |
0x00 0x01 |
Bit-wise mode. Possible if data in and data out size are up to 24 bits. Byte-wise mode |
Reserved | 1 | ||
Channel 2 data in order | 1 |
Bit 0 = 0 Bit 0 = 1
Bit 1 = 0 Bit 1 = 1
Bit 2 = 0 Bit 2 = 1 |
Data driven MSB first
Don’t swap bytes within the sample.
Do not shift the sample. |
Channel 2 data out order | 1 |
Bit 0 = 0 Bit 0 = 1
Bit 1 = 0 Bit 1 = 1
Bit 2 = 0 Bit 2 = 1 |
Data driven MSB first
Don’t swap bytes within the sample.
Do not shift the sample. |
Channel 2 data out mode | 1 |
0x00 0x01 0x02 0x03 |
Always 3-state (input) Always output |
Channel 2 data out duplication | 1 |
0x00 0x01 |
Retransmit last sample when no data are available. 0x01 Transmit DUP_VALUE when no data are available. |
Channel 2 TX_dup_value | 4 | 0x00000000 – 0x00FFFFFF | Replacement value to transmit when no data is available |
Channel 2 data quant | 1 |
0x00 0x01 |
Bit-wise mode. Possible if data in and data out size are up to 24 bits. Byte-wise mode |
Reserved | 1 |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRP_Read_BER_Meter_Result (0xFD13)[edit]
Description:
This command allows reading of the BER result produced by the internal software-based BER meter.
Command Parameters:
HCI_VS_DRP_Read_BER_Meter_Result (0xFD13)
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
None | 0 | N/A | N/A |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
0xXX | Finished at least one test | 1 | |
0xXXXX | Number of packets received | 2 | |
0xXXXXXXXX | Total bits counted | 4 | |
0xXXXXXXXX | Number of errors found | 4 |
HCI_VS_DRPb_Tester_Con_RX (0xFD17)[edit]
Description:
This command gets the Bluetooth channel index and ADPLL mode and sets the device to continuous reception at the selected frequency.
Command Parameters:
HCI_VS_DRPb_Tester_Con_RX (0xFD17) Frequency, ADPLL loop mode
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Frequency | 1 | 0 - 78 | Selects Bluetooth frequency channel for transmission. Frequency channel index (k), range 0 – 78 (decimal)
Freq = 2402 + 2k, for k = 0, 1, 2 … 39 Freq = 2403 + 2(k–40), for k = 40, 41…78 |
ADPLL loop mode | 1 |
0x00 0x01 |
Open Loop - Used during Scanning Modes, i.e. Inquiry Scan and Page Scan Close Loop - Used during Connection Modes, i.e. Active and Sniff Mode |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_LE_Enable (0xFD5B)[edit]
Description:
This command enables the Bluetooth Low Energy (BLE) function in the controller.
Command Parameters:
HCI_VS_LE_Enable (0xFD5B) Enable/Disable, Load LE code
Command Parameter | Size (bytes) | Value | Description |
Disable Enable |
1 |
0x00 0x01 |
Disable Enable |
Load LE code | 1 |
0x00 0x01 |
Do not load code Load code |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Set_LE_Test_Mode_Parameters (0xFD77)[edit]
Description:
This command configures the test mode parameters for the type of packets to transmit.
Command Parameters:
HCI_VS_Set_LE_Test_Mode_Parameters (0xFD77) TX Power Level, RX Mode, Packets to transmit, Access code, BER Test Enable, BER Test Pattern, BER Test Packet Length, BER FA Threshold, Trace Enable, Reference CRC
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
TX Power Level | 1 | 0x01 | Fixed BLE Power Level See HCI_VS_DRPb_Set_Power_Vector |
RX Mode | 1 |
0x00 0x01 0x02 0x03 |
Normal Wide Window Continous RX Wide Window and power saving |
Packets to transmit | 2 |
0x0000 N |
Unlimited N number of packets to transmit |
Access code | 4 | 0xXXXXXXXX |
An access code to sync and transmit |
BER Test Enable | 1 |
0x00 0x01 |
Disable BER Enable BER |
BER Test Pattern | 1 |
0x00 |
PRBS 9 |
BER Test Packet Length | 1 | N | N Number of payload bytes to be received in the BER test |
BER FA Threshold | 1 | 0xXX | A threshold for FA detection
Default: 20 |
Trace Enable | 1 |
0x00 0x01 |
Disable trace during BER test Enable trace during BER test |
Reference CRC | 4 | 0xXXXX | Reference CRC value for the packet.
Default: 0x0000 |
Returned Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_Enable_RF_Calibration (0xFD80)[edit]
Description:
This command enables an RF calibration run immediately or periodically. It defines the calibration procedures required to run each time the periodic calibration is run. In standby mode, when enabling the periodic run, the calibration should start the run immediately.
Command Parameters:
HCI_VS_DRPb_Enable_RF_Calibration (0xFD80) Periodic mode, Calibration procedures, Override temp condition
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Periodic mode | 1 |
0x00 0x01 - 0xFD 0xFE 0xFF |
Activate the calibration one time Activate the calibration each Value × 10 seconds periodically Do not change Stop the periodic calibration |
Calibration procedures | 4 | 0xXXXXXXXX | Default: 0xFFFFFFFF |
Override temp condition | 1 |
0x00 0x01 |
Activate the calibrations only if the temperature has changed. Activate the calibrations at every periodic calibration. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_Tester_Con_TX(0xFD84)[edit]
Note: Refer to the CC256x Testing Guide for further details on how to use this command.
Description:
This command tests the RF transceiver in continuous transmission mode. The transmitter is activated by configuring the transmission parameters such as pattern, modulation, and frequency.
Command Parameters:
HCI_VS_DRPb_Tester_Con_TX(0xFD84) Modulation, Test pattern, Frequency, Power level, Generator initialization value, EDR generator mask
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Modulation | 1 |
0x00 |
CW - Test pattern (second parameter, below) MUST be set to “All 1” or “All 0” |
Test pattern | 1 |
0x00 |
PN9 |
Frequency | 1 | 0 - 78 | Selects Bluetooth frequency channel for transmission. Frequency channel index (k), range 0 – 78 (decimal)
Freq = 2402 + 2k, for k = 0, 1, 2 … 39 Freq = 2403 + 2(k–40), for k = 40, 41…78 |
Power level | 1 | 0x0F - 0x08 | 0x0F(15): Level with Max Output Power (GFSK, EDR2 or EDR3) 0x08(8): Level with Min Output Power (GFSK, EDR2 or EDR3) 0x01(1): Level with BLE Output Power (BLE)
|
Reserved | 4 | 0xXXXXXXXX | 0x00000000 (Default) |
Reserved | 4 | 0xXXXXXXXX | 0x00000000 (Default) |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_Tester_Packet_TX_RX (0xFD85)[edit]
Description:
This command starts sending/receiving packets using packet transmission parameters such as frequency channel, packet type, and packet length. It is used for Packet TX/RX.
Command Parameters:
HCI_VS_DRPb_Tester_Packet_TX_RX (0xFD85) Frequency mode, TX single-frequency index, RX single-frequency, ACL packet type, ACL packet data pattern, Reserved, ACL packet data length, Power level, Disable whitening, PRBS9 initialization value
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Frequency mode | 1 |
0x00 |
Hopping |
TX single-frequency | 1 | 0 - 78 | Selects Bluetooth frequency channel for transmission. Frequency channel index (k), range 0 – 78 (decimal)
Freq = 2402 + 2k, for k = 0, 1, 2 … 39 Freq = 2403 + 2(k–40), for k = 40, 41…78 |
RX single-frequency | 1 | 0 - 78, 0xFF | Selects Bluetooth frequency channel for transmission. Frequency channel index (k), range 0 – 78 (decimal)
Freq = 2402 + 2k, for k = 0, 1, 2 … 39 Freq = 2403 + 2(k–40), for k = 40, 41…78 0xFF – Disable RX (packet TX only) |
ACL packet type | 1 | 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B |
DM1 DH1 DM3 DH3 DM5 DH5 2-DH1 2-DH3 2-DH5 3-DH1 3-DH3 3-DH5 |
ACL packet data pattern | 1 |
0x00 |
All 0 |
Reserved | 1 | 0xXX | Reserved (Default: 0x00) |
ACL packet data length | 2 |
0-17 |
DM1 |
Power level | 1 | 0 - 15 | 15 = Max Output Power, 0 = Min Output Power |
Disable whitening | 1 |
0x00 |
Enable whitening |
PRBS9 initialization value | 2 | 0x0000 - 0x01FF | Used only in PRBS9 patterns to initialize PRBS9 data |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_Reset (0xFD88)[edit]
Description:
This command resets the BT radio to initial state. This command may be used to stop the Continuous_TX transmission initiated via HCI_VS_DRPb_Con_TX.
Command Parameters:
HCI_VS_DRPb_Reset (0xFD88)
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
None | 0 | N/A | N/A |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_BER_Meter_Start (0xFD8B)[edit]
Description:
This command activates the internal software-based BER meter used in Production Line Test (PLT). The VS command controls the reception frequency and the packet/connection parameters. It turns on a continuous RX and triggers the BER meter into operation.
Command Parameters:
HCI_VS_DRPb_BER_Meter_Start (0xFD8B) Frequency, BD address, LT address, ACL packet type, ACL packet data length, Number of packets, PRBS9 initialization value, Poll period
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Frequency | 1 | 0 - 78 | Selects Bluetooth frequency channel for transmission. Frequency channel index (k), range 0 – 78 (decimal)
Freq = 2402 + 2k, for k = 0, 1, 2 … 39 Freq = 2403 + 2(k–40), for k = 40, 41…78 |
Reserved | 1 | 0xXX | Default: 0x00 |
BD address | 6 | 0xXXXXXXXXXXXX | BD address of the device being tested by its internal BER meter |
LT address | 1 | 0x00-0x05 | Address of the device within a specific Piconet
Default: 0x01 |
ACL packet type | 1 |
0x00 |
DM1 |
ACL packet data length | 2 |
0-17 |
DM1 |
Number of packets | 2 | 0x0000 - 0xFFFF | Number of packets from 0 to 65,535 |
PRBS9 initialization value | 2 | 0x0000 - 0x01FF | Value from which the PRBS pattern generator must start |
Poll period | 1 | 0x00 - 0xFF | Poll period in number of Bluetooth frames
Default:0x01 |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI VS LE Read Ber Test Results (0xFDAE)[edit]
Description:
This command returns the test results from the received packets. This is used in BLE SIG RF PHY Receiver Testing.
Command Parameters:
None.
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
Number of BER in Type received | Htype_Bad_Bits | 4 | |
Number of BER in Length received | Hlength_Bad_Bits | 4 | |
Number of BER in payload received (Part 1) | Ppart1_Bad_Bits | 4 | |
Number of BER in payload received (Part 2) | Ppart2_Bad_Bits | 4 | |
Number of BER in payload received (Part 3) | Ppart3_Bad_Bits | 4 | |
Number of BER in payload received (Part 4) | Ppart4_Bad_Bits | 4 | |
Number of BER in CRC received | CRC_Bad_Bits | 4 | |
Number of SYNC events received | BER_Sync | 4 | |
Number of Packet with Bad Type | Htype_Bad_Packets | 2 | |
Number of Packet with Bad Length | Hlength_Bad_Packets | 2 | |
Number of Packet with Bad CRC | CRC_Bad_Packets | 2 | |
Number of FA Events | FA_Events | 2 | |
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Reserved | 2 | ||
Number of packets with good CRC | Total_Good_Packets | 2 |
HCI_VS_Read_RSSI (0xFDFC)[edit]
Description:
This command returns the RSSI value without the Golden Range threshold for a specified connection handle.
Command Parameters:
HCI_VS_Read_RSSI (0xFDFC), Handle
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Handle | 2 | 0xXXXX | Connection Handle |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
0xXXXX | Connection Handle | 2 | |
0xXX | RSSI (signed 8 bit) | 1 |
HCI_VS_Write_SCO_Configuration (0xFE10)[edit]
Description:
The command configure SCO/eSCO voice path to either PCM or HCI. Once this command is issued, it is valid for all the following SCO/eSCO channels going to be created. It is used to determine the following parameters: SCO connection type - Host or CODEC TX packet length that will be used for flow control calculations. TX buffer max latency that will determine the value of Latency_Thr that determines how much time data can be in the TX buffer before it is flushed out. This parameter is applicable only if flow control is disabled. If flow control is enabled, then the host is in charge to regulate the data flow to keep the latency within limits. Once this command is used, the next ‘Read Buffer Size Command’ will return the new buffer size and an appropriate number of buffers.
Command Default Values:
- Connection type = HCI connection (1)
- TX buffer size = Don’t change
- TX buffer maximum latency = 511 bytes
- Accept packet with bad CRC = Don’t change
Command Parameters:
HCI_VS_Write_SCO_Configuration (0xFE10), Connection type, TX Buffer Size, TX buffer max latency and Accept packet with bad CRC
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection type | 1 | 0 1 0xFF |
Codec Host Don't change |
TX Buffer Size | 1 | 0x0 30-255 bytes |
Keep Current Packet Size New packet size in bytes |
TX buffer max latency | 2 | 0x00 1-720 bytes |
Keep current max latency New max latency in bytes. |
Accept packet with bad CRC | 1 | 0x00 0x01 0xFF |
Reject packet with bad CRC Accept packet with bad CRC Don’t change |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
0x00 0x01-0xFF |
Illegal value New TX Buffer size New buffer size in bytes. |
1 | Command Complete |
0x00-0xFF | Number of available buffers. | 1 | Command Complete |
HCI_VS_Set_Pcm_Loopback_Enable (0xFE28)[edit]
Description:
This command enables PCM loopback between the PCM input data to the PCM output data.
Command Parameters:
HCI_VS_Set_PCM_Loopback_Enable (0xFE28), PCM loopback enable
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
PCM loopback enable | 1 | 0x00
0x01 |
Stop PCM loopback operation
Start PCM loopback operation. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Read_Hardware_Register (0xFF00)[edit]
Description:
This command returns the value of a specific hardware register.
Command Parameters:
HCI_VS_Read_Hardware_Register (0xFF00), Register address
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Register address | 4 | 0xXXXXXXXX | Address of register |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
0xXXXX | Value of register | 2 | Command Complete |
HCI_VS_Write_Hardware_Register (0xFF01)[edit]
Description:
This command assigns a value into a hardware register.
Command Parameters:
HCI_VS_Read_Hardware_Register (0xFF00), Register address, Register value
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Register address | 4 | 0xXXXXXXXX | Address of register |
Register value | 2 | 0xXXXX | Value to assign |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Update_UART_HCI_Baudrate (0xFF36)[edit]
Description:
This command sets the UART HCI baud rate. All baud rates up to 4 Mbps are valid.
Command Parameters:
HCI_VS_Update_UART_HCI_Baudrate (0xFF36) Baud rate
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Baud rate | 4 | 0xXXXXXXXX | Max Baud Rate: 4 Mbps |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Set_Supported_Features (0xFF26)[edit]
Description:
This command changes the supported features of the device.
Command Parameters:
HCI_VS_Set_Supported_Features (0xFF26) Byte, Bit, Support
Command Parameter | Size (bytes) | Value | Parameter Description |
---|---|---|---|
Byte | 1 | 0 1 2 3 4 5 6 7 |
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 |
Bit | 1 | 0 – 7 0xXX |
Single bit Whole byte value |
Support | 1 | 0 1 0xFF |
Not supported Supported Change whole byte |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
Example:
If you want to disable Sniff Mode,for Sniff mode Byte is 0 and Bit is 7. The bytes/bits are defined according to the "FEATURE MASK DEFINITION"(in Part C) of the Bluetooth specification.
Send_HCI_VS_Set_Supported_Features 0xFF26, 0x00, 0x07, 0x00 Wait_HCI_Command_Complete_VS_Set_Supported_Features_Event 5000, 0x00, 0xff26, 0x00
HCI_VS_HCILL_Parameters (0xFD2B)[edit]
Description:
This command controls the behavior of the HCILL deep-sleep protocol.
Command Parameters:
HCI_VS_HCILL_Parameters (0xFD2B) inactivity_timeout, retransmit_timeout, rts_pulse_width
Command Parameter | Size (bytes) | Value | Parameter Description |
---|---|---|---|
inactivity_timeout | 2 | 0x00-0xFFFF | Time from UART inactivity to sending sleep_ind packet. If this value is 0, the device does not send sleep_ind packet. Unit is frames (1.25 ms). |
retransmit_timeout | 2 | 0x00-0xFFFF | Time from sending WAKEUP_IND packet, to a retransmission of this packet. If this value is 0, no retransmission occurs. Unit is frames (1.25 ms). |
rts_pulse_width | 1 | 0x00-0xFF | Each WAKEUP_IND packet can be accompanied by a short pulse on the RTS pin. This parameter controls the minimum width of this pulse. If this value is 0, no pulse is sent. Unit is Micro seconds. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Sleep_Mode_Configurations (0xFD0C)[edit]
Description:
This command configures the sleep mode to be used.
NOTE: Before this command is sent, deep sleep is disabled.
Command Parameters:
HCI_VS_Sleep_Mode_Configurations (0xFD0C) Reserved, Deep sleep enable, Deep sleep mode, Output I/O select, Output pull enable, Input pull enable, Input I/O select, Reserved
Command Parameter | Size (bytes) | Value | Parameter Description |
---|---|---|---|
Reserved | 1 | 0x00 0x01 |
Reserved. Reserved. |
Deep sleep enable | 1 | 0x00 0x01 |
Deep sleep is disabled. Deep sleep is enabled. |
Deep sleep mode | 1 | 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xFF |
HCILL Reserved Reserved Reserved Reserved H5 SPI SDIO command deep sleep protocols (explicit protocol) SDIO clocks deep sleep protocols (implicit protocol) UART_Break Indication lets device enter deep sleep Do not change. |
Output I/O to select | 1 | 0 1 0x02 -0xFE 0xFF |
Reserved (do not use) BT_FUNC1 serves as UART_WAKEUP Reserved (do not use) Do not change. |
Output pull enable | 1 | 0x0 0x1 0xFF |
Output pull (on selected output I/O) is disabled. Output pull (on selected output I/O) is enabled. Do not change. |
Input pull enable | 1 | 0x0 0x1 0xFF |
Input pull (on selected output I/O) is disabled. Input pull (on selected output I/O) is enabled. Do not change. |
Input I/O select | 1 | 0-1 2 0x03 -0xFE 0xFF |
Reserved (do not use) BT_FUNC2 serves as BT_WAKEUP Reserved (do not use) Do not change. |
Reserved | 2 | 0x00 | Default value 0x00 must be used. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_Get_System_Status (0xFE1F)[edit]
Description:
This command returns the current system parameters.
Command Parameters:
HCI_VS_Get_System_Status (0xFE1F) None.
Return Parameters:
Return Parameter | Size (bytes) | Value | Parameter Description |
---|---|---|---|
Status | 1 | 0x00 0x01-0xFF |
Command succeeded. Command failed. |
Software version Major | 1 | 0-0xFF | Major value of the software version being used. |
Software version Internal | 1 | 0-0xFF | Internal value of the software version being used. |
Chip revision | 1 | 0-0xFF | Defines which hardware revision is used. |
Chip mode | 1 | 0 1 2 3 4 5 |
Reserved for TI internal use TI mode Reserved for TI internal use Reserved for TI internal use Reserved for TI internal use Reserved for TI internal use. |
FREF | 2 | 0-0xFFFF | FREF in use (KHz) |
Slow clock used | 1 | 0 1 |
Internal slow clock used External slow clock used |
Process type detected | 1 | 0 1 2 |
Weak process detected Nominal process detected Strong process detected |
Deep-sleep mode | 1 | 0 1 2 3-8 |
Deep sleep disabled Reserved HCILL deep sleep enabled For future use |
Whitening mode | 1 | 0 1 |
Whitening enabled Whitening disabled |
CDC mode | 1 | 0 1 |
CDC disabled CDC enabled |
Self-test | 1 | 0 1 |
Self-test failed Self-test passed |
Hopping mode | 1 | 0 1 |
Frequency hopping Single-frequency TX and RX |
UART baud rate | 4 | 0-0xFFFFFFFF | UART baud rate (bps) |
Temperature index | 1 | 0 1 2 3 4 |
Hot Room Cold Warm Cool |
Temperature detected | 1 | 0x00-0x7F 0xFF-0x08 |
Positive Value Negative Value |
I2C status | 1 | 0 1 2 3-15 |
I2C is enabled. E2PROM is connected. CODEC is connected. For future use |
FREF/TCXO clock | 2 | 0 | not in use. |
PLL sharing running mode | 1 | 0 | not in use. |
HCI_VS_Read_Patch_Version (0xFF22)[edit]
Description:
This command gets all internal details and version numbers of the loaded patches.
All reserved bits and bytes must be 0.
PTCR = Patch trap control register
The following fields contain a unique identification for the patch package and its correlation to the base software version that runs on the device, regardless of whether it is a ROM or a FLASH version:
- Main release major number (1 byte)
- Main release minor number (1 byte)
- Patch trap package ID (1 byte)
- Patch trap package build number (1 byte)
The value of PTCR is set by the post patch load handler, at the end of patch load. Only the enabled patch functions (a bit mask of 12 lowest bits) must be 1, according to the patch package contents.
NOTE: After hardware reset, the PTCR is 0 and the patch is erased; thus, the patch version is also 0. Only after a patch is loaded does the HCI_VS_Read_Patch_Version command return nonzero values. The HCI_RESET behavior flow has been improved to only reset the link manager and link controller in accordance with the Bluetooth specification. It is not required to re-execute the service pack after HCI_RESET has been performed.
Command Parameters:
HCI_VS_Read_Patch_Version (0xFF22) None.
Return Parameters:
Return Parameter | Size (bytes) | Value | Parameter Description |
---|---|---|---|
Status | 1 | 0x00 0x01-0xFF |
Command succeeded. Command failed. |
Enabled Mask | 6 | 0–1 | Bit mask of active patch traps. Every bit holds the value of the corresponding patch of only) the possible 12 traps. The value is read from the PTCR (Patch Trap Control Register). For every bit: 0 = Patch disabled; 1 = Patch enabled. |
ReleaseMajor | 1 | For example, in a patch for software version 3.16, you will get 0x03. | Main release major number. The upper byte of the base software version to which the patch package refers. |
ReleaseMinor | 1 | For example, in a patch for software version 3.16, you will get 0x10. | Main release minor number. The lower byte of the base software version to which the patch package refers. |
PackageID | 1 | For example, in patch package 2, you will get 0x02. | Patch trap package ID. Unique number for the patch package. A patch package contains up to 12 different patch traps. |
Build Number | 1 | For example, in patch package 2 in release (build no.) 4, you will get 0x04. | Patch trap package build number. Unique number for patch package build number.This is a serial number in the patch package. |
HCI_VS_DRPb_Set_Power_Vector (0xFD82)[edit]
Description:
The new transmit power control algorithm is based on the capability to construct power control word for any required power level, based on predetermined ACW and interpolating the required control.
This VS command allows definition of the desired power vector for each modulation scheme, and determination of whether a specific power requires activation of an external PA (in Class1 case).
NOTE: Each power level (dBm) must be a multiple of 2. For example: for 10 dBm, the value of 10 × 2 (or decimal value of 20) must be used. When configuring power tables, a command must be sent for each modulation type. In addition, after configuring the power vectors, the RF calibration must be initialized
NOTE:Power level 1 of the GFSK Power Vector is used for BLE power.
Power Level Explanation:
- There are only 8 power levels used in the CC256x.
- Each power level is separated by 5 dBm.
- The default Max TX Power defined in the SP is 12dBm and corresponds to Power Level 15. Therefore, default Power Level 14 is 7dBm, Power Level 13 = 2dBm, and so on.
- The Max TX Power Level can be configured using the “BHET” tool. And thus, the rest of the power levels will change as well. But the number of power levels and power level separation does not change.
GFSK Power Vector Example:
Power Level | dBm | Value in bts file |
---|---|---|
15 | 12 | 0x18 |
14 | 7 | 0x0e |
13 | 2 | 0x04 |
12 | -3 | 0xfa |
11 | -8 | 0xf0 |
10 | -13 | 0xe6 |
9 | -18 | 0xdc |
8 | -23 | 0xd2 |
7 | -23 | 0xd2 |
6 | -23 | 0xd2 |
5 | -23 | 0xd2 |
4 | -23 | 0xd2 |
3 | -23 | 0xd2 |
2 | -23 | 0xd2 |
1 | 12 | 0x18 |
0 | -50 | 0x9c |
Command Parameters:
HCI_VS_DRPb_Set_Power_Vector (0xFD82) Modulation type, Level n power (n = 0 – 15), tx_power_edr_epc_idx, External PA mode.
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Modulation type | 1 | 0x00 0x01 0x02 |
GFSK EDR2 EDR3 |
Level n power (n = 0 – 15) | 1 | –64 to 16 0xFF |
Required RF power for each of the upper 15 power levels (in dBm) Do not change. |
tx_power_edr_epc_idx | 1 | 0xFF | Do not change. |
External PA mode | 2 | Bit 1 . . . Bit 15 0xFFFF |
1: External PA on @Power level 1; 0: Off . . . 1: External PA on @Power level 15; 0: Off Do not change. |
Procedure For power level vector update:
- Set the modulation type for which to update the power level vector.
- Set the desired power for each of the upper 15 power levels (in dBm).
- Set the external PA mode (on/off) for each of the 16 power levels (bit wise).
- Replace the existing power vector commands (x3) in the service pack with updated commands.
The following script shows the commands required to run the example:
#Set BT BR (GFSK) LP Vectors Values (note the need to multiply the output power in dBm by '2') Send_HCI_VS_DRPb_Set_Power_Vector 0xFD82, 0x00, 0x9c, 0x18, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, 0xdc, 0xe6, 0xf0, 0xfa, 0x04, 0x0e, 0x18, 0xff, 0x0000 Wait_HCI_Command_Complete_VS_DRPb_Set_Power_Vector_Event 5000, 0x00, 0xfd82, 0x00 #Set BT BR EDR 2MB LP Vectors Values (note the need to multiply the output power in dBm by '2') Send_HCI_VS_DRPb_Set_Power_Vector 0xFD82, 0x01, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8, 0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x0000 Wait_HCI_Command_Complete_VS_DRPb_Set_Power_Vector_Event 5000, 0x00, 0xfd82, 0x00 #Set BT BR EDR 3MB LP Vectors Values (note the need to multiply the output power in dBm by '2') Send_HCI_VS_DRPb_Set_Power_Vector 0xFD82, 0x02, 0x9c, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xd8, 0xe2, 0xec, 0xf6, 0x00, 0x0a, 0x14, 0xff, 0x0000 Wait_HCI_Command_Complete_VS_DRPb_Set_Power_Vector_Event 5000, 0x00, 0xfd82, 0x00 #Set max power level index to be used with a peer device that does not support power control (per LP/HP and per modulation) Send_HCI_VS_DRPb_Set_Class2_Single_Power 0xFD87, 0x0d, 0x0e, 0x0e Wait_HCI_Command_Complete_VS_DRPb_Set_Class2_Single_Power_Event 5000, 0x00, 0xfd87, 0x00 #Run TPC (Transmission Power Control) calibration Send_HCI_VS_DRPb_Enable_RF_Calibration 0xFD80, 0x00, 0x00000800, 0x01 Wait_HCI_Command_Complete_VS_DRPb_Enable_RF_Calibration_Event 5000, 0x00, 0xfd80, 0x00
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_DRPb_Set_Class2_Single_Power (0xFD87)[edit]
Description:
Some Bluetooth devices do not support the power control feature, which allows increasing or decreasing the transmitted power level of the other devices in the connection. This command lets the user set the power level to be used during such a connection, so that the fixed power does not compress the other receiver. This is done by selecting from the 16 available power levels. The device then transmits at this level all the time. This single power can be set per modulation scheme.
Command Parameters:
HCI_VS_DRPb_Set_Power_Vector (0xFD82) GFSK single power level Status, EDR2 single power level, EDR3 single power level.
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
GFSK single power level Status | 1 | 0 to 15 0xFF |
Sets the GFSK power level to be used without power control Don’t change. |
EDR2 single power level | 1 | 0 to 15 0xFF |
Sets the EDR2 power level to be used without power control Don't change. |
EDR3 single power level | 1 | 0 to 15 0xFF |
Sets the EDR3 power level to be used without power control. |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_LE_Output_Power (0xFDDD)[edit]
Description:
This command is used for setting LE power.
NOTE : by default it is set to power level 1
Command Parameters:
HCI_VS_LE_Output_Power (0xFDDD), Power Level Index.
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Power Level Index | 1 | 1 to 15 | Value indicating the Power level to be used for transmit output power of BLE |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Codec_Configuration (0xFD8E)[edit]
Description:
This command configures the PCM source type, SBC encoder, and SARC parameters. This command must not be called during streaming, meaning no stream has started using the start stream command.
The command can refer to a specific stream, or to both active streams in a multiple SNK scenario. Note that, in addition to that API call, the controller PCM codec must also be configured using the following commands:
HCI_VS_Write_CODEC_Config
HCI_VS_Write_CODEC_Config_Enhanced
Command Parameters:
HCI_VS_A3DP_Codec_Configuration (0xFD8E) Audio Source, PCM input sample frequency, PCM number of channels, SBC input sample frequency, SBC channel mode, SBC number of blocks, SBC number of subbands, SBC allocation method, SBC bit pool low boundary, SBC recommended bit pull, SBC dynamic bit pull enable, Reserved, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Audio Source | 1 | 0x0 - 0x1 | Determines the audio source of the A2DP stream. 0 – Audio source is the host through the PCM bus. 1 – Audio source is the internal controller FM. |
PCM input sample | 1 | 0x1 – 0x9 | The PCM sample frequency rate of the input PCM bus. This parameter is valid only when the audio source is the host. When this parameter is different from the SBC input sample frequency parameter the SARC will be used for sample rate conversion. 0x01 – 8000 Hz 0x02 – 11025 Hz 0x03 – 12000 Hz 0x04 – 16000 Hz 0x05 – 22050 Hz 0x06 – 24000 Hz 0x07 – 32000 Hz 0x08 – 44100 Hz 0x09 – 48000 Hz |
PCM number of channels | 1 | 0x1 – 0x2 | The number of channels (1 or 2) of the PCM input. This parameter is valid only when the audio source is the host. |
SBC input sample frequency | 1 | 0x0 - 0x3 | The sample frequency rate of the PCM input to SBC encoder. Note that when this parameter is different from the PCM input sample frequency, the SARC is used for sample rate conversion. 0x0 – 16000 Hz 0x1 – 32000 Hz 0x2 – 44100 Hz 0x3 – 48000 Hz |
SBC channel mode | 1 | 0x0 - 0x3 | Describes the channel mode used to encode a stream. 0x0 – MONO 0x1 – DUAL_CHNL 0x2 – STEREO 0x3 – JOINT_STEREO |
SBC block length | 1 | 0x4, 0x8, 0xC, 0x10 | SBC block length. (4, 8, 12, 16) |
SBC number of subbands | 1 | 0x4, 0x8 | Number of SBC subbands. (4, 8) |
SBC allocation method | 1 | 0x0 - 0x1 | SBC allocation method (SNR, Loudness) 0 – Loudness 1 – SNR |
SBC bit pool low boundary | 1 | 0x00 - 0x39 | The lower boundary of the negotiated bit pool range. |
SBC recommended bit pull | 1 | 0x00 - 0x39 | The host can recommend a specific bit pool value from the bit pool rate. The recommended bit pool value is also used as the high boundary in dynamic bit pool. |
SBC dynamic bit pull enable | 1 | 0x0 – 0x1 | Determines whether a dynamic bit pool mechanism should be used for performance/quality adjustment 0 – Disable 1 – Enable |
Reserved | 4 | For future use | |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_AVPR_Enable (0xFD92)[edit]
Description:
This command is used to enable the AVPR features:
- A3PD SRC, WBS, FM converter.
- A3PD SNK, WBS, FM converter.
It is recommended that the AVPR would be disabled once not used, for current consumption reduction. The default AVPR state is disabled.
Command Parameters:
HCI_VS_AVPR_Enable (0xFD92) Enable/disable AVPR, A3DP Role, Upload code, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Enable/disable AVPR | 1 | 0x0 - 0x1 | Enable/disable the AVPR clock. Enable also reloads the AVPR code. 1 - Enable 0 - Disable |
A3DP Role | 1 | 0x0 - 0x1 | 0 – A3DP functional as source 1 – A3DP functional as sink |
Upload code | 1 | 0x0 – 0x1 | 0 – Do not load A3DP code. 1 – Load A3DP code. |
Reserved | 2 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Open_Stream (0xFD8C)[edit]
Description:
This command must be called when the A2DP SNK has moved to open state and has established the transport A2DP channel to open an A3DP entity in the controller. It contains the protocol parameters needed for L2CAP and AVDTP packet construction. SBC and SARC parameters are applied using the HCI_VS_A3DP_CODEC_CONFIGURATION command.
Command Parameters:
HCI_VS_A3DP_Open_Stream (0xFD8C) Connection handle, L2CAP CID, L2CAP MTU, AVDTP Version Parameter, AVDTP Payload Parameter, Reserved, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection handle | 1 | 0x1 - 0x7 | The ACL connection handle |
L2CAP CID | 2 | 0x0040 – 0xFFFF | L2CAP channel ID of the AVDTP data stream. Refers to the L2CAP channel ID of the remote device. |
L2CAP MTU | 2 | 0x0030 – 0xFFFF | L2CAP max packet length |
AVDTP Version Parameter | 1 | 0x00 – 0x03 | AVDTP protocol header Version Parameter |
AVDTP Payload Parameter | 1 | 0x30 – 0xFF | AVDTP protocol header Payload Parameter |
Reserved | 4 | For future use | |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Close_Stream (0xFD8D)[edit]
Description:
This command must be called when the A2DP SNK has moved to Idle state and has closed the transport A2DP channel. If a stream is started by the start stream command, it must be stopped by the stop stream command before it is closed.
Command Parameters:
HCI_VS_A3DP_Close_Stream (0xFD8D) Connection handle, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection handle | 1 | 0x0 0x1- 0x7 |
close all streams The ACL connection handle |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Start_Stream (0xFD8F)[edit]
Description:
This command starts the A2DP data streaming to the remote device. The host should initiate PCM audio data right after this API call. When no PCM data is accepted at the controller after this command call, no data will be sent to the peer device.
Command Parameters:
HCI_VS_A3DP_Start_Stream (0xFD8F) Connection handle, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection handle | 1 | 0x1 - 0x7 | The ACL connection handle |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Stop_Stream (0xFD90)[edit]
Description:
This command stops the SBC data streaming to the remote device. An input parameter determines whether the current internal buffers should be transmitted to the remotes device(s) and then flushed (soft flush), or should be flushed immediately (hard flush). That option may be needed if the stream was stopped between songs for reconfiguration, so that the song ending should be heard by the user and not flushed. A VS event is generated at the completion of the operation, if requested.
Command Parameters:
HCI_VS_A3DP_Stop_Stream (0xFD90) Connection handle, Flush flag, Generate stop event, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection handle | 1 | 0x0 0x1 - 0x7 |
Stop all streams The ACL connection handle |
Flush flag | 1 | 0x0 - 0x1 | Determines whether the current internal buffers should be transmitted to the remote device, or should be flushed immediately. Values:<bt>0 – Transmit internal buffers before flush (soft flush). 1 – Immediate flush of buffers (hard flush) |
Generate stop event | 1 | 0x0 - 0x1 | Determines whether a stop stream event is generated as soon as stream is stopped. To be used in soft flush. |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Sink_Codec_Configuration (0xFD9C)[edit]
Description:
This command configures the SBC decoder parameters. This command must not be called during streaming, meaning no stream has started using the start stream command. The command refers to stream. Note that in addition to that API calls, the controller PCM codec must also be configured using the HCI_VS_Write_CODEC_Config and HCI_VS_Write_CODEC_Config_Enhanced commands.
Command Parameters:
HCI_VS_A3DP_Sink_Codec_Configuration (0xFD9C) PCM number of channels, SBC input sample frequency, SBC channel mode, SBC number of blocks, SBC number of sub-bands, SBC allocation method, Reserved, Reserved, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
PCM number of channels | 1 | 0x0 - 0x2 | The number of channels (1 or 2) of the PCM output |
SBC input sample frequency | 1 | 0x1 – 0x3 | The sample frequency rate of the PCM input to SBC decoder. Note that this parameter must be identical to the PCM output sample. 0x0 – 16000 Hz 0x01 – 32000 Hz 0x02 – 44100 Hz 0x03 – 48000 Hz |
SBC channel mode | 1 | 0x0 – 0x3 | Describes the channel mode used to encode a stream 0x0 – MONO 0x1 – DUAL_CHNL 0x2 – STEREO 0x3 – JOINT_STEREO |
SBC number of blocks | 1 | 0x4, 0x8, 0xC, 0x10 | Number of SBC decoder blocks. (4, 8, 12, 16) |
SBC number of sub-bands | 1 | 0x4 - 0x8 | Number of SBC decoder sub-band (4, 8) |
SBC allocation method | 1 | 0x0 - 0x1 | SBC allocation method (SNR, loudness) 0 – Loudness 1 – SNR |
Reserved | 4 | For future use | |
Reserved | 4 | For future use | |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Sink_Open_Stream (0xFD9A)[edit]
Description:
This command must be called when the A2DP SRC has moved to open state and has established the transport A2DP channel to open an A3DP entity in the controller. It contains the protocol parameters needed for L2CAP. SBC parameters are applied using the HCI_VS_A3DP_SNK_CODEC_CONFIGURATION command.
Command Parameters:
HCI_VS_A3DP_Sink_Open_Stream (0xFD9A) Connection handle, L2CAP CID, Reserved, Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Connection handle | 1 | 0x1 - 0x7 | The ACL connection handle |
L2CAP CID | 2 | 0x0040 – 0xFFFF | L2CAP channel ID of the AVDTP data stream. Refers to the L2CAP channel ID of the remote device. |
Reserved | 4 | For future use | |
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Sink_Close_Stream (0xFD9B)[edit]
Description:
This command must be called when the A2DP SRC has moved to Idle state and has closed the transport A2DP channel. If a stream is started by the start stream command, it should be stopped by the stop stream command before it is closed.
Command Parameters:
HCI_VS_A3DP_Sink_Close_Stream (0xFD9B) Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Sink_Start_Stream (0xFD9D)[edit]
Description:
This command starts the A2DP data streaming from the source device.
Command Parameters:
HCI_VS_A3DP_Sink_Start_Stream (0xFD9D) Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_A3DP_Sink_Stop_Stream (0xFD9E)[edit]
Description:
This command stops the SBC data streaming and flush the buffer (IPC RX buffer, AVPR DMEM).
Command Parameters:
HCI_VS_A3DP_Sink_Stop_Stream (0xFD9E) Reserved
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
Reserved | 4 | For future use |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_WBS_Associate (0xFD78)[edit]
Description:
This command is used to associate the requested ACL handle with Wide Band Speech configuration.
Command Parameters:
HCI_VS_WBS_Associate (0xFD78) ACL handle.
Command Parameter | Size (bytes) | Value | Description |
---|---|---|---|
ACL handle | 2 | 0x1 – 0x7 | The ACL connection handle |
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
HCI_VS_WBS_Disassociate (0xFD79)[edit]
Description:
This command is used to disassociate Wide Band Speech configuration from any ACL handle.
Command Parameters:
HCI_VS_WBS_Disassociate (0xFD79) None.
Return Parameters:
Returned Value | Description | Size (bytes) | Events Generated |
---|---|---|---|
0x00 0x01 – 0xFF |
Command succeeded. Command failed. |
1 | Command Complete |
General Hardware Error Codes[edit]
General Hardware Error Codes | Decimal Value | Hex Value |
---|---|---|
UART_HCI_NO_ERRS | 0 | 0x00 |
UART_HCI_ERR_NO_BUFFERS_COMMAND | 1 | 0x01 |
UART_HCI_ERR_NO_BUFFERS_ACL_DATA | 2 | 0x02 |
UART_HCI_ERR_NO_BUFFERS_SCO_DATA | 3 | 0x03 |
UART_HCI_ERR_NO_BUFFERS_EVENT | 4 | 0x04 |
UART_HCI_ERR_NO_BUFFERS | 5 | 0x05 |
UART_HCI_ERR_BAD_TYPE | 6 | 0x06 |
UART_HCI_ERR_BAD_LEN | 7 | 0x07 |
UART_HCI_ERR_LOCAL_RESET | 8 | 0x08 |
UART_HCI_ERR_OVERRUN | 9 | 0x09 |
UART_HCI_ERR_PARITY | 10 | 0x0A |
UART_HCI_ERR_FRAMING | 11 |
0x0B |
UART_HCI_ERR_BREAK | 12 | 0x0C |
HCI_HW_ERR_FAULT_RADIO_EVENT | 13 | 0x0D |