HCI Application is a Host Controller Interface application which provides a serial communication to interface with the KW40/KW41/KW35/KW36/QN9080 BLE radio part. It enables the user to have a way to control the radio through serial commands. The format of the HCI Command Packet it’s composed of the following parts:
Each command is assigned a 2 byte Opcode which it’s divided into two fields, called the OpCode Group Field (OGF) and OpCode Command Field (OCF). The OGF uses the upper 6 bits of the Opcode, while the OCF corresponds to the remaining 10 bits. The OGF of 0x3F is reserved for vendor-specific debug commands. The organization of the opcodes allows additional information to be inferred without fully decoding the entire Opcode. For further information regarding this topic, please check the BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E, 5.4 EXCHANGE OF HCI-SPECIFIC INFORMATION.
Adding HCI Custom Commands Example
This document will guide you through the implementation of custom HCI commands in the KW36. For this example, we will include the following set of custom commands:
01 50 FC 00 – This command is to send a continuous unmodulated wave using a defined channel and output power (default: frequency 2.402GHz and PA_POWER register set to 0x3E).
01 4F FC 00 – This command is to stop the continuous unmodulated wave and configure the radio in Bluetooth LE mode again. This way you can continue sending adopted HCI commands.
01 00 FC 00 – Set the Channel 0 Freq 2402 MHz
01 01 FC 00 – Set the Channel 19 Freq 2440 MHz
01 02 FC 00 – Set the Channel 39 Freq 2480 MHz
01 10 FC 00 – Set the PA_POWER 1
01 11 FC 00 – Set the PA_POWER 32
01 12 FC 00 – Set the PA_POWER 62
The changes described in the following sections were based on the HCI Black Box SDK example (it is located at wireless_examples -> bluetooth -> hci_bb)
Changes in hci_transport.h
The "hci_transport.h" file is located at bluetooth->hci_transport->interface folder.
Include the following macros in ''Public constants and macros"