Exigences HCI

L'interface de contrôleur hôte (HCI) est utilisée pour interagir avec un contrôleur Bluetooth.

Ce document fournit une liste des exigences HCI Bluetooth (BT) et Bluetooth Low Energy (BLE). L'objectif est que les fournisseurs de piles Host BT et les fournisseurs de contrôleurs BT se conforment à ces exigences de plate-forme afin d'utiliser l'ensemble de fonctionnalités décrit ci-dessous.

Ce document fait référence à la spécification Bluetooth Core 5.2 en tant que « spécification ». La spécification Bluetooth Core 5.2 est disponible sur le site Web Bluetooth SIG avec d'autres documents adoptés.

Présentation générale de la conception

Capacités et configuration de la puce

En tant que plate-forme ouverte, Android dispose d'une matrice de versions de logiciels, d'OEM, de fournisseurs et de capacités de plate-forme et de puce.

Pour gérer le paysage variable et gérer les migrations, une philosophie de conception permettant aux contrôleurs BT d'exposer leurs capacités (au-delà de la spécification Bluetooth Core 5.2 standard) est décrite dans ce document. La pile BT hôte peut ensuite utiliser ces fonctionnalités pour déterminer les fonctionnalités à activer.

Prise en charge des normes ouvertes

L'un des objectifs d'Android est de prendre en charge les normes ouvertes après ratification dans une spécification Bluetooth. Si une fonctionnalité décrite ci-dessous devient disponible dans les méthodes HCI standard dans une future spécification Bluetooth, nous pencherons pour faire de cette approche la valeur par défaut.

Capacités spécifiques au fournisseur

Commande spécifique au fournisseur : LE_Get_Vendor_Capabilities_Command

Champ de commande OpCode (OCF) : 0x153

Paramètre de commande Taille But
N / A Liste de paramètres de commande vide

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
max_advt_instances
(obsolète)
1 octet Nombre d'instances de publicité prises en charge.

Réservé après v0.98.
Ce paramètre est obsolète dans la spécification de fonctionnalité Google v0.98 et supérieure en faveur de la publicité étendue LE disponible dans la spécification BT version 5.0 et supérieure.
offloaded_resolution_of_private-address
(obsolète)
1 octet Capacité de puce BT de RPA.
S'il est pris en charge par une puce, il doit être activé par l'hôte.
0 = Non capable
1 = Capable

Réservé après v0.98.
Ce paramètre est obsolète dans la spécification de fonctionnalité Google v0.98 et supérieure au profit de la fonctionnalité de confidentialité disponible dans la spécification BT version 4.2 et supérieure.
total_scan_results_storage 2 octets Stockage des résultats d'analyse en octets
max_irk_list_sz 1 octet Nombre d'entrées IRK prises en charge dans le micrologiciel
filtering_support 1 octet Prise en charge du filtrage dans le contrôleur
0 = Non pris en charge
1 = Pris en charge
max_filter 1 octet Nombre de filtres pris en charge
activity_energy_info_support 1 octet Prend en charge les rapports d'activité et d'informations sur l'énergie
0 = Non capable
1 = Capable
version_supported 2 octets Spécifie la version de la spécification de fonctionnalité Google prise en charge
octet[0] = nombre majeur
octet[1] = nombre mineur

v1.03
octet[0] = 0x01
octet[1] = 0x03
total_num_of_advt_tracked 2 octets Nombre total d'annonceurs suivis à des fins OnLost / OnFound
extended_scan_support 1 octet Prend en charge la fenêtre et l'intervalle d'analyse étendus
debug_logging_supported 1 octet Prend en charge la journalisation des informations de débogage binaire du contrôleur
LE_address_generation_offloading_support
(obsolète)
1 octet 0 = Non pris en charge
1 = Pris en charge

Réservé après v0.98.
Ce paramètre est obsolète dans la spécification de fonctionnalité Google v0.98 et supérieure au profit de la fonctionnalité de confidentialité disponible dans la spécification BT version 4.2 et supérieure.
A2DP_source_offload_capability_mask 4 octets Masques de bits pour les types de codec pris en charge
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Les bits 5-31 sont réservés
bluetooth_quality_report_support 1 octet Prend en charge le signalement des événements de qualité Bluetooth
0 = Non capable
1 = Capable
dynamic_audio_buffer_support 4 octets Prend en charge la mémoire tampon audio dynamique dans le contrôleur Bluetooth
Masques de bits pour les types de codec pris en charge
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Les bits 5-31 sont réservés

Regroupement des résultats d'analyse

Un objectif de conception est d'améliorer la façon dont les notifications d'événement Bluetooth LE Scan Response sont transmises à l'hôte, afin d'économiser de l'énergie dans l'hôte.

En réduisant la fréquence à laquelle le contrôleur notifie au processeur de l'application hôte d'analyser les résultats, le processeur de l'application hôte peut rester inactif/veille plus longtemps. Cela réduit la consommation d'énergie dans l'hôte. Le paramètre de retour total_scan_results_storage de LE_Get_Vendor_Capabilities_Command indique la capacité de la puce pour le stockage des résultats d'analyse.

Cette fonctionnalité se concentre sur la gestion et la configuration de la fonction de stockage des résultats de l'analyse LE dans le contrôleur Bluetooth. Le stockage est utilisé pour regrouper temporairement les données de publicité et analyser les données et les métadonnées qui sont reçues par le contrôleur pour une livraison ultérieure à l'hôte.

Le micrologiciel doit prendre en charge deux types de traitement par lots, qui peuvent être activés simultanément :

  • Tronqué. Contient les éléments d'information suivants : {MAC, TX Power, RSSI, Timestamp}
  • Complet. Contient les éléments d'information suivants : {MAC, TX Power, RSSI, Timestamp, Adv Data, Scan Response}

LE_Batch_Scan_Command

OCF : 0x156

Paramètre de commande Taille But
Batch_Scan_opcode 1 octet 0x1 - Activer la fonctionnalité spécifique au client
0x2 - Définir les paramètres de stockage d'analyse par lots
0x3 - Définir les paramètres de numérisation par lots
0x4 - Lire les paramètres de résultat d'analyse par lots

Un événement Command Complete sera généré pour cette commande. L'activation de la fonction spécifique au client ne démarre pas l'analyse.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Batch_Scan_opcode 1 octet 0x1 - Activer la fonctionnalité spécifique au client
0x2 - Définir les paramètres de stockage d'analyse par lots
0x3 - Définir les paramètres de numérisation par lots
0x4 - Lire les paramètres de résultat d'analyse par lots

LE_Batch_Scan_Command : Activer la fonctionnalité spécifique au client

Sous-OCF : 0x01

Paramètre de sous-commande Taille But
enable_customer_specific_feature_set 1 octet 0x01 - Activer la fonction d'analyse par lots
0x00 - Désactiver la fonction d'analyse par lots

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Batch_Scan_opcode 1 octet 0x1 - Activer la fonctionnalité spécifique au client
0x2 - Définir les paramètres de stockage d'analyse par lots
0x3 - Définir les paramètres de numérisation par lots
0x4 - Lire les paramètres de résultat d'analyse par lots

LE_Batch_Scan_Command : sous-commande Set Batch Scan Storage Param

Sous-OCF : 0x02

Paramètre de sous-commande Taille But
Batch_Scan_Full_Max 1 octet Espace de stockage max (en %) alloué au style complet
[Plage : 0-100]
Batch_Scan_Truncated_Max 1 octet Espace de stockage max (en %) alloué au style tronqué
[Plage : 0-100]
Batch_Scan_Notify_Threshold 1 octet Niveau de notification de configuration (en %) pour un pool de stockage individuel
[Plage : 0-100]
Le réglage sur 0 désactivera la notification. Un événement HCI spécifique au fournisseur est généré (sous-événement de dépassement du seuil de stockage)

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Batch_scan_opcode 1 octet 0x02 [Définir les paramètres de numérisation par lots]

LE_Batch_Scan_Command : sous-commande Set Batch Scan Param

Sous-OCF : 0x03

Paramètre de sous-commande Taille But
Batch_Scan_Mode 1 octet 0x00 - L'analyse par lots est désactivée
0x01 – Le mode tronqué est activé
0x02 - Le mode complet est activé
0x03 - Les modes tronqué et complet sont activés
Duty_cycle_scan_window 4 octets Durée de l'analyse par lots (# d'emplacement)
Duty_cyle_scan_interval 4 octets Période d'intervalle d'analyse par lots (# d'emplacement)
own_address_type 1 octet 0x00 - Adresse publique de l'appareil
0x01 - Adresse de périphérique aléatoire
Batch_scan_Discard_Rule 1 octet 0 - Supprimer la publicité la plus ancienne
1 - Supprimer la publicité avec le RSSI le plus faible

Cette sous-commande lancera l'analyse par lots, si elle est activée. Dans l'analyse tronquée, les résultats sont stockés sous forme tronquée où la clé unique pour le style tronqué = { BD_ADDR, scan_interval}. Cela signifie qu'un seul BD_ADDR will enregistré pour chaque intervalle de balayage. L'enregistrement à conserver pour le mode Tronqué est le suivant : { BD_ADDR , Tx Power, RSSI, Timestamp}

Lorsque le mode complet est activé, le balayage actif sera utilisé et les réponses du balayage seront enregistrées. La clé unique de style complet = {MAC, paquet publicitaire}, quel que soit l'intervalle d'analyse. L'enregistrement à conserver pour le mode complet est { BD_ADDR , Tx Power, RSSI, Timestamp, Ad packet, Scan Response}. Dans le style complet, le même paquet AD, lorsqu'il est vu plusieurs fois sur différents intervalles de balayage, n'est enregistré qu'une seule fois. Cependant, en mode tronqué, c'est la visibilité de BA_ADDR sur différents intervalles de balayage qui est intéressante (une fois par intervalle de balayage). Le RSSI est la valeur moyenne de tous les doublons d'une publicité unique dans un intervalle de balayage.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Batch_scan_opcode 1 octet 0x03 [Définir les paramètres de numérisation par lots]

LE_Batch_Scan_Command : sous-commande Lire les résultats de l'analyse par lots

Sous-OCF : 0x04

Paramètre de sous-commande Taille But
Batch_Scan_Data_read 1 octet 0x01 – Données en mode tronqué
0x02 - Données en mode complet

Un événement Command Complete sera généré pour cette commande. Lorsque l'hôte émet cette commande, tous les résultats du contrôleur peuvent ne pas tenir dans un événement Command Complete. L'hôte répétera l'émission de cette commande jusqu'à ce que les résultats correspondants dans l'événement Command Complete indiquent 0 dans le nombre d'enregistrements, ce qui indique que le contrôleur n'a plus d'enregistrements à communiquer à l'hôte. Chaque événement Commande terminée peut contenir plusieurs enregistrements d'un seul type de données (complet ou tronqué).

Les références temporelles du contrôleur et de l'hôte ne sont pas synchronisées. L'unité de l'horodatage est de 50 ms. La valeur de l'horodatage est basée sur le moment où Read_Batch_Scan_Results_Sub_cmd est donné par l'hôte. Si l'heure d'arrivée d'une commande est T_c dans le micrologiciel, l'heure réelle à laquelle l'horodatage a été pris dans le micrologiciel est T_fw . L'heure de rapport sera : ( T_c - T_fw ). T_c et T_fw sont dans le domaine temporel du firmware. Cela permet à l'hôte de calculer depuis combien de temps l'événement s'est produit.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Batch_scan_opcode 1 octet 0x03 [Définir les paramètres de numérisation par lots]
Batch_Scan_data_read 1 octet Identifie le format (tronqué ou complet)
num_of_records 1 octet Nombre d'enregistrements de Batch_Scan_data_read
format_of_data Variable Mode tronqué :
Adresse[0] : 6 octets
Address_Type[0] : 1 octet
Tx_Pwr[0] : 1 octet
RSSI[0] : 1 octet
Horodatage[0] : 2 octets
[enregistrements multiples ( num_of_records ) avec le format ci-dessus]

Mode complet :
Adresse[0] : 6 octets
Address_Type[0] : 1 octet
Tx_Pwr[0] : 1 octet
RSSI[0] : 1 octet
Horodatage[0] : 2 octets
paquet avancé_len[0] : 1 octet
Adv_packet[0] : octets Adv_packet_len
Scan_data_resp_len[0] : 1 octet
Scan_data_resp[0] : octets Scan_data_resp
[enregistrements multiples avec le format ci-dessus ( num_of_records )]

Filtre de contenu de paquet publicitaire

Utilisez-le pour activer/désactiver/configurer le filtre de contenu publicitaire (APCF) dans le contrôleur. APCF filtre les rapports publicitaires dans le contrôleur mais ne filtre pas les publicités périodiques.

LE_APCF_Command

OCF : 0x157

Paramètre de commande Taille But
APCF_opcode 1 octet 0x00 - Activer APCF
0x01 - APCF Définir les paramètres de filtrage
0x02 - Adresse du diffuseur APCF
0x03 - UUID du service APCF
0x04 - UUID de sollicitation de service APCF
0x05 - Nom local APCF
0x06 - Données du fabricant APCF
0x07 - Données de service APCF
0x08 - Service de découverte de transport APCF
0x09 - Filtre de type AD APCF
0x10 ~ 0xAF - Réservé pour une utilisation future
0xB0 ~ 0xDF - Réservé au fournisseur
0xE0 ~ 0xFE - Réservé pour une utilisation future
0xFF - Fonctionnalités étendues de lecture APCF

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet Statut de retour
APCF_opcode 1 octet 0x00 - Activer APCF
0x01 - APCF Définir les paramètres de filtrage
0x02 - Adresse du diffuseur APCF
0x03 - UUID du service APCF
0x04 - UUID de sollicitation de service APCF
0x05 - Nom local APCF
0x06 - Données du fabricant APCF
0x07 - Données de service APCF
0x08 - Service de découverte de transport APCF
0x09 - Filtre de type AD APCF
0x10 ~ 0xAF - Réservé pour une utilisation future
0xB0 ~ 0xDF - Réservé au fournisseur
0xE0 ~ 0xFE - Réservé pour une utilisation future
0xFF - Fonctionnalités étendues de lecture APCF

LE_APCF_Command : Enable_sub_cmd

Sous-OCF : 0x00

Paramètre de sous-commande Taille But
APCF_enable 1 octet 0x01 - Activer la fonctionnalité APCF
0x00 - Désactiver la fonction APCF

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x0 - Activer APCF
APCF_Enable 1 octet Activer/désactiver est défini via APCF_enable

Commande_LE_APCF : set_filtering_parameters_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer une spécification de filtre ou effacer une liste de filtres pour le filtrage sur puce.

Sous-OCF : 0x01

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer effacera le filtre spécifique ainsi que les entrées de fonctionnalités associées dans d'autres tables.
Effacer effacera tous les filtres et les entrées associées dans les autres tables.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter-1 )
APCF_Feature_Selection 2 octets Masques de bits pour les fonctionnalités sélectionnées :
Bit 0 : définir pour activer le filtre d'adresse de diffusion
Bit 1 : défini pour activer le filtre de modification des données de service
Bit 2 : défini pour activer la vérification de l'UUID de service
Bit 3 : défini pour activer la vérification de l'UUID de sollicitation de service
Bit 4 : défini pour activer la vérification du nom local
Bit 5 : définir pour activer la vérification des données du fabricant
Bit 6 : définir pour activer la vérification des données de service
Bit 7 : défini pour activer la vérification du service de découverte du transport
Bit 8 : définir pour activer la vérification du type AD
APCF_List_Logic_Type 2 octets Opération logique pour chaque sélection de fonctionnalité (position par bit) spécifiée dans APCF_Feature_Selection .
Valide uniquement lorsqu'une fonctionnalité est activée.
Valeur de position de bit :
0 : OU
1 : ET
Si la logique "ET" est sélectionnée, un paquet ADV ne passera le filtre que s'il contient TOUTES les entrées de la liste.
Si la logique "OU" est sélectionnée, un paquet ADV passera le filtre s'il contient l'une des entrées de la liste.
APCF_Filter_Logic_Type 1 octet 0x00 : OU
0x01 : ET
Remarque : Le type de logique est N/A pour les trois premiers champs de APCF_Feature_Selection , qui est toujours la logique « ET ». Ils ne sont applicables que pour (Bit 3 - Bit 6) quatre champs de APCF_Feature_Selection .
rssi_high_thresh 1 octet [en dBm]
L'annonceur n'est considéré vu que si le signal est supérieur au seuil haut RSSI. Sinon, le firmware doit se comporter comme s'il ne l'avait jamais vu.
delivery_mode 1 octet 0x00 - immediate
0x01 - on_found
0x02 - batched
onfound_timeout 2 octets Valide uniquement si delivery_mode est on_found .
[en millisecondes]
Il est temps pour le micrologiciel de s'attarder et de collecter des publicités supplémentaires avant de signaler.
onfound_timeout_cnt 1 octet Valide uniquement si delivery_mode est on_found .
[compter]
Si une publicité dans onFound persiste dans le micrologiciel pendant la durée onfound_timeout , elle collectera quelques publicités et le nombre sera vérifié. Si le nombre dépasse onfound_timeout_cnt , il est signalé OnFound immédiatement après.
rssi_low_thresh 1 octet Valide uniquement si delivery_mode est on_found .
[en dBm]
Le paquet annonceur est considéré comme non vu si le RSSI du paquet reçu n'est pas supérieur au seuil bas RSSI.
onlost_timeout 2 octets Valide uniquement si delivery_mode est on_found .
[en millisecondes]
Si une publicité, après avoir été trouvée, n'est pas vue de manière contiguë pendant la période lost_timeout , elle sera immédiatement signalée comme perdue.
num_of_tracking_entries 2 octets Valide uniquement si delivery_mode est on_found .
[compter]
Nombre total d'annonceurs à suivre par filtre.

Les valeurs RSSI doivent utiliser le complément à 2 pour représenter les valeurs négatives.

L'hôte doit pouvoir configurer plusieurs filtres avec APCF_Application_Address_type défini sur 0x02 (pour toutes les adresses de diffuseur) pour gérer diverses combinaisons de filtres.

Le filtrage, le traitement par lots et la création de rapports sont des concepts interdépendants. Chaque publicité et réponse d'analyse associée devra passer par tous les filtres, l'un après l'autre. Ainsi, les actions résultantes ( delivery_mode ) sont étroitement liées au filtrage. Les modes de livraison sont les suivants : report_immediately , batch et onFound . La valeur OnLost est liée à OnFound dans le sens où elle viendra après OnFound en cas de perte.

Ce flux de traitement décrit le modèle conceptuel :

Lorsqu'une trame de publicité (ou de réponse de balayage) est reçue, elle est appliquée à tous les filtres dans l'ordre sériel. Il est possible qu'une publicité entraîne un signalement immédiat basé sur un filtre et un regroupement de celui-ci en raison d'une action de filtre différente.

Les seuils de niveau RSSI (haut et bas) permettent de contrôler le moment où la trame est visible pour le traitement du filtre, même lorsqu'un paquet valide est reçu par le contrôleur. Dans le cas où le mode de livraison est défini sur immédiat ou par lots, le RSSI d'une trame est pris en compte pour un traitement ultérieur par le contrôleur. Différentes applications nécessitent un comportement de création de rapports et de traitement par lots différent. Cela permet à plusieurs applications d'avoir des rapports directs et/ou des lots de résultats dans le micrologiciel, simultanément. Un exemple est le cas où une analyse par lots est active à partir d'une application et plus tard, une analyse LE régulière est émise par une autre application. Avant qu'une analyse par lots ne soit émise, le framework/l'application définit les filtres appropriés. Plus tard, lorsque la deuxième application émet une analyse régulière, le traitement par lots précédent se poursuit. Cependant, en raison de l'analyse régulière, cela s'apparente à l'ajout conceptuel d'un filtre nul (avec tous les filtres existants) avec la commande d'analyse LE. Les paramètres de la commande LE scan sont prioritaires lorsqu'ils sont actifs. Lorsque l'analyse LE régulière est désactivée, le contrôleur reviendra à une analyse par lots précédente, si elle existait.

Le mode de livraison OnFound est basé sur des filtres configurés. Une combinaison qui déclenche l'action d'un filtre pour réussir est considérée comme l'entité à suivre pour onLost . L'événement correspondant est le sous-événement de suivi LE Advt.

La transition OnFound/OnLost pour un filtre (si activé) ressemblera à ceci :

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x01 - APCF Définir les paramètres de filtrage
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées disponibles dans la table des filtres

LE_APCF_Command : broadcast_address_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer une adresse d'annonceur ou pour effacer la liste d'adresses d'annonceur pour le filtrage sur puce.

Sous-OCF : 0x02

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera l'adresse du diffuseur spécifié dans le filtre spécifié.
Effacer effacera toutes les adresses de diffuseur dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter-1 )
APCF_Broadcaster_Address 6 octets Adresse de périphérique de 6 octets à ajouter ou à supprimer de la liste d'adresses du diffuseur
APCF_Application_Address_type 1 octet 0x00 : Publique
0x01 : aléatoire
0x02 : NA (type d'adresse non applicable)

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x02 - Adresse du diffuseur APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées libres encore disponibles dans le tableau Adresse de diffusion

Commande_LE_APCF : service_uuid_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer un UUID de service ou pour effacer une liste d'UUID de service pour le filtrage sur puce.

Sous-OCF : 0x03

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera l'adresse UUID de service spécifiée dans le filtre spécifié.
Effacer effacera tous les UUID de service dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_UUID 2,4,16 octets L'UUID de service (16 bits, 32 bits ou 128 bits) pour ajouter ou supprimer de la liste.
APCF_UUID_MASK 2,4,16 octets Masque UUID de service (16 bits, 32 bits ou 128 bits) à ajouter à la liste. Il doit avoir la même longueur que APCF_UUID.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x03 - UUID du service APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées libres encore disponibles dans la table Service UUID

LE_APCF_Command : solicitation_uuid_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer un UUID de sollicitation ou pour effacer une liste d'UUID de sollicitation pour le filtrage sur puce.

Sous-OCF : 0x04

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera l'adresse UUID de sollicitation dans le filtre spécifié.
Effacer effacera tous les UUID de sollicitation dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_UUID 2,4,16 octets L'UUID de sollicitation (16 bits, 32 bits ou 128 bits) à ajouter ou à supprimer de la liste.
APCF_UUID_MASK 2,4,16 octets Masque UUID de sollicitation (16 bits, 32 bits ou 128 bits) à ajouter à la liste. Il doit avoir la même longueur que APCF_UUID .

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x04 - UUID de sollicitation APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées libres encore disponibles dans le tableau UUID de sollicitation

Commande_LE_APCF : nom_local_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer une chaîne de nom local ou pour effacer la liste des chaînes de nom local pour le filtrage sur puce.

Sous-OCF : 0x05

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera la chaîne de nom local spécifiée dans le filtre spécifié.
Effacer effacera toutes les chaînes de noms locales dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Taille variable Une chaîne de caractères pour le nom local.

Remarques:
  • Actuellement, le nombre maximum de caractères dans une chaîne de nom local est de 29
  • Non applicable lorsque l'action est "Effacer" (0x2)

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x05 - Nom local APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées libres encore disponibles dans la table des noms locaux

Commande_LE_APCF : manf_data_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer une chaîne de données du fabricant ou pour effacer la liste des chaînes de données du fabricant pour le filtrage sur puce.

Sous-OCF : 0x06

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera la chaîne de données de fabricant spécifiée dans le filtre spécifié.
Effacer effacera toutes les chaînes de données du fabricant dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Taille variable Une chaîne de caractères pour les données du fabricant.

Remarques:
  • Actuellement, le nombre maximum de caractères dans une chaîne de nom local est de 29
  • Non applicable lorsque l'action est "Effacer" (0x2)
APCF_ManData_Mask Taille variable Le masque de données de fabrication à ajouter à la liste. Il doit avoir la même longueur que APCF_LocName_or_ManData_or_SerData .

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x06 - Données du fabricant APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées gratuites encore disponibles dans le tableau des données du fabricant

Commande_LE_APCF : service_data_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer une chaîne de données de service ou pour effacer la liste des chaînes de données de service pour le filtrage sur puce.

Sous-OCF : 0x07

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera la chaîne de données de service spécifiée dans le filtre spécifié.
Effacer effacera toutes les chaînes de données de service dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Taille variable Une chaîne de caractères pour les données de service.

Remarques:
  • Actuellement, le nombre maximum de caractères dans une chaîne de nom local est de 29
  • Non applicable lorsque l'action est "Effacer" (0x2)
APCF_LocName_Mandata_or_SerData_Mask Taille variable Masque de données de service à ajouter à la liste. Il doit avoir la même longueur que APCF_LocName_or_ManData_or_SerData.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x07 - Données de service APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées gratuites encore disponibles pour le tableau Service Data

LE_APCF_Command : ad_type_sub_cmd

Cette sous-commande est utilisée pour ajouter ou supprimer un type AD ou pour effacer une liste de types AD pour le filtrage sur puce. Utilisez read_extended_features_sub_cmd pour vérifier si cette commande est prise en charge ou non.

Sous-OCF : 0x09

Paramètre de sous-commande Taille But
APCF_Action 1 octet 0x00 - Ajouter
0x01 - Supprimer
0x02 - Effacer
Supprimer supprimera le type AD spécifié dans le filtre spécifié.
Effacer effacera tous les types AD dans le filtre spécifié.
APCF_Filter_Index 1 octet Indice de filtre (0, max_filter -1)
APCF_AD_TYPE 1 octet Le type AD pour ajouter ou supprimer de la liste. Ignorer lorsque APCF_Action est 0x02 (Effacer)
APCF_AD_DATA_Length Taille variable 0x00 - signifie ne pas filtrer le contenu des données
Ignorer lorsque APCF_Action est 0x02 (Effacer)
APCF_AD_DATA Taille variable Ignorer lorsque APCF_Action est 0x02 (Effacer)
APCF_AD_DATA_MASK Taille variable Ignorer lorsque APCF_Action est 0x02 (Effacer)
Il doit avoir la même longueur que APCF_AD_DATA .

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0x09 - Type d'annonce APCF
APCF_Action 1 octet Echo back's APCF_Action de la commande
APCF_AvailableSpaces 1 octet Nombre d'entrées gratuites encore disponibles dans le tableau Type d'annonce

Commande_LE_APCF : read_extended_features_sub_cmd

Cette sous-commande est utilisée pour lire les fonctions APCF étendues.

Sous-OCF : 0xFF

Paramètre de sous-commande Taille But
N'est pas applicable Paramètre de commande vide.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
APCF_opcode 1 octet 0xFF - APCF_Read_Extended_Features
APCF_extended_features 2 octets

Masques de bits pour les fonctionnalités étendues prises en charge :

  • Bit 0 : prise en charge du filtre du service de découverte du transport
  • Bit 1 : prise en charge du filtre de type AD
  • Bit 2 ~15 : Réservé pour une utilisation future

Valeur du bit

  • 0 = Non pris en charge
  • 1 = Pris en charge

Commande des informations sur l'activité et l'énergie du contrôleur

L'objectif de ces informations est que les fonctions supérieures du système hôte analysent les activités totales de tous les composants, y compris le contrôleur BT et son état macro, en conjonction avec ce qui se passe dans les applications et le cadre. Pour ce faire, les informations suivantes sont requises de la pile BT et du contrôleur :

  • Pile BT : signalement de l'état macro-opérationnel actuel du contrôleur
  • Micrologiciel : rapports sur l'activité globale et les informations sur l'énergie

États de la macro de la pile de l'hôte BT, tels que déterminés au niveau de l'utilisateur :

  • Inactif : [numérisation de page, advt LE, numérisation d'enquête]
  • Scan : [messagerie/requête/tentative de connexion]
  • Actif : [lien ACL activé, lien SCO en cours, mode détection]

Les activités dont le contrôleur assure le suivi tout au long de sa durée de vie sont le temps Tx, le temps Rx, le temps d'inactivité et l'énergie totale consommée. Ils sont effacés lorsqu'ils sont lus depuis l'hôte.

LE_Get_Controller_Activity_Energy_Info

Il s'agit d'une commande spécifique au fournisseur.

OCF : 0x159

Paramètre de sous-commande Taille But
N / A Paramètres de commande vides

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
total_tx_time_ms 4 octets Temps total d'exécution de Tx
total_rx_time_ms 4 octets Temps total d'exécution de Rx
total_idle_time_ms 4 octets Temps total en veille (états de faible consommation sans veille)
total_energy_used 4 octets Énergie totale utilisée [produit du courant (mA), de la tension (V) et du temps (ms)]

Commande de paramètres d'analyse de jeu étendu LE

Cette commande peut être utilisée pour activer une fenêtre et un intervalle d'analyse plus grands dans le contrôleur. Selon la spécification BT Core 5.2, une fenêtre et un intervalle d'analyse ont une limite supérieure de 10,24 secondes, ce qui entrave les intervalles d'analyse plus longs des applications au-delà de 10,24 secondes.

Référence de base : spécification BT Core 5.2, page 2493 (commande LE Set Scan Parameters)

OCF : 0x15A

Paramètre de commande Taille But
LE_Ex_Scan_Type 1 octet 0x00 - Analyse passive. Aucun paquet SCAN_REQ ne doit être envoyé (par défaut).
0x01 - Analyse active. Des paquets SCAN_REQ peuvent être envoyés.
LE_Ex_Scan_Interval 4 octets Défini comme l'intervalle de temps entre le moment où le contrôleur a lancé sa dernière scrutation LE et le début de la scrutation LE suivante.
Plage : 0x0004 à 0x00FFFFFF
Par défaut : 0x0010 (10 ms)
Temps = N * 0,625 ms
Plage de temps : 2,5 ms à 10442,25 secondes
LE_Ex_Scan_Window 4 octets La durée de l'analyse LE. LE_Scan_Window doit être inférieur ou égal à LE_Scan_Interval .
Plage : 0x0004 à 0xFFFF
Par défaut : 0x0010 (10 ms)
Temps = N * 0,625 ms
Plage de temps : 2,5 ms à 40,95 secondes
Own_Address_Type 1 octet 0x00 - Adresse publique de l'appareil (par défaut)
0x01 - Adresse de périphérique aléatoire
LE_Ex_Scan_Filter_Policy 0x00 - Accepte tous les paquets de publicité (par défaut). Les paquets de publicité dirigée qui ne sont pas adressés à cet appareil doivent être ignorés.
0x01 - Ignorer les paquets de publicité provenant d'appareils ne figurant pas dans la liste White List Only. Les paquets de publicité dirigée qui ne sont pas adressés à cet appareil doivent être ignorés.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée

Obtenir la commande d'informations de débogage du contrôleur

L'objectif de cet élément d'information est d'acquérir des informations de débogage du contrôleur par un hôte, sous forme binaire, pour le post-traitement et l'analyse. Cela aide à déboguer les problèmes sur le terrain et fournit aux ingénieurs une boîte à outils pour enregistrer les informations à des fins d'analyse. Un contrôleur peut fournir les informations à la demande d'un hôte via l'événement (sous-événement Controller Debug Info) ou de manière autonome lorsque le contrôleur le souhaite. Des exemples d'utilisations pourraient être de rapporter des informations sur l'état du micrologiciel, des informations de vidage sur incident, des informations de journalisation, etc.

OCF : 0x15B

Paramètre de commande Taille But
N / A Liste de paramètres de commande vide

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée

Prise en charge du déchargement matériel A2DP

La fonction de déchargement A2DP prend en charge le déchargement du processus d'encodage audio A2DP vers un processeur audio connecté au contrôleur BT. Le flux de données audio codé passe directement du processeur audio au contrôleur BT sans l'implication de l'hôte BT. L'hôte BT est toujours responsable de la configuration et du contrôle de la session A2DP.

OCF : 0x15D

Démarrer le déchargement A2DP

Sous-OCF : 0x01

Utilisez cette commande à la fois pour configurer le processus de déchargement A2DP et pour démarrer le flux A2DP.

Paramètre de commande Taille But
Codec 4 octets Spécifie le type de codec
0x01 - SBC
0x02 - AA
0x04 - APTX
0x08 - APTX HD
0x10 - LDAC
Max_Latency 2 octets Latence maximale autorisée (en ms). Une valeur de zéro désactive le vidage.
SCMS-T_Enable 2 octets Octet 0 : fanion qui active l'ajout de l'en-tête SCMS-T.
  • 0x00 - En-tête SCMS-T non inclus.
  • 0x01 - En-tête SCMS-T inclus.

Octet 1 : valeur de l'en-tête SCMS-T, lorsqu'il est activé.

Sampling_Frequency 4 octets 0x01 - 44100Hz
0x02 - 48000Hz
0x04 - 88200Hz
0x08 - 96000Hz
Bits_Per_Sample 1 octet 0x01 - 16 bits par échantillon
0x02 - 24 bits par échantillon
0x04 - 32 bits par échantillon
Channel_Mode 1 octet 0x01 - Mono
0x02 - Stéréo
Encoded_Audio_Bitrate 4 octets Le débit binaire audio encodé en bits par seconde seconde.
0x00000000 - Le débit binaire audio n'est pas spécifié / inutilisé.
0x00000001 - 0x00FFFFFF - Débit audio codé en bits par seconde.
0x01000000 - 0xFFFFFFFF - Réservé.
Connection_Handle 2 octets Descripteur de connexion de la connexion A2DP en cours de configuration
L2CAP_Channel_ID 2 octets ID de canal L2CAP à utiliser pour cette connexion A2DP
L2CAP_MTU_Size 2 octets Taille maximale de L2CAP MTU contenant des paquets audio encodés
Codec_Information 32 octets Informations spécifiques au codec.

Codec SBC :

Reportez-vous aux éléments d'information spécifiques au codec SBC dans A2DP v1.3.
Octet 0 : longueur de bloc | Sous-bandes | Méthode d'attribution
Octet 1 : valeur minimale du pool de bits
Octet 2 : valeur maximale du pool de bits
Octet 3 : fréquence d'échantillonnage | Mode canal
Octet 4-31 : réservé

Codec AAC :

Reportez-vous aux éléments d'information spécifiques au codec AAC dans A2DP v1.3
Octet 0 : Type d'objet
octet 1 ; b7 : VBR
Octet 2-31 : réservé

Codec LDAC :

Octet 0-3 : ID du fournisseur
0x0000012D

Octet 4-5 : ID de codec
0x00AA - LDAC
Toutes les autres valeurs sont réservées

Octet 6 : Indice de débit :
0x00 - Élevé
0x01 - Milieu
0x02 - Bas
0x03 - 0x7E - Réservé
0x7F - ABR (débit binaire adaptatif)
0x80 - 0xFF - Réservé

Octet 7 : mode de canal LDAC
0x01 - Stéréo
0x02 - Double
0x04 - Mono
D'autres sont réservés

Octet 8-31 : réservé

Tous les autres codecs :

Octet 0-31 : réservé

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Sub_Opcode 1 octet 0x0- Démarrer le déchargement A2DP

Arrêter le déchargement A2DP

Sous-OCF : 0x02

Cette commande est utilisée pour arrêter le flux de déchargement A2DP.

Paramètre de commande Taille But
N / A Liste de paramètres de commande vide.

Aucun paramètre n'est défini pour cette commande.

Un événement Command Complete sera généré pour cette commande.

Paramètre de retour Taille But
Status 1 octet État de la commande terminée
Sub_Opcode 1 octet 0x02 - Arrêter le déchargement A2DP

Commande Rapport de qualité Bluetooth

La fonction de commande de rapport de qualité BT démarre le mécanisme du contrôleur Bluetooth pour signaler les événements de qualité Bluetooth à l'hôte. Vous pouvez activer quatre options :

  • Mode de surveillance de la qualité : le contrôleur envoie périodiquement un sous-événement BQR lié à la qualité de la liaison à l'hôte.
  • Approche de LSTO : si aucun paquet n'est reçu du périphérique BT connecté pendant plus de la moitié de la valeur du délai de supervision de la liaison (LSTO), le contrôleur signale un événement d'approche de LSTO à l'hôte.
  • A2DP Audio Choppy : Lorsque le contrôleur détecte des facteurs qui provoquent un son saccadé, le contrôleur signale un événement A2DP Audio Choppy à l'hôte.
  • (e)SCO Voice Choppy : Lorsque le contrôleur détecte des facteurs qui provoquent une voix saccadée, le contrôleur signale un événement (e)SCO Voice Choppy à l'hôte.
  • Inflammation de la racine : cet événement est envoyé par le contrôleur à la pile lorsque la couche HAL ou le contrôleur rencontre une erreur fatale et doit redémarrer Bluetooth.
  • Suivi des messages LMP/LL : le contrôleur envoie le message LMP/LL d'établissement de liaison avec l'appareil distant à l'hôte.
  • Bluetooth Multi-profile/Coex scheduling trace: The controller sends its scheduling information on handling multiple Bluetooth profiles and wireless coexistence in the 2.4 Ghz band to the host.
  • Controller Debug Information mechanism: When enabled, the controller can autonomously report debug logging information through the Controller debug info sub-event to the host.

OCF: 0x15E

Command parameter Size Purpose
BQR_Report_Action 1 octet Action to add / delete reporting of quality event(s) set in BQR_Quality_Event_Mask parameter, or clear all.

0x00 - Add
0x01 - Delete
0x02 - Clear

Delete will clear specific quality event(s) reporting.
Clear will clear all quality events reporting (BQR_Quality_Event_Mask parameter can be ignored).

BQR_Quality_Event_Mask 4 octets Bit masks for the selected quality event reporting.

Bit 0: Set to enable quality monitoring mode.
Bit 1: Set to enable Approaching LSTO event (for ACL/(e)SCO/ISO).
Bit 2: Set to enable A2DP Audio Choppy event.
Bit 3: Set to enable (e)SCO Voice Choppy event.
Bit 4: Set to enable Root inflammation event.
Bit 5: Set to enable energy monitoring mode.
Bit 6: Set to enable LE audio choppy event.
Bit 7: Set to enable connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Set to enable vendor-specific quality events.
Bit 16: Set to enable LMP/LL message trace.
Bit 17: Set to enable Bluetooth Multi-link/Coex scheduling trace.
Bit 18: Set to enable the Controller Debug Information mechanism.
Bit 19 ~ 30: Reserved.
Bit 31: Set to enable vendor-specific trace.

BQR_Minimum_Report_Interval 2 octets Define the minimum time interval of quality event reporting for the selected quality event(s). The controller Firmware should not report the next event within the defined time interval. The interval setting shall be respective and dedicated for the quality event(s) which are being added.

Unit: ms
Default: 0 (No limitation for the interval.)
Range: 0 ~ 65535 ms

BQR_Vendor_Specific_Quality_Event_Mask 4 octets Bit masks for the selected vendor-specific quality event reporting.
This parameter is valid only when bit 15 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

BQR_Vendor_Specific_Trace_Mask 4 octets Bit masks for the selected vendor-specific trace reporting.
This parameter is valid only when bit 31 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Current_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Bit 0: Quality monitoring mode is enabled.
Bit 1: Approaching LSTO event reporting is enabled.
Bit 2: A2DP Audio Choppy event reporting is enabled.
Bit 3: (e)SCO Voice Choppy event reporting is enabled.
Bit 4: Root inflammation event reporting is enabled.
Bit 5: Energy monitoring mode is enabled.
Bit 6: LE audio choppy event reporting is enabled.
Bit 7: Connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Vendor-specific quality event reporting is enabled.
Bit 16: LMP/LL message trace is enabled.
Bit 17: Bluetooth Multi-link/Coex scheduling trace is enabled.
Bit 18: Controller Debug Information mechanism is enabled.
Bit 19 ~ 30: Reserved.
Bit 31: Vendor-specific trace is enabled.
Current_Vendor_Specific_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Current_Vendor_Specific_Trace_Mask 4 octets Indicates current bit mask setting.

Dynamic Audio Buffer command

The Dynamic Audio Buffer reduces audio glitching by changing the audio buffer size in the Bluetooth controller based on various scenarios.

OCF: 0x15F

Get audio buffer time capability

Sub OCF: 0x01

Use this command to get the audio buffer time capability from the Bluetooth controller.

Command parameter Size Purpose
N / A Empty Command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x01 - Get audio buffer time
Audio_Codec_Type_Supported 4 octets Bit masks for the supported codec types
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved
Audio_Codec_Buffer_Default_Time_For_Bit_0 2 octets Default buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_0 2 octets Maximum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_0 2 octets Minimum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Default_Time_For_Bit_1 2 octets Default buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_1 2 octets Maximum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_1 2 octets Minimum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
...... ...... ......
Audio_Codec_Buffer_Default_Time_For_Bit_31 2 octets Default buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_31 2 octets Maximum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_31 2 octets Minimum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms

Set audio buffer time

Sub OCF: 0x02

Use this command to set the audio buffer time to the Bluetooth controller.

Command parameter Size Purpose
Audio_Codec_Buffer_Time 2 octets Requested audio buffer time for the current used codec.
Unit: ms

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x02 - Set audio buffer time
Audio_Codec_Buffer_Time 2 octets Current audio buffer time in the Bluetooth controller.
Unit: ms

HCI event (vendor-specific)

Vendor-specific HCI events are required in some cases. Refer to Figure 5.4 on page 1897 of the BT Core 5.2 Specification. Event parameter 0 will always contain the first sub-event code, based on which the rest of the HCI event is decoded.

Event Parameter Size Purpose
HCI_vendor_specific_event_code 1 octet 0xFF
sub_event_code 1 octet A sub-event code will be 1 octet in size, the byte immediately following Parameter Length in the HCI event packet.

Storage threshold breach sub-event

This event indicates that the storage threshold has been breached.

Sub-event code = 0x54

Sub-event Parameter Size Purpose
None

LE multi-advertising state change sub-event

This event indicates that an advertising instance has changed its state. At this time, this event is only used to indicate which advertising instance was stopped as a result of a connection.

Sub-event code = 0x55

Sub-event parameter Size Purpose
Advertising_instance 1 octet Identifies the specific advertising instance
Valid values are 0 through max_advt_instances -1
State_Change_Reason 1 octet 0x00: Connection received
Connection_handle 2 octets Identifies the connection that caused the advt instance to be disabled (0xFFFF if invalid)

LE advertisement tracking sub-event

This event indicates when an advertiser is found or lost.

Sub event code = 0x56

Sub-event Parameter Size Purpose
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
Advertiser_State 1 octet 0x00: Advertiser found
0x01: Advertiser lost
Advt_Info_Present 1 octet 0x00: Advertiser information ( Advt_Info ) present
0x01: Advertiser information ( Advt_Info ) not present
Advertiser_Address 6 octets Public or random address
Advertiser_Address_Type 1 octet 0x00: Public address
0x01: Random address
Advt_Info Tx_Pwr[0] : 1 octet
RSSI[0] : 1 octet
Timestamp[0] : 2 octets
Adv packet_len[0] : 1 octet
Adv_packet[0] : Adv_packet_len octets
Scan_data_resp_len[0] : 1 octet
Scan_data_resp[0] : Scan_data_resp octets

Controller debug info sub-event

This event is used by a Controller to provide binary debug information to a host.

Sub-event code = 0x57

Sub-event Parameter Size Purpose
debug_block_byte_offset_start 2 octets Debug block byte offset from the start
last_block 1 octet 0x00: More debug data present
0x01: Last binary block; no more debug data
cur_pay_load_sz 2 octets Binary block size in a current event
Debug_Data Variable Debug data of cur_payload_sz

Bluetooth Quality Report sub-event

This event indicates one of the following: a Bluetooth quality event occurred, the controller uploaded the LMP/LL message trace and Bluetooth Multi-link/Coex scheduling trace, or the controller dumped debug information data.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x01: Quality reporting on the monitoring mode.
0x02: Approaching LSTO.
0x03: A2DP Audio Choppy.
0x04: (e)SCO Voice Choppy.
0x05 ~ 0x06: Reserved.
0x07: LE audio choppy.
0x08: Connect fail.
0x09 ~ 0xFF: Reserved.
Packet_Types 1 octet 0x01: ID
0x02: NULL
0x03: POLL
0x04: FHS
0x05: HV1
0x06: HV2
0x07: HV3
0x08: DV
0x09: EV3
0x0A: EV4
0x0B: EV5
0x0C: 2-EV3
0x0D: 2-EV5
0x0E: 3-EV3
0x0F: 3-EV5
0x11: DH1
0x12: DM3
0x13: DH3
0x14: DM5
0x15: DH5
0x16: AUX1
0x17: 2-DH1
0x18: 2-DH3
0x19: 2-DH5
0x1A: 3-DH1
0x1B: 3-DH3
0x1C: 3-DH5
0x1D ~ 0x50: Reserved
0x51: ISO packet
0x52 ~ 0xFF: Reserved
Connection_Handle 2 octets ACL/(e)SCO/ISO connection handle.
Connection_Role 1 octet Performing Role for the connection.
0x00: Central
0x01: Peripheral
0x02 ~ 0xFF: Reserved.
TX_Power_Level 1 octet Current transmit power level for the specified Connection_Handle.

This value shall be the same as the controller's responding to the HCI_Read_Transmit_Power_Level HCI command.

RSSI 1 octet [in dBm]

Received Signal Strength Indication (RSSI) value for the specified Connection_Handle.
This value shall be an absolute receiver signal strength value.
Range: -127 to +20

SNR 1 octet [in dB]

Signal-to-Noise Ratio (SNR) value for the specified Connection_Handle.
The controller shall provide the average SNR of all the channels used by the link.

Unused_AFH_Channel_Count 1 octet Indicates the number of unused channels in AFH_channel_map.
0x4F ~ 0xFF: Reserved.
AFH_Select_Unideal_Channel_Count 1 octet Indicates the number of the channels which are interfered and have bad quality, but they are still selected for AFH.
The minimum number of channels allowed by the Bluetooth specification is 20, so even if all 79 channels are interfered and have bad quality, the controller still needs to choose at least 20 channels for AFH.
LSTO 2 octets Current Link Supervision Timeout Setting.
Time = N * 0.625 ms
Time Range: 0.625 ms to 40.9 s
Connection_Piconet_Clock 4 octets Piconet Clock for the specified Connection_Handle.
This value shall be the same as the controller's responding to HCI_Read_Clock HCI command with parameter "Which_Clock" of 0x01 (Piconet Clock).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Retransmission_Count 4 octets The number of retransmissions since the last event.
This count shall be reset after reporting to the host.
No_RX_Count 4 octets No RX count since the last event.
The count increases when no packet is received at the scheduled time slot or the received packet is corrupted.
This count shall be reset after reporting to the host.
NAK_Count 4 octets NAK (Negative Acknowledge) count since the last event.
This count shall be reset after reporting to the host.
Last_TX_ACK_Timestamp 4 octets Timestamp of last TX ACK. It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Flow_Off_Count 4 octets The number of times the controller receives Flow-off (STOP) since the last event.
This count shall be reset after reporting to the host.
Last_Flow_On_Timestamp 4 octets Timestamp of last Flow-on (GO). It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Buffer_Overflow_Bytes 4 octets [in Byte]

Buffer overflow count since the last event.
The controller counts how many bytes of data are dropped.
This count shall be reset after reporting to host.

Buffer_Underflow_Bytes 4 octets [in Byte]

Buffer underflow count since the last event.
This count shall be reset after reporting to host.

bdaddr 6 octets Remote device address
cal_failed_item_count 1 octet The count of calibration failed items
TX_Total_Packets 4 octets The number of packets that are sent out.
TX_UnAcked_Packets 4 octets The number of packets that don't receive an acknowledgment.
This count is reset after reporting to the host.
TX_Flushed_Packets 4 octets The number of packets that aren't sent out by its flush point.
This count is reset after reporting to the host.
TX_Last_Subevent_Packets 4 octets The number of packets that Link Layer transmits a CIS data PDU in the last subevent of a CIS event.
This count is reset after reporting to the host.
The value is zero if there's no valid value for the link.
CRC_Error_Packets 4 octets The number of received packages with CRC error since the last event.
This count is reset after reporting to the host.
RX_Duplicate_Packets 4 octets The number of duplicate (retransmission) packages received since the last event.
This count is reset after reporting to the host.
Vendor Specific Parameter (parameter total length - TBD) * octets For the controller vendor to obtain more vendor specific parameters.

Sub-event code = 0x58 [Quality_Report_Id = 0x05, Root Inflammation event]

This event indicates that Bluetooth HAL or the controller encountered a fatal error and needs Bluetooth stack to record this situation and restart. The controller must send a Root_Inflammation_Event to Bluetooth stack before sending the first fragment of the debug info events in any case.

The Error_Code parameter contains an error code reported from HAL/Controller, 0 if it is a chipset vendor specific error. The Vendor_Specific_Error_Code contains a chipset vendor specific error code from HAL/Controller. It should set as 0 if the parameter Error_Code is not 0. The parameters Error_Code and Vendor_Specific_Error_Code should not both be 0.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x04: Reserved.
0x05: Root inflammation.
0x06 ~ 0xFF: Reserved.
Error_Code 1 octet 0x00: Chipset vendor specific error code is included.
0x01 ~ 0xFF: Controller failure occurred. See Bluetooth Spec [Vol 2] Part D, Error Codes for a list of error codes and descriptions.
Vendor_Specific_Error_Code 1 octet 0x00: No chipset vendor specific error code is included.
0x01 ~ 0xFF: Chipset vendor specific error code.
Vendor Specific Parameter (Parameter Total Length - 4) * octets For the controller vendor to obtain more vendor specific parameters.
Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x10: Reserved.
0x11: LMP/LL message trace.
0x12: Bluetooth Multi-link/Coex scheduling trace.
0x13: Controller Debug Information data dump.
0x14 ~ 0xFF: Reserved.
Connection_Handle 2 octets Connection Handle.
Vendor Specific Parameter (Parameter Total Length - 4) * octets Vendor Specific format of LMP message trace, Bluetooth Multi-link/Coex scheduling trace and Controller Debug Information data dump.

Multi-advertiser support

The objectives of multi-advertiser support are the following:

  • Ability to support multiple advertisements ( max_advt_instances )
  • Different transmit powers to allow for a varying range
  • Different advertising content
  • An individualized response for each advertiser
  • Privacy (non-trackable) for each advertiser
  • Connectable

To keep this specification close to existing standards, the following vendor-specific commands are provided. They are derived from the Bluetooth Core 4.1 Specification.

LE_Multi_Advt_Command

OCF: 0x154

Command parameter Size Purpose
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Sub_Cmd
0x02 - Set_Advt_Data_Multi_Sub_Cmd
0x03 - Set_Scan_Resp_Data_Multi_Sub_Cmd
0x04 - Set_Random_Addr_Multi_Sub_Cmd
0x05 - Set_Advt_Enable_Multi_Sub_Cmd

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Command
0x02 - Set_Advt_Data_Multi_Command
0x03 - Set_Scan_Resp_Data_Multi_Command
0x04 - Set_Random_Addr_Multi_Command
0x05 - Set_Advt_Enable_Multi_Command

LE_Multi_Advt_Command: Set_Advt_Param_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 964 (LE Set Advertising Parameter Command)

Sub OCF: 0x01

Sub-command parameter Size Purpose
Advertising_Interval_Min Per spec Per spec
Advertising_Interval_Max Per spec Per spec
Advertising_Type Per spec Per spec
Own_Address_Type Per spec Per spec
Own_Address Per spec Per spec
Direct_Address_Type Per spec Per spec
Direct_Address Per spec Per spec
Advertising_Channel_Map Per spec Per spec
Adverstising_Filter_Policy Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance
Tx_power 1 octet Transmit_Power
Unit - in dBm (signed integer)
Range (-70 to +20)

The Own_Address parameter could be a host-configured address at the time of setting up this multi-advertisement instance. This provides the ability to have a resolvable private address at the time of the transmit of the first beacon. Advertisement on an instance will continue irrespective of the connection. The host BT stack could issue a command to start advertisement on an instance, post connection.

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success (invalid parameter) code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 [ Set_Advt_Param_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 969 (LE Set Advertising Data Command)

Sub OCF: 0x02

Sub-command parameter Size Purpose
Advertising_Data_Length Per spec Per spec
Advertising_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x02 [ Set_Advt_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Scan_Resp_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 970 (LE Set Scan Response Data Command)

Sub OCF: 0x03

Sub-command parameter Size Purpose
Scan_Response_Data_Length Per spec Per spec
Scan_Response_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code (invalid parameter) if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x03 [ Set_Scan_Resp_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Random_Addr_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 963 (LE Set Random Address Command)

Sub OCF: 0x04

Sub-command parameter Size Purpose
Random Address Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x04 [ Set_Random_Addr_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Enable_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 971 (LE Set Advertise Enable Command in that core specification)

OCF: 0x05

Sub-command parameter Size Purpose
Advertising_Enable 1 octet A value of 1 means enable. Any other value means disable.
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance. Instance 0 means a standard HCI instance.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x05 [ Set_Advt_Enable_Multi_Sub_Cmd]

Offloaded resolution of private address

This feature resolves a private address in the controller firmware or hardware, which provides the following benefits:

  • Latency involved with the host in resolving a private address
  • Saving power by refraining from waking up the host

LE_Set_RPA_Timeout

OCF: 0x15C

Command parameter Size Purpose
LE_local_IRK 16 octet The local device IRK used to generate the random resolvable address(es).
tRPA_min 2 octets The minimum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or after this timeout.
Valid range: 300-1800
tRPA_max 2 octets The maximum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or before this timeout.
Valid range: tRPA_min -1800
Return parameter Size Purpose
Status 1 octet The status of the command.

Suggested HCI status values:
0x00 Success
0x01 Unknown command (if not supported)
0x12 Invalid command parameters (if any parameters are outside the given range)

LE_RPA_offload_Command

OCF: 0x155

Command parameter Size Purpose
RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

LE_RPA_offload: Enable_cust_specific_sub_Command

Sub OCF: 0x01

Sub-command parameter Size Purpose
enable_customer_specific_feature_set 1 octet 0x01 - Enable offloaded RPA feature
0x00 - Disable offloaded RPA feature

RPA offload is required to be enabled by the host, based on the chip capability. Refer to the LE_Get_Vendor_Capabilities_Command . Each chip can have a varying max_irk_list_sz in the firmware.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x01 [Enable customer-specific feature]

LE_RPA_offload: Add_IRK_to_list_sub_Command

Sub OCF: 0x02

Sub-command parameter Size Purpose
LE_IRK 16 octets LE IRK (1st byte LSB)
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK (1st byte LSB)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x02 [Add IRK to the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Remove_IRK_to_list_sub_Command

Sub OCF: 0x03

Sub-command parameter Size Purpose
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address that associates to the IRK

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x03 [Remove IRK from the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Clear_IRK_list_sub_Command

Sub OCF: 0x04

Sub-command parameter Size Purpose
None

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x04 [Clear IRK List]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation [ max_irk_list_sz]

LE_RPA_offload: Read_IRK_list_sub_Command

Sub OCF: 0x05

Sub-command parameter Size Purpose
LE_read_IRK_list_entry-index 1 octet Index of the IRK list [0, max_irk_list_sz-1]

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x05 [Read IRK List Entry]
LE_Read_IRK_List_entry 1 octet Index of the IRK that the host wants to read back (maximum IRK list size is 32)
LE_IRK 16 octets IRK value
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK
LE_Resolved_Private_Address 6 octets Current resolved resolvable private address of this IRK
,

The Host Controller Interface (HCI) is used for interacting with a Bluetooth controller.

This document provides a list of Bluetooth (BT) and Bluetooth Low Energy (BLE) HCI requirements. The aim is for Host BT stack vendors and BT controller vendors to conform to these platform requirements in order to use the feature set described below.

This document refers to the Bluetooth Core 5.2 Specification as the "spec." The Bluetooth Core 5.2 Specification is available on the Bluetooth SIG website along with other adopted documents.

General design overview

Chip capabilities and configuration

As an open platform, Android has a matrix of software releases, OEMs, vendors, and platform and chip capabilities.

To manage the varying landscape and to manage migrations, a design philosophy of allowing BT controllers to expose their capabilities (beyond the standard Bluetooth Core 5.2 Specification) is described in this document. The host BT stack can then use these capabilities to determine which features to enable.

Supporting open standards

One goal of Android is to support open standards after ratification in a Bluetooth specification. If a feature described below becomes available in standard HCI methods in a future Bluetooth specification, we will lean towards making that approach the default.

Vendor-specific capabilities

Vendor-specific command: LE_Get_Vendor_Capabilities_Command

OpCode Command Field (OCF): 0x153

Command parameter Size Purpose
NA Empty Command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
max_advt_instances
(Deprecated)
1 octet Number of advertisement instances supported.

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the LE Extended Advertising available in the BT spec version 5.0 and higher.
offloaded_resolution_of_private-address
(Deprecated)
1 octet BT chip capability of RPA.
If supported by a chip, it needs enablement by the host.
0 = Not capable
1 = Capable

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the Privacy feature available in the BT spec version 4.2 and higher.
total_scan_results_storage 2 octets Storage for scan results in bytes
max_irk_list_sz 1 octet Number of IRK entries supported in the firmware
filtering_support 1 octet Support for filtering in the controller
0 = Not supported
1 = Supported
max_filter 1 octet Number of filters supported
activity_energy_info_support 1 octet Supports reporting of activity and energy information
0 = Not capable
1 = Capable
version_supported 2 octets Specifies the version of the Google feature spec supported
byte[0] = Major number
byte[1] = Minor number

v1.03
byte[0] = 0x01
byte[1] = 0x03
total_num_of_advt_tracked 2 octets Total number of advertisers tracked for OnLost / OnFound purposes
extended_scan_support 1 octet Supports extended scan window and interval
debug_logging_supported 1 octet Supports logging of binary debug information from controller
LE_address_generation_offloading_support
(Deprecated)
1 octet 0 = Not supported
1 = Supported

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the Privacy feature available in the BT spec version 4.2 and higher.
A2DP_source_offload_capability_mask 4 Octets Bit masks for codec types supported
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved
bluetooth_quality_report_support 1 octet Supports reporting of Bluetooth Quality events
0 = Not capable
1 = Capable
dynamic_audio_buffer_support 4 octets Supports dynamic audio buffer in the Bluetooth controller
Bit masks for codec types supported
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved

Batching of scan results

A design goal is to enhance how the Bluetooth LE Scan Response event notifications are delivered to the host, in order to save power in the host.

By reducing how often the controller notifies the host application processor to scan results, the host application processor can stay in idle/sleep longer. This reduces power consumption in the host. The return parameter total_scan_results_storage of LE_Get_Vendor_Capabilities_Command indicates the chip capability for storage of scan results.

This feature focuses on the management and configuration of the LE Scan Results storage facility in the Bluetooth controller. The storage is used to temporarily batch advertisement data and scan data and metadata that are received by the controller for later delivery to the host.

Firmware shall support two types of batching, which can be engaged simultaneously:

  • Truncated. Contains the following information elements: {MAC, TX Power, RSSI, Timestamp}
  • Full. Contains the following information elements: {MAC, TX Power, RSSI, Timestamp, Adv Data, Scan Response}

LE_Batch_Scan_Command

OCF: 0x156

Command parameter Size Purpose
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

A Command Complete event will be generated for this command. Enabling the customer-specific feature does not start the scan.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

LE_Batch_Scan_Command: Enable Customer Specific feature

Sub OCF: 0x01

Sub-command parameter Size Purpose
enable_customer_specific_feature_set 1 octet 0x01 - Enable Batch Scan feature
0x00 - Disable Batch Scan feature

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

LE_Batch_Scan_Command: Set Batch Scan Storage Param subcommand

Sub OCF: 0x02

Sub-command parameter Size Purpose
Batch_Scan_Full_Max 1 octet Max storage space (in %) allocated to full style
[Range: 0-100]
Batch_Scan_Truncated_Max 1 octet Max storage space (in %) allocated to truncated style
[Range: 0-100]
Batch_Scan_Notify_Threshold 1 octet Setup notification level (in %) for individual storage pool
[Range: 0-100]
Setting to 0 will disable notification. Vendor-specific HCI event is generated (Storage threshold breach subevent)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x02 [Set Batch Scan parameters]

LE_Batch_Scan_Command: Set Batch Scan Param subcommand

Sub OCF: 0x03

Sub-command parameter Size Purpose
Batch_Scan_Mode 1 octet 0x00 – Batch scan is disabled
0x01 – Truncated mode is enabled
0x02 – Full mode is enabled
0x03 – Truncated and Full mode are enabled
Duty_cycle_scan_window 4 octets Batch Scan scan time (# of slot)
Duty_cyle_scan_interval 4 octets Batch Scan interval period (# of slot)
own_address_type 1 octet 0x00 - Public device address
0x01 - Random device address
Batch_scan_Discard_Rule 1 octet 0 - Discard oldest advertisement
1 - Discard advertisement with weakest RSSI

This sub-command will start batch scanning, if enabled. In Truncated scanning, results are stored in truncated form where the unique key for Truncated style = { BD_ADDR, scan_interval}. This means only one BD_ADDR will be recorded for each scan interval. The record to keep for Truncated mode is the following: { BD_ADDR , Tx Power, RSSI, Timestamp}

When Full mode is enabled, active scanning will be used and Scan Responses will be recorded. The Full style unique key = {MAC, Ad packet}, irrespective of scan interval. The record to keep for Full mode is { BD_ADDR , Tx Power, RSSI, Timestamp, Ad packet, Scan Response}. In Full style, the same AD packet, when seen multiple times across different scan intervals, is recorded only once. However, in Truncated mode, it is the visibility of BA_ADDR across different scan intervals that is of interest (once per scan interval). The RSSI is the averaged value of all duplicates of a unique advertisement within a scan interval.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x03 [Set Batch Scan Parameters]

LE_Batch_Scan_Command: Read Batch Scan Results sub-command

Sub OCF: 0x04

Sub-command parameter Size Purpose
Batch_Scan_Data_read 1 octet 0x01 – Truncated mode data
0x02 – Full mode data

A Command Complete event will be generated for this command. When the host issues this command, all the results in the controller may not fit in one Command Complete event. The host will iterate issuing this command until the corresponding results in the Command Complete event indicate 0 in the number of records, which indicates the controller has no more records to communicate to the host. Each Command Complete event could contain multiple records of only one type of data (Full or Truncated).

Controller and host time references are not synchronized. The unit of the timestamp is 50ms. The value of the timestamp is based off when the Read_Batch_Scan_Results_Sub_cmd is given by the host. If a command arrival time is T_c in the firmware, then the actual time the timestamp was taken in the firmware is T_fw . The reporting time will be: ( T_c - T_fw ). T_c and T_fw are in the firmware time domain. This lets the host compute how long ago the event happened.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x03 [Set Batch Scan parameters]
Batch_Scan_data_read 1 octet Identifies the format (Truncated or Full)
num_of_records 1 octet Number of records of Batch_Scan_data_read
format_of_data Variable Truncated Mode:
Address[0]: 6 octets
Address_Type[0]: 1 octet
Tx_Pwr[0]: 1 octet
RSSI[0] : 1 octet
Timestamp[0]: 2 octets
[multiple records ( num_of_records ) with above format]

Full Mode:
Address[0]: 6 octets
Address_Type[0]: 1 octet
Tx_Pwr[0]: 1 octet
RSSI[0]: 1 octet
Timestamp[0]: 2 octets
Adv packet_len[0]: 1 octet
Adv_packet[0]: Adv_packet_len octets
Scan_data_resp_len[0]: 1 octet
Scan_data_resp[0]: Scan_data_resp octets
[multiple records with above format ( num_of_records )]

Advertising Packet Content Filter

Use this to enable/disable/setup the Advertising Packet Content Filter (APCF) in the controller. APCF filters advertising reports in the controller but doesn't filter periodic advertising.

LE_APCF_Command

OCF: 0x157

Command parameter Size Purpose
APCF_opcode 1 octet 0x00 - APCF Enable
0x01 - APCF Set Filtering parameters
0x02 - APCF Broadcaster Address
0x03 - APCF Service UUID
0x04 - APCF Service Solicitation UUID
0x05 - APCF Local Name
0x06 - APCF Manufacturer Data
0x07 - APCF Service Data
0x08 - APCF Transport Discovery Service
0x09 - APCF AD Type Filter
0x10 ~ 0xAF - Reserved for future use
0xB0 ~ 0xDF - Reserved for vendor
0xE0 ~ 0xFE - Reserved for future use
0xFF - APCF Read extended Features

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Return status
APCF_opcode 1 octet 0x00 - APCF Enable
0x01 - APCF Set Filtering parameters
0x02 - APCF Broadcaster Address
0x03 - APCF Service UUID
0x04 - APCF Service Solicitation UUID
0x05 - APCF Local Name
0x06 - APCF Manufacturer Data
0x07 - APCF Service Data
0x08 - APCF Transport Discovery Service
0x09 - APCF AD Type Filter
0x10 ~ 0xAF - Reserved for future use
0xB0 ~ 0xDF - Reserved for vendor
0xE0 ~ 0xFE - Reserved for future use
0xFF - APCF Read extended Features

LE_APCF_Command: Enable_sub_cmd

Sub OCF: 0x00

Sub-command parameter Size Purpose
APCF_enable 1 octet 0x01 - Enable APCF feature
0x00 - Disable APCF feature

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x0 - APCF Enable
APCF_Enable 1 octet Enable/disable is set via APCF_enable

LE_APCF_Command: set_filtering_parameters_sub_cmd

This subcommand is used to add or delete a filter specification or clear a filter list for on-chip filtering.

Sub OCF: 0x01

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will clear the specific filter along with associated feature entries in other tables.
Clear will clear all the filters and associated entries in other tables.
APCF_Filter_Index 1 octet Filter index (0, max_filter-1 )
APCF_Feature_Selection 2 octets Bit masks for the selected features:
Bit 0: Set to enable Broadcast Address filter
Bit 1: Set to enable Service Data Change filter
Bit 2: Set to enable Service UUID check
Bit 3: Set to enable Service Solicitation UUID check
Bit 4: Set to enable Local Name check
Bit 5: Set to enable Manufacturer Data Check
Bit 6: Set to enable Service Data Check
Bit 7: Set to enable Transport Discovery Service Check
Bit 8: Set to enable AD Type Check
APCF_List_Logic_Type 2 octets Logic operation for each feature selection (per-bit position) specified in APCF_Feature_Selection .
Valid only when a feature is enabled.
Bit position value:
0: OR
1: AND
If "AND" logic is selected, an ADV packet will pass the filter only if it contains ALL of the entries in the list.
If "OR" logic is selected, an ADV packet will pass the filter if it contains any of the entries in the list.
APCF_Filter_Logic_Type 1 octet 0x00: OR
0x01: AND
Note: The logic type is N/A for the first three fields of APCF_Feature_Selection , which is always "AND" logic. They are only applicable for (Bit 3 - Bit 6) four fields of APCF_Feature_Selection .
rssi_high_thresh 1 octet [in dBm]
The advertiser is considered seen only if the signal is higher than the RSSI high threshold. Otherwise, the firmware must behave as if it never saw it.
delivery_mode 1 octet 0x00 - immediate
0x01 - on_found
0x02 - batched
onfound_timeout 2 octets Valid only if delivery_mode is on_found .
[in milliseconds]
Time for firmware to linger and collect additional advertisements before reporting.
onfound_timeout_cnt 1 octet Valid only if delivery_mode is on_found .
[count]
If an advertisement in onFound lingers in firmware for the onfound_timeout duration, it will collect a few advertisements and the count is checked. If the count exceeds onfound_timeout_cnt , it's reported OnFound immediately thereafter.
rssi_low_thresh 1 octet Valid only if delivery_mode is on_found .
[in dBm]
The advertiser packet is considered as not seen if the RSSI of the received packet is not above the RSSI low threshold.
onlost_timeout 2 octets Valid only if delivery_mode is on_found .
[in milliseconds]
If an advertisement, after being found, is not seen contiguously for the lost_timeout period, it will immediately be reported lost.
num_of_tracking_entries 2 octets Valid only if delivery_mode is on_found .
[count]
Total number of advertisers to track per filter.

RSSI values must use 2's complement to represent negative values.

Host shall be able to configure multiple filters with APCF_Application_Address_type set to 0x02 (for all broadcaster addresses) to manage various filter combinations.

Filtering, batching and reporting are inter-related concepts. Every advertisement and related scan response will have to go through all the filters, one after the other. Thus, resulting actions ( delivery_mode ) are closely tied to filtering. The delivery modes are the following: report_immediately , batch , and onFound . The OnLost value is related to OnFound in the sense that it will come after OnFound when lost.

This processing flow depicts the conceptual model:

When an advertisement (or scan response) frame is received, it is applied to all the filters in serial order. It's possible that an advertisement can cause immediate reporting based on one filter and batching of the same due to a different filter action.

RSSI level thresholds (high and low) give the ability to control when the frame is visible for filter processing, even when a valid packet is received by the controller. In case of delivery mode being set to immediate or batched, the RSSI of a frame is considered for further controller processing. Different apps need different reporting and batching behavior. This allows multiple apps to have direct reporting and/or batching of results in firmware, concurrently. An example is a case when a batch scan is active from one app and later a regular LE scan is issued by another app. Before a batch scan is issued, the framework/app sets appropriate filters. Later, when the second app issues a regular scan, previous batching continues. However, due to the regular scan, it is akin to conceptually adding a null filter (along with all the existing filters) along with the LE scan command. The LE scan command parameters take precedence when active. When the regular LE scan is disabled, the controller will revert back to a previous batch scan, if it existed.

The OnFound delivery mode is based on configured filters. A combination that triggers a filter's action to succeed is considered the entity to track for onLost . The corresponding event is the LE Advt tracking subevent.

The OnFound/OnLost transition for a filter (if enabled) will look like the following:

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x01 - APCF Set Filtering Parameters
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of available entries in the filters table

LE_APCF_Command: broadcast_address_sub_cmd

This subcommand is used to add or delete an advertiser address or to clear the advertiser address list for on-chip filtering.

Sub OCF: 0x02

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified broadcaster address in the specified filter.
Clear will clear all the broadcaster addresses in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter-1 )
APCF_Broadcaster_Address 6 octet 6-byte device address to add to or delete from the broadcaster address list
APCF_Application_Address_type 1 octet 0x00: Public
0x01: Random
0x02: NA (addresses type not applicable)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x02 - APCF Broadcaster Address
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Broadcast Address table

LE_APCF_Command: service_uuid_sub_cmd

This subcommand is used to add or delete a service UUID or to clear a service UUID list for on-chip filtering.

Sub OCF: 0x03

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified service UUID address in the specified filter.
Clear will clear all the service UUIDs in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_UUID 2,4,16 octet The Service UUID (16-bit, 32-bit, or 128-bit) for adding to, or deleting from, the list.
APCF_UUID_MASK 2,4,16 octet The Service UUID Mask (16-bit, 32-bit, or 128-bit) to add to the list. It should have the same length as APCF_UUID.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x03 - APCF Service UUID
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Service UUID table

LE_APCF_Command: solicitation_uuid_sub_cmd

This subcommand is used to add or delete a solicitation UUID or to clear a solicitation UUID list for on-chip filtering.

Sub OCF: 0x04

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the solicitation UUID address in the specified filter.
Clear will clear all the solicitation UUIDs in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_UUID 2,4,16 octet The Solicitation UUID (16-bit, 32-bit, or 128-bit) to add to or delete from the list.
APCF_UUID_MASK 2,4,16 octet The Solicitation UUID Mask (16-bit, 32-bit, or 128-bit) to add to the list. It should have the same length as the APCF_UUID .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x04 - APCF Solicitation UUID
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Solicitation UUID table

LE_APCF_Command: local_name_sub_cmd

This sub-command is used to add or delete a local name string or to clear the local name string list for on-chip filtering.

Sub OCF: 0x05

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified local name string in the specified filter.
Clear will clear all the local name strings in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for local name.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x05 - APCF Local Name
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Local name table

LE_APCF_Command: manf_data_sub_cmd

This subcommand is used to add or delete a manufacturer data string or to clear the manufacturer data string list for on-chip filtering.

Sub OCF: 0x06

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified manufacturer data string in the specified filter.
Clear will clear all the manufacturer data strings in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for manufacturer data.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)
APCF_ManData_Mask Variable size The manufacture data mask to add to the list. It should have the same length as APCF_LocName_or_ManData_or_SerData .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x06 - APCF Manufacturer Data
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Manufacturer Data table

LE_APCF_Command: service_data_sub_cmd

This subcommand is used to add or delete a service data string or to clear the service data string list for on-chip filtering.

Sub OCF: 0x07

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified service data string in the specified filter.
Clear will clear all the service data strings in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for service data.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)
APCF_LocName_Mandata_or_SerData_Mask Variable size The service data mask to add to the list. It should have the same length as APCF_LocName_or_ManData_or_SerData.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x07 - APCF Service Data
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available for Service Data table

LE_APCF_Command: ad_type_sub_cmd

This subcommand is used to add or delete an AD type or to clear an AD type list for on-chip filtering. Use read_extended_features_sub_cmd to check if this command is supported or not.

Sub OCF: 0x09

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified AD type in the specified filter.
Clear will clear all the AD types in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_AD_TYPE 1 octet The AD Type for adding to, or deleting from, the list. Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA_Length Variable size 0x00 - means do not filter data content
Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA Variable size Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA_MASK Variable size Ignore when APCF_Action is 0x02 (Clear)
It should have the same length as APCF_AD_DATA .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x09 - APCF AD Type
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the AD Type table

LE_APCF_Command: read_extended_features_sub_cmd

This subcommand is used to read extended APCF features.

Sub OCF: 0xFF

Sub-command parameter Size Purpose
Not applicable Empty command parameter.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0xFF - APCF_Read_Extended_Features
APCF_extended_features 2 octet

Bit masks for extended features supported:

  • Bit 0: Support Transport Discovery Service filter
  • Bit 1: Support AD Type filter
  • Bit 2 ~15: Reserved for future use

Value of bit

  • 0 = Not supported
  • 1 = Supported

Controller activity and energy information command

The objective of this information is for higher host system functions to analyze the total activities of all components, including the BT controller and its macro state, in conjunction with what is happening in the apps and framework. To do this, the following information is required from the BT stack and the controller:

  • BT stack: Reporting the current macro-operational state of the controller
  • Firmware: Reporting aggregate activity and energy information

BT host stack macro states, as determined at the user level:

  • Idle: [page scan, LE advt, inquiry scan]
  • Scan: [paging/inquiry/trying to connect]
  • Active: [ACL link on, SCO link ongoing, sniff mode]

The activities that the controller keeps track of over its life are Tx time, Rx time, idle time, and total energy consumed. They are cleared when read from the host.

LE_Get_Controller_Activity_Energy_Info

This is a vendor-specific command.

OCF: 0x159

Sub-command parameter Size Purpose
NA Empty command params

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
total_tx_time_ms 4 octets Total time performing Tx
total_rx_time_ms 4 octets Total time performing Rx
total_idle_time_ms 4 octets Total time in idle (non-sleep low power states)
total_energy_used 4 octets Total energy used [product of current (mA), voltage (V) and time (ms)]

LE extended set scan parameters command

This command can be used to enable a larger scan window and interval in the controller. Per the BT Core 5.2 Specification, a scan window and interval have an upper bound limit of 10.24 seconds, which hampers applications' longer scan intervals beyond 10.24 seconds.

Base reference: BT Core 5.2 Specification, page 2493 (LE Set Scan Parameters Command)

OCF: 0x15A

Command Parameter Size Purpose
LE_Ex_Scan_Type 1 octet 0x00 - Passive scanning. No SCAN_REQ packets shall be sent (default).
0x01 - Active scanning. SCAN_REQ packets may be sent.
LE_Ex_Scan_Interval 4 octets Defined as the time interval from when the Controller started its last LE scan until it began the subsequent LE scan.
Range: 0x0004 to 0x00FFFFFF
Default: 0x0010 (10 ms)
Time = N * 0.625 ms
Time range: 2.5 ms to 10442.25 seconds
LE_Ex_Scan_Window 4 octets The duration of the LE scan. LE_Scan_Window shall be less than or equal to LE_Scan_Interval .
Range: 0x0004 to 0xFFFF
Default: 0x0010 (10 ms)
Time = N * 0.625 ms
Time Range: 2.5 ms to 40.95 seconds
Own_Address_Type 1 octet 0x00 - Public Device Address (default)
0x01 - Random Device Address
LE_Ex_Scan_Filter_Policy 0x00 - Accept all advertisement packets (default). Directed advertising packets which are not addressed for this device shall be ignored.
0x01 - Ignore advertisement packets from devices not in the White List Only list. Directed advertising packets which are not addressed for this device shall be ignored.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status

Get controller debug info command

The objective of this information element is to acquire controller debug information by a host, in binary form, for post-processing and analysis. This helps debug on-field issues and provides engineers with a toolkit to log information for analysis. A Controller can provide the information when requested by a host via the event (Controller Debug Info sub-event) or autonomously when desired by the controller. Example uses could be to report firmware state information, crash dump information, logging information, etc.

OCF: 0x15B

Command parameter Size Purpose
N / A Empty command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status

A2DP Hardware Offload Support

The A2DP Offload feature supports the offload of the A2DP audio encoding process to an audio processor attached to the BT Controller. The encoded audio data stream passes directly from the Audio processor to the BT Controller without the BT host's involvement. The BT Host is still responsible for the configuration and control of the A2DP session.

OCF: 0x15D

Start A2DP Offload

Sub OCF: 0x01

Use this command both to configure the A2DP Offload process and to start the A2DP stream.

Command parameter Size Purpose
Codec 4 octets Specifies Codec type
0x01 - SBC
0x02 - AAC
0x04 - APTX
0x08 - APTX HD
0x10 - LDAC
Max_Latency 2 octets Max Latency Allowed (in ms). A value of zero disables flush.
SCMS-T_Enable 2 octets Octet 0: Flag that enables addition of SCMS-T header.
  • 0x00 - SCMS-T Header not included.
  • 0x01 - SCMS-T Header included.

Octet 1: Value for the SCMS-T header, when it's enabled.

Sampling_Frequency 4 octets 0x01 - 44100 Hz
0x02 - 48000 Hz
0x04 - 88200 Hz
0x08 - 96000 Hz
Bits_Per_Sample 1 octet 0x01 - 16 bits per sample
0x02 - 24 bits per sample
0x04 - 32 bits per sample
Channel_Mode 1 octet 0x01 - Mono
0x02 - Stereo
Encoded_Audio_Bitrate 4 octets The encoded audio bitrate in bits per second second.
0x00000000 - The audio bitrate is not specified / unused.
0x00000001 - 0x00FFFFFF - Encoded audio bitrate in bits per second.
0x01000000 - 0xFFFFFFFF - Reserved.
Connection_Handle 2 octets Connection Handle of A2DP connection being configured
L2CAP_Channel_ID 2 octets L2CAP Channel ID to be used for this A2DP connection
L2CAP_MTU_Size 2 octets Maximum size of L2CAP MTU containing encoded audio packets
Codec_Information 32 octets Codec-specific Information.

SBC Codec:

Refer to SBC Codec specific information elements in A2DP v1.3.
Octet 0: Block length | Subbands | Allocation Method
Octet 1: Minimum Bitpool value
Octet 2: Maximum Bitpool value
Octet 3: Sampling Frequency | Channel Mode
Octet 4-31: reserved

AAC Codec:

Refer to AAC Codec specific information elements in A2DP v1.3
Octet 0: Object Type
Octet 1; b7: VBR
Octet 2-31: reserved

LDAC Codec:

Octet 0-3: Vendor ID
0x0000012D

Octet 4-5: Codec ID
0x00AA - LDAC
All other values are reserved

Octet 6: Bitrate Index:
0x00 - High
0x01 - Mid
0x02 - Low
0x03 - 0x7E - Reserved
0x7F - ABR (Adaptive Bit Rate)
0x80 - 0xFF - Reserved

Octet 7: LDAC Channel Mode
0x01 - Stereo
0x02 - Dual
0x04 - Mono
Others are reserved

Octet 8-31: reserved

All other codecs:

Octet 0-31: reserved

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Sub_Opcode 1 octet 0x0- Start A2DP Offload

Stop A2DP Offload

Sub OCF: 0x02

This command is used to stop the A2DP Offload stream.

Command parameter Size Purpose
N / A Empty command parameter list.

No parameters are defined for this command.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Sub_Opcode 1 octet 0x02 - Stop A2DP Offload

Bluetooth Quality Report command

The BT Quality Report command feature starts the mechanism in the Bluetooth controller to report Bluetooth Quality events to the host. You can enable four options:

  • Quality Monitoring Mode: The controller periodically sends a Link Quality related BQR sub-event to the host.
  • Approaching LSTO: If no packets are received from the connected BT device for longer than half of the Link Supervision TimeOut (LSTO) value, the controller reports an Approaching LSTO event to the host.
  • A2DP Audio Choppy: When the controller detects factors that cause choppy audio, the controller reports an A2DP Audio Choppy event to the host.
  • (e)SCO Voice Choppy: When the controller detects factors that cause choppy voice, the controller reports an (e)SCO Voice Choppy event to the host.
  • Root Inflammation: This event is sent by the controller to the stack when the HAL or the controller encounters a fatal error and needs to restart Bluetooth.
  • LMP/LL message trace: The controller sends the LMP/LL message handshaking with the remote device to the host.
  • Bluetooth Multi-profile/Coex scheduling trace: The controller sends its scheduling information on handling multiple Bluetooth profiles and wireless coexistence in the 2.4 Ghz band to the host.
  • Controller Debug Information mechanism: When enabled, the controller can autonomously report debug logging information through the Controller debug info sub-event to the host.

OCF: 0x15E

Command parameter Size Purpose
BQR_Report_Action 1 octet Action to add / delete reporting of quality event(s) set in BQR_Quality_Event_Mask parameter, or clear all.

0x00 - Add
0x01 - Delete
0x02 - Clear

Delete will clear specific quality event(s) reporting.
Clear will clear all quality events reporting (BQR_Quality_Event_Mask parameter can be ignored).

BQR_Quality_Event_Mask 4 octets Bit masks for the selected quality event reporting.

Bit 0: Set to enable quality monitoring mode.
Bit 1: Set to enable Approaching LSTO event (for ACL/(e)SCO/ISO).
Bit 2: Set to enable A2DP Audio Choppy event.
Bit 3: Set to enable (e)SCO Voice Choppy event.
Bit 4: Set to enable Root inflammation event.
Bit 5: Set to enable energy monitoring mode.
Bit 6: Set to enable LE audio choppy event.
Bit 7: Set to enable connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Set to enable vendor-specific quality events.
Bit 16: Set to enable LMP/LL message trace.
Bit 17: Set to enable Bluetooth Multi-link/Coex scheduling trace.
Bit 18: Set to enable the Controller Debug Information mechanism.
Bit 19 ~ 30: Reserved.
Bit 31: Set to enable vendor-specific trace.

BQR_Minimum_Report_Interval 2 octets Define the minimum time interval of quality event reporting for the selected quality event(s). The controller Firmware should not report the next event within the defined time interval. The interval setting shall be respective and dedicated for the quality event(s) which are being added.

Unit: ms
Default: 0 (No limitation for the interval.)
Range: 0 ~ 65535 ms

BQR_Vendor_Specific_Quality_Event_Mask 4 octets Bit masks for the selected vendor-specific quality event reporting.
This parameter is valid only when bit 15 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

BQR_Vendor_Specific_Trace_Mask 4 octets Bit masks for the selected vendor-specific trace reporting.
This parameter is valid only when bit 31 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Current_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Bit 0: Quality monitoring mode is enabled.
Bit 1: Approaching LSTO event reporting is enabled.
Bit 2: A2DP Audio Choppy event reporting is enabled.
Bit 3: (e)SCO Voice Choppy event reporting is enabled.
Bit 4: Root inflammation event reporting is enabled.
Bit 5: Energy monitoring mode is enabled.
Bit 6: LE audio choppy event reporting is enabled.
Bit 7: Connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Vendor-specific quality event reporting is enabled.
Bit 16: LMP/LL message trace is enabled.
Bit 17: Bluetooth Multi-link/Coex scheduling trace is enabled.
Bit 18: Controller Debug Information mechanism is enabled.
Bit 19 ~ 30: Reserved.
Bit 31: Vendor-specific trace is enabled.
Current_Vendor_Specific_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Current_Vendor_Specific_Trace_Mask 4 octets Indicates current bit mask setting.

Dynamic Audio Buffer command

The Dynamic Audio Buffer reduces audio glitching by changing the audio buffer size in the Bluetooth controller based on various scenarios.

OCF: 0x15F

Get audio buffer time capability

Sub OCF: 0x01

Use this command to get the audio buffer time capability from the Bluetooth controller.

Command parameter Size Purpose
N / A Empty Command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x01 - Get audio buffer time
Audio_Codec_Type_Supported 4 octets Bit masks for the supported codec types
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved
Audio_Codec_Buffer_Default_Time_For_Bit_0 2 octets Default buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_0 2 octets Maximum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_0 2 octets Minimum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Default_Time_For_Bit_1 2 octets Default buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_1 2 octets Maximum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_1 2 octets Minimum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
...... ...... ......
Audio_Codec_Buffer_Default_Time_For_Bit_31 2 octets Default buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_31 2 octets Maximum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_31 2 octets Minimum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms

Set audio buffer time

Sub OCF: 0x02

Use this command to set the audio buffer time to the Bluetooth controller.

Command parameter Size Purpose
Audio_Codec_Buffer_Time 2 octets Requested audio buffer time for the current used codec.
Unit: ms

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x02 - Set audio buffer time
Audio_Codec_Buffer_Time 2 octets Current audio buffer time in the Bluetooth controller.
Unit: ms

HCI event (vendor-specific)

Vendor-specific HCI events are required in some cases. Refer to Figure 5.4 on page 1897 of the BT Core 5.2 Specification. Event parameter 0 will always contain the first sub-event code, based on which the rest of the HCI event is decoded.

Event Parameter Size Purpose
HCI_vendor_specific_event_code 1 octet 0xFF
sub_event_code 1 octet A sub-event code will be 1 octet in size, the byte immediately following Parameter Length in the HCI event packet.

Storage threshold breach sub-event

This event indicates that the storage threshold has been breached.

Sub-event code = 0x54

Sub-event Parameter Size Purpose
None

LE multi-advertising state change sub-event

This event indicates that an advertising instance has changed its state. At this time, this event is only used to indicate which advertising instance was stopped as a result of a connection.

Sub-event code = 0x55

Sub-event parameter Size Purpose
Advertising_instance 1 octet Identifies the specific advertising instance
Valid values are 0 through max_advt_instances -1
State_Change_Reason 1 octet 0x00: Connection received
Connection_handle 2 octets Identifies the connection that caused the advt instance to be disabled (0xFFFF if invalid)

LE advertisement tracking sub-event

This event indicates when an advertiser is found or lost.

Sub event code = 0x56

Sub-event Parameter Size Purpose
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
Advertiser_State 1 octet 0x00: Advertiser found
0x01: Advertiser lost
Advt_Info_Present 1 octet 0x00: Advertiser information ( Advt_Info ) present
0x01: Advertiser information ( Advt_Info ) not present
Advertiser_Address 6 octets Public or random address
Advertiser_Address_Type 1 octet 0x00: Public address
0x01: Random address
Advt_Info Tx_Pwr[0] : 1 octet
RSSI[0] : 1 octet
Timestamp[0] : 2 octets
Adv packet_len[0] : 1 octet
Adv_packet[0] : Adv_packet_len octets
Scan_data_resp_len[0] : 1 octet
Scan_data_resp[0] : Scan_data_resp octets

Controller debug info sub-event

This event is used by a Controller to provide binary debug information to a host.

Sub-event code = 0x57

Sub-event Parameter Size Purpose
debug_block_byte_offset_start 2 octets Debug block byte offset from the start
last_block 1 octet 0x00: More debug data present
0x01: Last binary block; no more debug data
cur_pay_load_sz 2 octets Binary block size in a current event
Debug_Data Variable Debug data of cur_payload_sz

Bluetooth Quality Report sub-event

This event indicates one of the following: a Bluetooth quality event occurred, the controller uploaded the LMP/LL message trace and Bluetooth Multi-link/Coex scheduling trace, or the controller dumped debug information data.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x01: Quality reporting on the monitoring mode.
0x02: Approaching LSTO.
0x03: A2DP Audio Choppy.
0x04: (e)SCO Voice Choppy.
0x05 ~ 0x06: Reserved.
0x07: LE audio choppy.
0x08: Connect fail.
0x09 ~ 0xFF: Reserved.
Packet_Types 1 octet 0x01: ID
0x02: NULL
0x03: POLL
0x04: FHS
0x05: HV1
0x06: HV2
0x07: HV3
0x08: DV
0x09: EV3
0x0A: EV4
0x0B: EV5
0x0C: 2-EV3
0x0D: 2-EV5
0x0E: 3-EV3
0x0F: 3-EV5
0x11: DH1
0x12: DM3
0x13: DH3
0x14: DM5
0x15: DH5
0x16: AUX1
0x17: 2-DH1
0x18: 2-DH3
0x19: 2-DH5
0x1A: 3-DH1
0x1B: 3-DH3
0x1C: 3-DH5
0x1D ~ 0x50: Reserved
0x51: ISO packet
0x52 ~ 0xFF: Reserved
Connection_Handle 2 octets ACL/(e)SCO/ISO connection handle.
Connection_Role 1 octet Performing Role for the connection.
0x00: Central
0x01: Peripheral
0x02 ~ 0xFF: Reserved.
TX_Power_Level 1 octet Current transmit power level for the specified Connection_Handle.

This value shall be the same as the controller's responding to the HCI_Read_Transmit_Power_Level HCI command.

RSSI 1 octet [in dBm]

Received Signal Strength Indication (RSSI) value for the specified Connection_Handle.
This value shall be an absolute receiver signal strength value.
Range: -127 to +20

SNR 1 octet [in dB]

Signal-to-Noise Ratio (SNR) value for the specified Connection_Handle.
The controller shall provide the average SNR of all the channels used by the link.

Unused_AFH_Channel_Count 1 octet Indicates the number of unused channels in AFH_channel_map.
0x4F ~ 0xFF: Reserved.
AFH_Select_Unideal_Channel_Count 1 octet Indicates the number of the channels which are interfered and have bad quality, but they are still selected for AFH.
The minimum number of channels allowed by the Bluetooth specification is 20, so even if all 79 channels are interfered and have bad quality, the controller still needs to choose at least 20 channels for AFH.
LSTO 2 octets Current Link Supervision Timeout Setting.
Time = N * 0.625 ms
Time Range: 0.625 ms to 40.9 s
Connection_Piconet_Clock 4 octets Piconet Clock for the specified Connection_Handle.
This value shall be the same as the controller's responding to HCI_Read_Clock HCI command with parameter "Which_Clock" of 0x01 (Piconet Clock).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Retransmission_Count 4 octets The number of retransmissions since the last event.
This count shall be reset after reporting to the host.
No_RX_Count 4 octets No RX count since the last event.
The count increases when no packet is received at the scheduled time slot or the received packet is corrupted.
This count shall be reset after reporting to the host.
NAK_Count 4 octets NAK (Negative Acknowledge) count since the last event.
This count shall be reset after reporting to the host.
Last_TX_ACK_Timestamp 4 octets Timestamp of last TX ACK. It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Flow_Off_Count 4 octets The number of times the controller receives Flow-off (STOP) since the last event.
This count shall be reset after reporting to the host.
Last_Flow_On_Timestamp 4 octets Timestamp of last Flow-on (GO). It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Buffer_Overflow_Bytes 4 octets [in Byte]

Buffer overflow count since the last event.
The controller counts how many bytes of data are dropped.
This count shall be reset after reporting to host.

Buffer_Underflow_Bytes 4 octets [in Byte]

Buffer underflow count since the last event.
This count shall be reset after reporting to host.

bdaddr 6 octets Remote device address
cal_failed_item_count 1 octet The count of calibration failed items
TX_Total_Packets 4 octets The number of packets that are sent out.
TX_UnAcked_Packets 4 octets The number of packets that don't receive an acknowledgment.
This count is reset after reporting to the host.
TX_Flushed_Packets 4 octets The number of packets that aren't sent out by its flush point.
This count is reset after reporting to the host.
TX_Last_Subevent_Packets 4 octets The number of packets that Link Layer transmits a CIS data PDU in the last subevent of a CIS event.
This count is reset after reporting to the host.
The value is zero if there's no valid value for the link.
CRC_Error_Packets 4 octets The number of received packages with CRC error since the last event.
This count is reset after reporting to the host.
RX_Duplicate_Packets 4 octets The number of duplicate (retransmission) packages received since the last event.
This count is reset after reporting to the host.
Vendor Specific Parameter (parameter total length - TBD) * octets For the controller vendor to obtain more vendor specific parameters.

Sub-event code = 0x58 [Quality_Report_Id = 0x05, Root Inflammation event]

This event indicates that Bluetooth HAL or the controller encountered a fatal error and needs Bluetooth stack to record this situation and restart. The controller must send a Root_Inflammation_Event to Bluetooth stack before sending the first fragment of the debug info events in any case.

The Error_Code parameter contains an error code reported from HAL/Controller, 0 if it is a chipset vendor specific error. The Vendor_Specific_Error_Code contains a chipset vendor specific error code from HAL/Controller. It should set as 0 if the parameter Error_Code is not 0. The parameters Error_Code and Vendor_Specific_Error_Code should not both be 0.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x04: Reserved.
0x05: Root inflammation.
0x06 ~ 0xFF: Reserved.
Error_Code 1 octet 0x00: Chipset vendor specific error code is included.
0x01 ~ 0xFF: Controller failure occurred. See Bluetooth Spec [Vol 2] Part D, Error Codes for a list of error codes and descriptions.
Vendor_Specific_Error_Code 1 octet 0x00: No chipset vendor specific error code is included.
0x01 ~ 0xFF: Chipset vendor specific error code.
Vendor Specific Parameter (Parameter Total Length - 4) * octets For the controller vendor to obtain more vendor specific parameters.
Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x10: Reserved.
0x11: LMP/LL message trace.
0x12: Bluetooth Multi-link/Coex scheduling trace.
0x13: Controller Debug Information data dump.
0x14 ~ 0xFF: Reserved.
Connection_Handle 2 octets Connection Handle.
Vendor Specific Parameter (Parameter Total Length - 4) * octets Vendor Specific format of LMP message trace, Bluetooth Multi-link/Coex scheduling trace and Controller Debug Information data dump.

Multi-advertiser support

The objectives of multi-advertiser support are the following:

  • Ability to support multiple advertisements ( max_advt_instances )
  • Different transmit powers to allow for a varying range
  • Different advertising content
  • An individualized response for each advertiser
  • Privacy (non-trackable) for each advertiser
  • Connectable

To keep this specification close to existing standards, the following vendor-specific commands are provided. They are derived from the Bluetooth Core 4.1 Specification.

LE_Multi_Advt_Command

OCF: 0x154

Command parameter Size Purpose
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Sub_Cmd
0x02 - Set_Advt_Data_Multi_Sub_Cmd
0x03 - Set_Scan_Resp_Data_Multi_Sub_Cmd
0x04 - Set_Random_Addr_Multi_Sub_Cmd
0x05 - Set_Advt_Enable_Multi_Sub_Cmd

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Command
0x02 - Set_Advt_Data_Multi_Command
0x03 - Set_Scan_Resp_Data_Multi_Command
0x04 - Set_Random_Addr_Multi_Command
0x05 - Set_Advt_Enable_Multi_Command

LE_Multi_Advt_Command: Set_Advt_Param_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 964 (LE Set Advertising Parameter Command)

Sub OCF: 0x01

Sub-command parameter Size Purpose
Advertising_Interval_Min Per spec Per spec
Advertising_Interval_Max Per spec Per spec
Advertising_Type Per spec Per spec
Own_Address_Type Per spec Per spec
Own_Address Per spec Per spec
Direct_Address_Type Per spec Per spec
Direct_Address Per spec Per spec
Advertising_Channel_Map Per spec Per spec
Adverstising_Filter_Policy Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance
Tx_power 1 octet Transmit_Power
Unit - in dBm (signed integer)
Range (-70 to +20)

The Own_Address parameter could be a host-configured address at the time of setting up this multi-advertisement instance. This provides the ability to have a resolvable private address at the time of the transmit of the first beacon. Advertisement on an instance will continue irrespective of the connection. The host BT stack could issue a command to start advertisement on an instance, post connection.

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success (invalid parameter) code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 [ Set_Advt_Param_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 969 (LE Set Advertising Data Command)

Sub OCF: 0x02

Sub-command parameter Size Purpose
Advertising_Data_Length Per spec Per spec
Advertising_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x02 [ Set_Advt_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Scan_Resp_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 970 (LE Set Scan Response Data Command)

Sub OCF: 0x03

Sub-command parameter Size Purpose
Scan_Response_Data_Length Per spec Per spec
Scan_Response_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code (invalid parameter) if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x03 [ Set_Scan_Resp_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Random_Addr_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 963 (LE Set Random Address Command)

Sub OCF: 0x04

Sub-command parameter Size Purpose
Random Address Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x04 [ Set_Random_Addr_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Enable_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 971 (LE Set Advertise Enable Command in that core specification)

OCF: 0x05

Sub-command parameter Size Purpose
Advertising_Enable 1 octet A value of 1 means enable. Any other value means disable.
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance. Instance 0 means a standard HCI instance.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x05 [ Set_Advt_Enable_Multi_Sub_Cmd]

Offloaded resolution of private address

This feature resolves a private address in the controller firmware or hardware, which provides the following benefits:

  • Latency involved with the host in resolving a private address
  • Saving power by refraining from waking up the host

LE_Set_RPA_Timeout

OCF: 0x15C

Command parameter Size Purpose
LE_local_IRK 16 octet The local device IRK used to generate the random resolvable address(es).
tRPA_min 2 octets The minimum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or after this timeout.
Valid range: 300-1800
tRPA_max 2 octets The maximum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or before this timeout.
Valid range: tRPA_min -1800
Return parameter Size Purpose
Status 1 octet The status of the command.

Suggested HCI status values:
0x00 Success
0x01 Unknown command (if not supported)
0x12 Invalid command parameters (if any parameters are outside the given range)

LE_RPA_offload_Command

OCF: 0x155

Command parameter Size Purpose
RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

LE_RPA_offload: Enable_cust_specific_sub_Command

Sub OCF: 0x01

Sub-command parameter Size Purpose
enable_customer_specific_feature_set 1 octet 0x01 - Enable offloaded RPA feature
0x00 - Disable offloaded RPA feature

RPA offload is required to be enabled by the host, based on the chip capability. Refer to the LE_Get_Vendor_Capabilities_Command . Each chip can have a varying max_irk_list_sz in the firmware.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x01 [Enable customer-specific feature]

LE_RPA_offload: Add_IRK_to_list_sub_Command

Sub OCF: 0x02

Sub-command parameter Size Purpose
LE_IRK 16 octets LE IRK (1st byte LSB)
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK (1st byte LSB)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x02 [Add IRK to the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Remove_IRK_to_list_sub_Command

Sub OCF: 0x03

Sub-command parameter Size Purpose
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address that associates to the IRK

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x03 [Remove IRK from the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Clear_IRK_list_sub_Command

Sub OCF: 0x04

Sub-command parameter Size Purpose
None

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x04 [Clear IRK List]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation [ max_irk_list_sz]

LE_RPA_offload: Read_IRK_list_sub_Command

Sub OCF: 0x05

Sub-command parameter Size Purpose
LE_read_IRK_list_entry-index 1 octet Index of the IRK list [0, max_irk_list_sz-1]

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x05 [Read IRK List Entry]
LE_Read_IRK_List_entry 1 octet Index of the IRK that the host wants to read back (maximum IRK list size is 32)
LE_IRK 16 octets IRK value
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK
LE_Resolved_Private_Address 6 octets Current resolved resolvable private address of this IRK
,

The Host Controller Interface (HCI) is used for interacting with a Bluetooth controller.

This document provides a list of Bluetooth (BT) and Bluetooth Low Energy (BLE) HCI requirements. The aim is for Host BT stack vendors and BT controller vendors to conform to these platform requirements in order to use the feature set described below.

This document refers to the Bluetooth Core 5.2 Specification as the "spec." The Bluetooth Core 5.2 Specification is available on the Bluetooth SIG website along with other adopted documents.

General design overview

Chip capabilities and configuration

As an open platform, Android has a matrix of software releases, OEMs, vendors, and platform and chip capabilities.

To manage the varying landscape and to manage migrations, a design philosophy of allowing BT controllers to expose their capabilities (beyond the standard Bluetooth Core 5.2 Specification) is described in this document. The host BT stack can then use these capabilities to determine which features to enable.

Supporting open standards

One goal of Android is to support open standards after ratification in a Bluetooth specification. If a feature described below becomes available in standard HCI methods in a future Bluetooth specification, we will lean towards making that approach the default.

Vendor-specific capabilities

Vendor-specific command: LE_Get_Vendor_Capabilities_Command

OpCode Command Field (OCF): 0x153

Command parameter Size Purpose
NA Empty Command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
max_advt_instances
(Deprecated)
1 octet Number of advertisement instances supported.

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the LE Extended Advertising available in the BT spec version 5.0 and higher.
offloaded_resolution_of_private-address
(Deprecated)
1 octet BT chip capability of RPA.
If supported by a chip, it needs enablement by the host.
0 = Not capable
1 = Capable

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the Privacy feature available in the BT spec version 4.2 and higher.
total_scan_results_storage 2 octets Storage for scan results in bytes
max_irk_list_sz 1 octet Number of IRK entries supported in the firmware
filtering_support 1 octet Support for filtering in the controller
0 = Not supported
1 = Supported
max_filter 1 octet Number of filters supported
activity_energy_info_support 1 octet Supports reporting of activity and energy information
0 = Not capable
1 = Capable
version_supported 2 octets Specifies the version of the Google feature spec supported
byte[0] = Major number
byte[1] = Minor number

v1.03
byte[0] = 0x01
byte[1] = 0x03
total_num_of_advt_tracked 2 octets Total number of advertisers tracked for OnLost / OnFound purposes
extended_scan_support 1 octet Supports extended scan window and interval
debug_logging_supported 1 octet Supports logging of binary debug information from controller
LE_address_generation_offloading_support
(Deprecated)
1 octet 0 = Not supported
1 = Supported

Reserved after v0.98.
This parameter is deprecated in the Google feature spec v0.98 and higher in favor of the Privacy feature available in the BT spec version 4.2 and higher.
A2DP_source_offload_capability_mask 4 Octets Bit masks for codec types supported
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved
bluetooth_quality_report_support 1 octet Supports reporting of Bluetooth Quality events
0 = Not capable
1 = Capable
dynamic_audio_buffer_support 4 octets Supports dynamic audio buffer in the Bluetooth controller
Bit masks for codec types supported
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved

Batching of scan results

A design goal is to enhance how the Bluetooth LE Scan Response event notifications are delivered to the host, in order to save power in the host.

By reducing how often the controller notifies the host application processor to scan results, the host application processor can stay in idle/sleep longer. This reduces power consumption in the host. The return parameter total_scan_results_storage of LE_Get_Vendor_Capabilities_Command indicates the chip capability for storage of scan results.

This feature focuses on the management and configuration of the LE Scan Results storage facility in the Bluetooth controller. The storage is used to temporarily batch advertisement data and scan data and metadata that are received by the controller for later delivery to the host.

Firmware shall support two types of batching, which can be engaged simultaneously:

  • Truncated. Contains the following information elements: {MAC, TX Power, RSSI, Timestamp}
  • Full. Contains the following information elements: {MAC, TX Power, RSSI, Timestamp, Adv Data, Scan Response}

LE_Batch_Scan_Command

OCF: 0x156

Command parameter Size Purpose
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

A Command Complete event will be generated for this command. Enabling the customer-specific feature does not start the scan.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

LE_Batch_Scan_Command: Enable Customer Specific feature

Sub OCF: 0x01

Sub-command parameter Size Purpose
enable_customer_specific_feature_set 1 octet 0x01 - Enable Batch Scan feature
0x00 - Disable Batch Scan feature

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_Scan_opcode 1 octet 0x1 - Enable customer-specific feature
0x2 - Set Batch Scan Storage parameters
0x3 - Set Batch Scan parameters
0x4 - Read Batch Scan Result parameters

LE_Batch_Scan_Command: Set Batch Scan Storage Param subcommand

Sub OCF: 0x02

Sub-command parameter Size Purpose
Batch_Scan_Full_Max 1 octet Max storage space (in %) allocated to full style
[Range: 0-100]
Batch_Scan_Truncated_Max 1 octet Max storage space (in %) allocated to truncated style
[Range: 0-100]
Batch_Scan_Notify_Threshold 1 octet Setup notification level (in %) for individual storage pool
[Range: 0-100]
Setting to 0 will disable notification. Vendor-specific HCI event is generated (Storage threshold breach subevent)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x02 [Set Batch Scan parameters]

LE_Batch_Scan_Command: Set Batch Scan Param subcommand

Sub OCF: 0x03

Sub-command parameter Size Purpose
Batch_Scan_Mode 1 octet 0x00 – Batch scan is disabled
0x01 – Truncated mode is enabled
0x02 – Full mode is enabled
0x03 – Truncated and Full mode are enabled
Duty_cycle_scan_window 4 octets Batch Scan scan time (# of slot)
Duty_cyle_scan_interval 4 octets Batch Scan interval period (# of slot)
own_address_type 1 octet 0x00 - Public device address
0x01 - Random device address
Batch_scan_Discard_Rule 1 octet 0 - Discard oldest advertisement
1 - Discard advertisement with weakest RSSI

This sub-command will start batch scanning, if enabled. In Truncated scanning, results are stored in truncated form where the unique key for Truncated style = { BD_ADDR, scan_interval}. This means only one BD_ADDR will be recorded for each scan interval. The record to keep for Truncated mode is the following: { BD_ADDR , Tx Power, RSSI, Timestamp}

When Full mode is enabled, active scanning will be used and Scan Responses will be recorded. The Full style unique key = {MAC, Ad packet}, irrespective of scan interval. The record to keep for Full mode is { BD_ADDR , Tx Power, RSSI, Timestamp, Ad packet, Scan Response}. In Full style, the same AD packet, when seen multiple times across different scan intervals, is recorded only once. However, in Truncated mode, it is the visibility of BA_ADDR across different scan intervals that is of interest (once per scan interval). The RSSI is the averaged value of all duplicates of a unique advertisement within a scan interval.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x03 [Set Batch Scan Parameters]

LE_Batch_Scan_Command: Read Batch Scan Results sub-command

Sub OCF: 0x04

Sub-command parameter Size Purpose
Batch_Scan_Data_read 1 octet 0x01 – Truncated mode data
0x02 – Full mode data

A Command Complete event will be generated for this command. When the host issues this command, all the results in the controller may not fit in one Command Complete event. The host will iterate issuing this command until the corresponding results in the Command Complete event indicate 0 in the number of records, which indicates the controller has no more records to communicate to the host. Each Command Complete event could contain multiple records of only one type of data (Full or Truncated).

Controller and host time references are not synchronized. The unit of the timestamp is 50ms. The value of the timestamp is based off when the Read_Batch_Scan_Results_Sub_cmd is given by the host. If a command arrival time is T_c in the firmware, then the actual time the timestamp was taken in the firmware is T_fw . The reporting time will be: ( T_c - T_fw ). T_c and T_fw are in the firmware time domain. This lets the host compute how long ago the event happened.

Return parameter Size Purpose
Status 1 octet Command Complete status
Batch_scan_opcode 1 octet 0x03 [Set Batch Scan parameters]
Batch_Scan_data_read 1 octet Identifies the format (Truncated or Full)
num_of_records 1 octet Number of records of Batch_Scan_data_read
format_of_data Variable Truncated Mode:
Address[0]: 6 octets
Address_Type[0]: 1 octet
Tx_Pwr[0]: 1 octet
RSSI[0] : 1 octet
Timestamp[0]: 2 octets
[multiple records ( num_of_records ) with above format]

Full Mode:
Address[0]: 6 octets
Address_Type[0]: 1 octet
Tx_Pwr[0]: 1 octet
RSSI[0]: 1 octet
Timestamp[0]: 2 octets
Adv packet_len[0]: 1 octet
Adv_packet[0]: Adv_packet_len octets
Scan_data_resp_len[0]: 1 octet
Scan_data_resp[0]: Scan_data_resp octets
[multiple records with above format ( num_of_records )]

Advertising Packet Content Filter

Use this to enable/disable/setup the Advertising Packet Content Filter (APCF) in the controller. APCF filters advertising reports in the controller but doesn't filter periodic advertising.

LE_APCF_Command

OCF: 0x157

Command parameter Size Purpose
APCF_opcode 1 octet 0x00 - APCF Enable
0x01 - APCF Set Filtering parameters
0x02 - APCF Broadcaster Address
0x03 - APCF Service UUID
0x04 - APCF Service Solicitation UUID
0x05 - APCF Local Name
0x06 - APCF Manufacturer Data
0x07 - APCF Service Data
0x08 - APCF Transport Discovery Service
0x09 - APCF AD Type Filter
0x10 ~ 0xAF - Reserved for future use
0xB0 ~ 0xDF - Reserved for vendor
0xE0 ~ 0xFE - Reserved for future use
0xFF - APCF Read extended Features

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Return status
APCF_opcode 1 octet 0x00 - APCF Enable
0x01 - APCF Set Filtering parameters
0x02 - APCF Broadcaster Address
0x03 - APCF Service UUID
0x04 - APCF Service Solicitation UUID
0x05 - APCF Local Name
0x06 - APCF Manufacturer Data
0x07 - APCF Service Data
0x08 - APCF Transport Discovery Service
0x09 - APCF AD Type Filter
0x10 ~ 0xAF - Reserved for future use
0xB0 ~ 0xDF - Reserved for vendor
0xE0 ~ 0xFE - Reserved for future use
0xFF - APCF Read extended Features

LE_APCF_Command: Enable_sub_cmd

Sub OCF: 0x00

Sub-command parameter Size Purpose
APCF_enable 1 octet 0x01 - Enable APCF feature
0x00 - Disable APCF feature

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x0 - APCF Enable
APCF_Enable 1 octet Enable/disable is set via APCF_enable

LE_APCF_Command: set_filtering_parameters_sub_cmd

This subcommand is used to add or delete a filter specification or clear a filter list for on-chip filtering.

Sub OCF: 0x01

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will clear the specific filter along with associated feature entries in other tables.
Clear will clear all the filters and associated entries in other tables.
APCF_Filter_Index 1 octet Filter index (0, max_filter-1 )
APCF_Feature_Selection 2 octets Bit masks for the selected features:
Bit 0: Set to enable Broadcast Address filter
Bit 1: Set to enable Service Data Change filter
Bit 2: Set to enable Service UUID check
Bit 3: Set to enable Service Solicitation UUID check
Bit 4: Set to enable Local Name check
Bit 5: Set to enable Manufacturer Data Check
Bit 6: Set to enable Service Data Check
Bit 7: Set to enable Transport Discovery Service Check
Bit 8: Set to enable AD Type Check
APCF_List_Logic_Type 2 octets Logic operation for each feature selection (per-bit position) specified in APCF_Feature_Selection .
Valid only when a feature is enabled.
Bit position value:
0: OR
1: AND
If "AND" logic is selected, an ADV packet will pass the filter only if it contains ALL of the entries in the list.
If "OR" logic is selected, an ADV packet will pass the filter if it contains any of the entries in the list.
APCF_Filter_Logic_Type 1 octet 0x00: OR
0x01: AND
Note: The logic type is N/A for the first three fields of APCF_Feature_Selection , which is always "AND" logic. They are only applicable for (Bit 3 - Bit 6) four fields of APCF_Feature_Selection .
rssi_high_thresh 1 octet [in dBm]
The advertiser is considered seen only if the signal is higher than the RSSI high threshold. Otherwise, the firmware must behave as if it never saw it.
delivery_mode 1 octet 0x00 - immediate
0x01 - on_found
0x02 - batched
onfound_timeout 2 octets Valid only if delivery_mode is on_found .
[in milliseconds]
Time for firmware to linger and collect additional advertisements before reporting.
onfound_timeout_cnt 1 octet Valid only if delivery_mode is on_found .
[count]
If an advertisement in onFound lingers in firmware for the onfound_timeout duration, it will collect a few advertisements and the count is checked. If the count exceeds onfound_timeout_cnt , it's reported OnFound immediately thereafter.
rssi_low_thresh 1 octet Valid only if delivery_mode is on_found .
[in dBm]
The advertiser packet is considered as not seen if the RSSI of the received packet is not above the RSSI low threshold.
onlost_timeout 2 octets Valid only if delivery_mode is on_found .
[in milliseconds]
If an advertisement, after being found, is not seen contiguously for the lost_timeout period, it will immediately be reported lost.
num_of_tracking_entries 2 octets Valid only if delivery_mode is on_found .
[count]
Total number of advertisers to track per filter.

RSSI values must use 2's complement to represent negative values.

Host shall be able to configure multiple filters with APCF_Application_Address_type set to 0x02 (for all broadcaster addresses) to manage various filter combinations.

Filtering, batching and reporting are inter-related concepts. Every advertisement and related scan response will have to go through all the filters, one after the other. Thus, resulting actions ( delivery_mode ) are closely tied to filtering. The delivery modes are the following: report_immediately , batch , and onFound . The OnLost value is related to OnFound in the sense that it will come after OnFound when lost.

This processing flow depicts the conceptual model:

When an advertisement (or scan response) frame is received, it is applied to all the filters in serial order. It's possible that an advertisement can cause immediate reporting based on one filter and batching of the same due to a different filter action.

RSSI level thresholds (high and low) give the ability to control when the frame is visible for filter processing, even when a valid packet is received by the controller. In case of delivery mode being set to immediate or batched, the RSSI of a frame is considered for further controller processing. Different apps need different reporting and batching behavior. This allows multiple apps to have direct reporting and/or batching of results in firmware, concurrently. An example is a case when a batch scan is active from one app and later a regular LE scan is issued by another app. Before a batch scan is issued, the framework/app sets appropriate filters. Later, when the second app issues a regular scan, previous batching continues. However, due to the regular scan, it is akin to conceptually adding a null filter (along with all the existing filters) along with the LE scan command. The LE scan command parameters take precedence when active. When the regular LE scan is disabled, the controller will revert back to a previous batch scan, if it existed.

The OnFound delivery mode is based on configured filters. A combination that triggers a filter's action to succeed is considered the entity to track for onLost . The corresponding event is the LE Advt tracking subevent.

The OnFound/OnLost transition for a filter (if enabled) will look like the following:

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x01 - APCF Set Filtering Parameters
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of available entries in the filters table

LE_APCF_Command: broadcast_address_sub_cmd

This subcommand is used to add or delete an advertiser address or to clear the advertiser address list for on-chip filtering.

Sub OCF: 0x02

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified broadcaster address in the specified filter.
Clear will clear all the broadcaster addresses in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter-1 )
APCF_Broadcaster_Address 6 octet 6-byte device address to add to or delete from the broadcaster address list
APCF_Application_Address_type 1 octet 0x00: Public
0x01: Random
0x02: NA (addresses type not applicable)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x02 - APCF Broadcaster Address
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Broadcast Address table

LE_APCF_Command: service_uuid_sub_cmd

This subcommand is used to add or delete a service UUID or to clear a service UUID list for on-chip filtering.

Sub OCF: 0x03

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified service UUID address in the specified filter.
Clear will clear all the service UUIDs in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_UUID 2,4,16 octet The Service UUID (16-bit, 32-bit, or 128-bit) for adding to, or deleting from, the list.
APCF_UUID_MASK 2,4,16 octet The Service UUID Mask (16-bit, 32-bit, or 128-bit) to add to the list. It should have the same length as APCF_UUID.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x03 - APCF Service UUID
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Service UUID table

LE_APCF_Command: solicitation_uuid_sub_cmd

This subcommand is used to add or delete a solicitation UUID or to clear a solicitation UUID list for on-chip filtering.

Sub OCF: 0x04

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the solicitation UUID address in the specified filter.
Clear will clear all the solicitation UUIDs in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_UUID 2,4,16 octet The Solicitation UUID (16-bit, 32-bit, or 128-bit) to add to or delete from the list.
APCF_UUID_MASK 2,4,16 octet The Solicitation UUID Mask (16-bit, 32-bit, or 128-bit) to add to the list. It should have the same length as the APCF_UUID .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x04 - APCF Solicitation UUID
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Solicitation UUID table

LE_APCF_Command: local_name_sub_cmd

This sub-command is used to add or delete a local name string or to clear the local name string list for on-chip filtering.

Sub OCF: 0x05

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified local name string in the specified filter.
Clear will clear all the local name strings in the specified filter.
APCF_Filter_Index 1 octet Filter index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for local name.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x05 - APCF Local Name
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Local name table

LE_APCF_Command: manf_data_sub_cmd

This subcommand is used to add or delete a manufacturer data string or to clear the manufacturer data string list for on-chip filtering.

Sub OCF: 0x06

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified manufacturer data string in the specified filter.
Clear will clear all the manufacturer data strings in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for manufacturer data.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)
APCF_ManData_Mask Variable size The manufacture data mask to add to the list. It should have the same length as APCF_LocName_or_ManData_or_SerData .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x06 - APCF Manufacturer Data
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the Manufacturer Data table

LE_APCF_Command: service_data_sub_cmd

This subcommand is used to add or delete a service data string or to clear the service data string list for on-chip filtering.

Sub OCF: 0x07

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified service data string in the specified filter.
Clear will clear all the service data strings in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_LocName_Mandata_or_SerData Variable size A character string for service data.

Notes:
  • Currently the max number of characters in a local name string is 29
  • Not applicable when action is "Clear" (0x2)
APCF_LocName_Mandata_or_SerData_Mask Variable size The service data mask to add to the list. It should have the same length as APCF_LocName_or_ManData_or_SerData.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x07 - APCF Service Data
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available for Service Data table

LE_APCF_Command: ad_type_sub_cmd

This subcommand is used to add or delete an AD type or to clear an AD type list for on-chip filtering. Use read_extended_features_sub_cmd to check if this command is supported or not.

Sub OCF: 0x09

Sub-command parameter Size Purpose
APCF_Action 1 octet 0x00 - Add
0x01 - Delete
0x02 - Clear
Delete will delete the specified AD type in the specified filter.
Clear will clear all the AD types in the specified filter.
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
APCF_AD_TYPE 1 octet The AD Type for adding to, or deleting from, the list. Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA_Length Variable size 0x00 - means do not filter data content
Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA Variable size Ignore when APCF_Action is 0x02 (Clear)
APCF_AD_DATA_MASK Variable size Ignore when APCF_Action is 0x02 (Clear)
It should have the same length as APCF_AD_DATA .

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0x09 - APCF AD Type
APCF_Action 1 octet Echo back command's APCF_Action
APCF_AvailableSpaces 1 octet Number of free entries still available in the AD Type table

LE_APCF_Command: read_extended_features_sub_cmd

This subcommand is used to read extended APCF features.

Sub OCF: 0xFF

Sub-command parameter Size Purpose
Not applicable Empty command parameter.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
APCF_opcode 1 octet 0xFF - APCF_Read_Extended_Features
APCF_extended_features 2 octet

Bit masks for extended features supported:

  • Bit 0: Support Transport Discovery Service filter
  • Bit 1: Support AD Type filter
  • Bit 2 ~15: Reserved for future use

Value of bit

  • 0 = Not supported
  • 1 = Supported

Controller activity and energy information command

The objective of this information is for higher host system functions to analyze the total activities of all components, including the BT controller and its macro state, in conjunction with what is happening in the apps and framework. To do this, the following information is required from the BT stack and the controller:

  • BT stack: Reporting the current macro-operational state of the controller
  • Firmware: Reporting aggregate activity and energy information

BT host stack macro states, as determined at the user level:

  • Idle: [page scan, LE advt, inquiry scan]
  • Scan: [paging/inquiry/trying to connect]
  • Active: [ACL link on, SCO link ongoing, sniff mode]

The activities that the controller keeps track of over its life are Tx time, Rx time, idle time, and total energy consumed. They are cleared when read from the host.

LE_Get_Controller_Activity_Energy_Info

This is a vendor-specific command.

OCF: 0x159

Sub-command parameter Size Purpose
NA Empty command params

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
total_tx_time_ms 4 octets Total time performing Tx
total_rx_time_ms 4 octets Total time performing Rx
total_idle_time_ms 4 octets Total time in idle (non-sleep low power states)
total_energy_used 4 octets Total energy used [product of current (mA), voltage (V) and time (ms)]

LE extended set scan parameters command

This command can be used to enable a larger scan window and interval in the controller. Per the BT Core 5.2 Specification, a scan window and interval have an upper bound limit of 10.24 seconds, which hampers applications' longer scan intervals beyond 10.24 seconds.

Base reference: BT Core 5.2 Specification, page 2493 (LE Set Scan Parameters Command)

OCF: 0x15A

Command Parameter Size Purpose
LE_Ex_Scan_Type 1 octet 0x00 - Passive scanning. No SCAN_REQ packets shall be sent (default).
0x01 - Active scanning. SCAN_REQ packets may be sent.
LE_Ex_Scan_Interval 4 octets Defined as the time interval from when the Controller started its last LE scan until it began the subsequent LE scan.
Range: 0x0004 to 0x00FFFFFF
Default: 0x0010 (10 ms)
Time = N * 0.625 ms
Time range: 2.5 ms to 10442.25 seconds
LE_Ex_Scan_Window 4 octets The duration of the LE scan. LE_Scan_Window shall be less than or equal to LE_Scan_Interval .
Range: 0x0004 to 0xFFFF
Default: 0x0010 (10 ms)
Time = N * 0.625 ms
Time Range: 2.5 ms to 40.95 seconds
Own_Address_Type 1 octet 0x00 - Public Device Address (default)
0x01 - Random Device Address
LE_Ex_Scan_Filter_Policy 0x00 - Accept all advertisement packets (default). Directed advertising packets which are not addressed for this device shall be ignored.
0x01 - Ignore advertisement packets from devices not in the White List Only list. Directed advertising packets which are not addressed for this device shall be ignored.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status

Get controller debug info command

The objective of this information element is to acquire controller debug information by a host, in binary form, for post-processing and analysis. This helps debug on-field issues and provides engineers with a toolkit to log information for analysis. A Controller can provide the information when requested by a host via the event (Controller Debug Info sub-event) or autonomously when desired by the controller. Example uses could be to report firmware state information, crash dump information, logging information, etc.

OCF: 0x15B

Command parameter Size Purpose
N / A Empty command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status

A2DP Hardware Offload Support

The A2DP Offload feature supports the offload of the A2DP audio encoding process to an audio processor attached to the BT Controller. The encoded audio data stream passes directly from the Audio processor to the BT Controller without the BT host's involvement. The BT Host is still responsible for the configuration and control of the A2DP session.

OCF: 0x15D

Start A2DP Offload

Sub OCF: 0x01

Use this command both to configure the A2DP Offload process and to start the A2DP stream.

Command parameter Size Purpose
Codec 4 octets Specifies Codec type
0x01 - SBC
0x02 - AAC
0x04 - APTX
0x08 - APTX HD
0x10 - LDAC
Max_Latency 2 octets Max Latency Allowed (in ms). A value of zero disables flush.
SCMS-T_Enable 2 octets Octet 0: Flag that enables addition of SCMS-T header.
  • 0x00 - SCMS-T Header not included.
  • 0x01 - SCMS-T Header included.

Octet 1: Value for the SCMS-T header, when it's enabled.

Sampling_Frequency 4 octets 0x01 - 44100 Hz
0x02 - 48000 Hz
0x04 - 88200 Hz
0x08 - 96000 Hz
Bits_Per_Sample 1 octet 0x01 - 16 bits per sample
0x02 - 24 bits per sample
0x04 - 32 bits per sample
Channel_Mode 1 octet 0x01 - Mono
0x02 - Stereo
Encoded_Audio_Bitrate 4 octets The encoded audio bitrate in bits per second second.
0x00000000 - The audio bitrate is not specified / unused.
0x00000001 - 0x00FFFFFF - Encoded audio bitrate in bits per second.
0x01000000 - 0xFFFFFFFF - Reserved.
Connection_Handle 2 octets Connection Handle of A2DP connection being configured
L2CAP_Channel_ID 2 octets L2CAP Channel ID to be used for this A2DP connection
L2CAP_MTU_Size 2 octets Maximum size of L2CAP MTU containing encoded audio packets
Codec_Information 32 octets Codec-specific Information.

SBC Codec:

Refer to SBC Codec specific information elements in A2DP v1.3.
Octet 0: Block length | Subbands | Allocation Method
Octet 1: Minimum Bitpool value
Octet 2: Maximum Bitpool value
Octet 3: Sampling Frequency | Channel Mode
Octet 4-31: reserved

AAC Codec:

Refer to AAC Codec specific information elements in A2DP v1.3
Octet 0: Object Type
Octet 1; b7: VBR
Octet 2-31: reserved

LDAC Codec:

Octet 0-3: Vendor ID
0x0000012D

Octet 4-5: Codec ID
0x00AA - LDAC
All other values are reserved

Octet 6: Bitrate Index:
0x00 - High
0x01 - Mid
0x02 - Low
0x03 - 0x7E - Reserved
0x7F - ABR (Adaptive Bit Rate)
0x80 - 0xFF - Reserved

Octet 7: LDAC Channel Mode
0x01 - Stereo
0x02 - Dual
0x04 - Mono
Others are reserved

Octet 8-31: reserved

All other codecs:

Octet 0-31: reserved

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Sub_Opcode 1 octet 0x0- Start A2DP Offload

Stop A2DP Offload

Sub OCF: 0x02

This command is used to stop the A2DP Offload stream.

Command parameter Size Purpose
N / A Empty command parameter list.

No parameters are defined for this command.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Sub_Opcode 1 octet 0x02 - Stop A2DP Offload

Bluetooth Quality Report command

The BT Quality Report command feature starts the mechanism in the Bluetooth controller to report Bluetooth Quality events to the host. You can enable four options:

  • Quality Monitoring Mode: The controller periodically sends a Link Quality related BQR sub-event to the host.
  • Approaching LSTO: If no packets are received from the connected BT device for longer than half of the Link Supervision TimeOut (LSTO) value, the controller reports an Approaching LSTO event to the host.
  • A2DP Audio Choppy: When the controller detects factors that cause choppy audio, the controller reports an A2DP Audio Choppy event to the host.
  • (e)SCO Voice Choppy: When the controller detects factors that cause choppy voice, the controller reports an (e)SCO Voice Choppy event to the host.
  • Root Inflammation: This event is sent by the controller to the stack when the HAL or the controller encounters a fatal error and needs to restart Bluetooth.
  • LMP/LL message trace: The controller sends the LMP/LL message handshaking with the remote device to the host.
  • Bluetooth Multi-profile/Coex scheduling trace: The controller sends its scheduling information on handling multiple Bluetooth profiles and wireless coexistence in the 2.4 Ghz band to the host.
  • Controller Debug Information mechanism: When enabled, the controller can autonomously report debug logging information through the Controller debug info sub-event to the host.

OCF: 0x15E

Command parameter Size Purpose
BQR_Report_Action 1 octet Action to add / delete reporting of quality event(s) set in BQR_Quality_Event_Mask parameter, or clear all.

0x00 - Add
0x01 - Delete
0x02 - Clear

Delete will clear specific quality event(s) reporting.
Clear will clear all quality events reporting (BQR_Quality_Event_Mask parameter can be ignored).

BQR_Quality_Event_Mask 4 octets Bit masks for the selected quality event reporting.

Bit 0: Set to enable quality monitoring mode.
Bit 1: Set to enable Approaching LSTO event (for ACL/(e)SCO/ISO).
Bit 2: Set to enable A2DP Audio Choppy event.
Bit 3: Set to enable (e)SCO Voice Choppy event.
Bit 4: Set to enable Root inflammation event.
Bit 5: Set to enable energy monitoring mode.
Bit 6: Set to enable LE audio choppy event.
Bit 7: Set to enable connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Set to enable vendor-specific quality events.
Bit 16: Set to enable LMP/LL message trace.
Bit 17: Set to enable Bluetooth Multi-link/Coex scheduling trace.
Bit 18: Set to enable the Controller Debug Information mechanism.
Bit 19 ~ 30: Reserved.
Bit 31: Set to enable vendor-specific trace.

BQR_Minimum_Report_Interval 2 octets Define the minimum time interval of quality event reporting for the selected quality event(s). The controller Firmware should not report the next event within the defined time interval. The interval setting shall be respective and dedicated for the quality event(s) which are being added.

Unit: ms
Default: 0 (No limitation for the interval.)
Range: 0 ~ 65535 ms

BQR_Vendor_Specific_Quality_Event_Mask 4 octets Bit masks for the selected vendor-specific quality event reporting.
This parameter is valid only when bit 15 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

BQR_Vendor_Specific_Trace_Mask 4 octets Bit masks for the selected vendor-specific trace reporting.
This parameter is valid only when bit 31 of BQR_Quality_Event_Mask is set.

Bit 0 ~ 31: Reserved.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Current_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Bit 0: Quality monitoring mode is enabled.
Bit 1: Approaching LSTO event reporting is enabled.
Bit 2: A2DP Audio Choppy event reporting is enabled.
Bit 3: (e)SCO Voice Choppy event reporting is enabled.
Bit 4: Root inflammation event reporting is enabled.
Bit 5: Energy monitoring mode is enabled.
Bit 6: LE audio choppy event reporting is enabled.
Bit 7: Connect fail event.
Bit 8 ~ 14: Reserved.
Bit 15: Vendor-specific quality event reporting is enabled.
Bit 16: LMP/LL message trace is enabled.
Bit 17: Bluetooth Multi-link/Coex scheduling trace is enabled.
Bit 18: Controller Debug Information mechanism is enabled.
Bit 19 ~ 30: Reserved.
Bit 31: Vendor-specific trace is enabled.
Current_Vendor_Specific_Quality_Event_Mask 4 octets Indicates current bit mask setting.
Current_Vendor_Specific_Trace_Mask 4 octets Indicates current bit mask setting.

Dynamic Audio Buffer command

The Dynamic Audio Buffer reduces audio glitching by changing the audio buffer size in the Bluetooth controller based on various scenarios.

OCF: 0x15F

Get audio buffer time capability

Sub OCF: 0x01

Use this command to get the audio buffer time capability from the Bluetooth controller.

Command parameter Size Purpose
N / A Empty Command parameter list

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x01 - Get audio buffer time
Audio_Codec_Type_Supported 4 octets Bit masks for the supported codec types
Bit 0 - SBC
Bit 1 - AAC
Bit 2 - APTX
Bit 3 - APTX HD
Bit 4 - LDAC
Bit 5-31 are reserved
Audio_Codec_Buffer_Default_Time_For_Bit_0 2 octets Default buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_0 2 octets Maximum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_0 2 octets Minimum buffer time of the Bit 0 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 0 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Default_Time_For_Bit_1 2 octets Default buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_1 2 octets Maximum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_1 2 octets Minimum buffer time of the Bit 1 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 1 codec type is not supported.
Unit: ms
...... ...... ......
Audio_Codec_Buffer_Default_Time_For_Bit_31 2 octets Default buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Maximum_Time_For_Bit_31 2 octets Maximum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms
Audio_Codec_Buffer_Minimum_Time_For_Bit_31 2 octets Minimum buffer time of the Bit 31 codec type specified in Audio_Codec_Type_Supported.
This value shall be 0 if the Bit 31 codec type is not supported.
Unit: ms

Set audio buffer time

Sub OCF: 0x02

Use this command to set the audio buffer time to the Bluetooth controller.

Command parameter Size Purpose
Audio_Codec_Buffer_Time 2 octets Requested audio buffer time for the current used codec.
Unit: ms

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Dynamic_Audio_Buffer_opcode 1 octet 0x02 - Set audio buffer time
Audio_Codec_Buffer_Time 2 octets Current audio buffer time in the Bluetooth controller.
Unit: ms

HCI event (vendor-specific)

Vendor-specific HCI events are required in some cases. Refer to Figure 5.4 on page 1897 of the BT Core 5.2 Specification. Event parameter 0 will always contain the first sub-event code, based on which the rest of the HCI event is decoded.

Event Parameter Size Purpose
HCI_vendor_specific_event_code 1 octet 0xFF
sub_event_code 1 octet A sub-event code will be 1 octet in size, the byte immediately following Parameter Length in the HCI event packet.

Storage threshold breach sub-event

This event indicates that the storage threshold has been breached.

Sub-event code = 0x54

Sub-event Parameter Size Purpose
None

LE multi-advertising state change sub-event

This event indicates that an advertising instance has changed its state. At this time, this event is only used to indicate which advertising instance was stopped as a result of a connection.

Sub-event code = 0x55

Sub-event parameter Size Purpose
Advertising_instance 1 octet Identifies the specific advertising instance
Valid values are 0 through max_advt_instances -1
State_Change_Reason 1 octet 0x00: Connection received
Connection_handle 2 octets Identifies the connection that caused the advt instance to be disabled (0xFFFF if invalid)

LE advertisement tracking sub-event

This event indicates when an advertiser is found or lost.

Sub event code = 0x56

Sub-event Parameter Size Purpose
APCF_Filter_Index 1 octet Filter Index (0, max_filter -1)
Advertiser_State 1 octet 0x00: Advertiser found
0x01: Advertiser lost
Advt_Info_Present 1 octet 0x00: Advertiser information ( Advt_Info ) present
0x01: Advertiser information ( Advt_Info ) not present
Advertiser_Address 6 octets Public or random address
Advertiser_Address_Type 1 octet 0x00: Public address
0x01: Random address
Advt_Info Tx_Pwr[0] : 1 octet
RSSI[0] : 1 octet
Timestamp[0] : 2 octets
Adv packet_len[0] : 1 octet
Adv_packet[0] : Adv_packet_len octets
Scan_data_resp_len[0] : 1 octet
Scan_data_resp[0] : Scan_data_resp octets

Controller debug info sub-event

This event is used by a Controller to provide binary debug information to a host.

Sub-event code = 0x57

Sub-event Parameter Size Purpose
debug_block_byte_offset_start 2 octets Debug block byte offset from the start
last_block 1 octet 0x00: More debug data present
0x01: Last binary block; no more debug data
cur_pay_load_sz 2 octets Binary block size in a current event
Debug_Data Variable Debug data of cur_payload_sz

Bluetooth Quality Report sub-event

This event indicates one of the following: a Bluetooth quality event occurred, the controller uploaded the LMP/LL message trace and Bluetooth Multi-link/Coex scheduling trace, or the controller dumped debug information data.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x01: Quality reporting on the monitoring mode.
0x02: Approaching LSTO.
0x03: A2DP Audio Choppy.
0x04: (e)SCO Voice Choppy.
0x05 ~ 0x06: Reserved.
0x07: LE audio choppy.
0x08: Connect fail.
0x09 ~ 0xFF: Reserved.
Packet_Types 1 octet 0x01: ID
0x02: NULL
0x03: POLL
0x04: FHS
0x05: HV1
0x06: HV2
0x07: HV3
0x08: DV
0x09: EV3
0x0A: EV4
0x0B: EV5
0x0C: 2-EV3
0x0D: 2-EV5
0x0E: 3-EV3
0x0F: 3-EV5
0x11: DH1
0x12: DM3
0x13: DH3
0x14: DM5
0x15: DH5
0x16: AUX1
0x17: 2-DH1
0x18: 2-DH3
0x19: 2-DH5
0x1A: 3-DH1
0x1B: 3-DH3
0x1C: 3-DH5
0x1D ~ 0x50: Reserved
0x51: ISO packet
0x52 ~ 0xFF: Reserved
Connection_Handle 2 octets ACL/(e)SCO/ISO connection handle.
Connection_Role 1 octet Performing Role for the connection.
0x00: Central
0x01: Peripheral
0x02 ~ 0xFF: Reserved.
TX_Power_Level 1 octet Current transmit power level for the specified Connection_Handle.

This value shall be the same as the controller's responding to the HCI_Read_Transmit_Power_Level HCI command.

RSSI 1 octet [in dBm]

Received Signal Strength Indication (RSSI) value for the specified Connection_Handle.
This value shall be an absolute receiver signal strength value.
Range: -127 to +20

SNR 1 octet [in dB]

Signal-to-Noise Ratio (SNR) value for the specified Connection_Handle.
The controller shall provide the average SNR of all the channels used by the link.

Unused_AFH_Channel_Count 1 octet Indicates the number of unused channels in AFH_channel_map.
0x4F ~ 0xFF: Reserved.
AFH_Select_Unideal_Channel_Count 1 octet Indicates the number of the channels which are interfered and have bad quality, but they are still selected for AFH.
The minimum number of channels allowed by the Bluetooth specification is 20, so even if all 79 channels are interfered and have bad quality, the controller still needs to choose at least 20 channels for AFH.
LSTO 2 octets Current Link Supervision Timeout Setting.
Time = N * 0.625 ms
Time Range: 0.625 ms to 40.9 s
Connection_Piconet_Clock 4 octets Piconet Clock for the specified Connection_Handle.
This value shall be the same as the controller's responding to HCI_Read_Clock HCI command with parameter "Which_Clock" of 0x01 (Piconet Clock).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Retransmission_Count 4 octets The number of retransmissions since the last event.
This count shall be reset after reporting to the host.
No_RX_Count 4 octets No RX count since the last event.
The count increases when no packet is received at the scheduled time slot or the received packet is corrupted.
This count shall be reset after reporting to the host.
NAK_Count 4 octets NAK (Negative Acknowledge) count since the last event.
This count shall be reset after reporting to the host.
Last_TX_ACK_Timestamp 4 octets Timestamp of last TX ACK. It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Flow_Off_Count 4 octets The number of times the controller receives Flow-off (STOP) since the last event.
This count shall be reset after reporting to the host.
Last_Flow_On_Timestamp 4 octets Timestamp of last Flow-on (GO). It is based on the Bluetooth Clock of the piconet central (CLK).
Unit: N * 0.3125 ms (1 Bluetooth Clock)
Buffer_Overflow_Bytes 4 octets [in Byte]

Buffer overflow count since the last event.
The controller counts how many bytes of data are dropped.
This count shall be reset after reporting to host.

Buffer_Underflow_Bytes 4 octets [in Byte]

Buffer underflow count since the last event.
This count shall be reset after reporting to host.

bdaddr 6 octets Remote device address
cal_failed_item_count 1 octet The count of calibration failed items
TX_Total_Packets 4 octets The number of packets that are sent out.
TX_UnAcked_Packets 4 octets The number of packets that don't receive an acknowledgment.
This count is reset after reporting to the host.
TX_Flushed_Packets 4 octets The number of packets that aren't sent out by its flush point.
This count is reset after reporting to the host.
TX_Last_Subevent_Packets 4 octets The number of packets that Link Layer transmits a CIS data PDU in the last subevent of a CIS event.
This count is reset after reporting to the host.
The value is zero if there's no valid value for the link.
CRC_Error_Packets 4 octets The number of received packages with CRC error since the last event.
This count is reset after reporting to the host.
RX_Duplicate_Packets 4 octets The number of duplicate (retransmission) packages received since the last event.
This count is reset after reporting to the host.
Vendor Specific Parameter (parameter total length - TBD) * octets For the controller vendor to obtain more vendor specific parameters.

Sub-event code = 0x58 [Quality_Report_Id = 0x05, Root Inflammation event]

This event indicates that Bluetooth HAL or the controller encountered a fatal error and needs Bluetooth stack to record this situation and restart. The controller must send a Root_Inflammation_Event to Bluetooth stack before sending the first fragment of the debug info events in any case.

The Error_Code parameter contains an error code reported from HAL/Controller, 0 if it is a chipset vendor specific error. The Vendor_Specific_Error_Code contains a chipset vendor specific error code from HAL/Controller. It should set as 0 if the parameter Error_Code is not 0. The parameters Error_Code and Vendor_Specific_Error_Code should not both be 0.

Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x04: Reserved.
0x05: Root inflammation.
0x06 ~ 0xFF: Reserved.
Error_Code 1 octet 0x00: Chipset vendor specific error code is included.
0x01 ~ 0xFF: Controller failure occurred. See Bluetooth Spec [Vol 2] Part D, Error Codes for a list of error codes and descriptions.
Vendor_Specific_Error_Code 1 octet 0x00: No chipset vendor specific error code is included.
0x01 ~ 0xFF: Chipset vendor specific error code.
Vendor Specific Parameter (Parameter Total Length - 4) * octets For the controller vendor to obtain more vendor specific parameters.
Sub-event Parameter Size Purpose
Quality_Report_Id 1 octet 0x00 ~ 0x10: Reserved.
0x11: LMP/LL message trace.
0x12: Bluetooth Multi-link/Coex scheduling trace.
0x13: Controller Debug Information data dump.
0x14 ~ 0xFF: Reserved.
Connection_Handle 2 octets Connection Handle.
Vendor Specific Parameter (Parameter Total Length - 4) * octets Vendor Specific format of LMP message trace, Bluetooth Multi-link/Coex scheduling trace and Controller Debug Information data dump.

Multi-advertiser support

The objectives of multi-advertiser support are the following:

  • Ability to support multiple advertisements ( max_advt_instances )
  • Different transmit powers to allow for a varying range
  • Different advertising content
  • An individualized response for each advertiser
  • Privacy (non-trackable) for each advertiser
  • Connectable

To keep this specification close to existing standards, the following vendor-specific commands are provided. They are derived from the Bluetooth Core 4.1 Specification.

LE_Multi_Advt_Command

OCF: 0x154

Command parameter Size Purpose
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Sub_Cmd
0x02 - Set_Advt_Data_Multi_Sub_Cmd
0x03 - Set_Scan_Resp_Data_Multi_Sub_Cmd
0x04 - Set_Random_Addr_Multi_Sub_Cmd
0x05 - Set_Advt_Enable_Multi_Sub_Cmd

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 - Set_Advt_Param_Multi_Command
0x02 - Set_Advt_Data_Multi_Command
0x03 - Set_Scan_Resp_Data_Multi_Command
0x04 - Set_Random_Addr_Multi_Command
0x05 - Set_Advt_Enable_Multi_Command

LE_Multi_Advt_Command: Set_Advt_Param_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 964 (LE Set Advertising Parameter Command)

Sub OCF: 0x01

Sub-command parameter Size Purpose
Advertising_Interval_Min Per spec Per spec
Advertising_Interval_Max Per spec Per spec
Advertising_Type Per spec Per spec
Own_Address_Type Per spec Per spec
Own_Address Per spec Per spec
Direct_Address_Type Per spec Per spec
Direct_Address Per spec Per spec
Advertising_Channel_Map Per spec Per spec
Adverstising_Filter_Policy Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance
Tx_power 1 octet Transmit_Power
Unit - in dBm (signed integer)
Range (-70 to +20)

The Own_Address parameter could be a host-configured address at the time of setting up this multi-advertisement instance. This provides the ability to have a resolvable private address at the time of the transmit of the first beacon. Advertisement on an instance will continue irrespective of the connection. The host BT stack could issue a command to start advertisement on an instance, post connection.

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success (invalid parameter) code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x01 [ Set_Advt_Param_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 969 (LE Set Advertising Data Command)

Sub OCF: 0x02

Sub-command parameter Size Purpose
Advertising_Data_Length Per spec Per spec
Advertising_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x02 [ Set_Advt_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Scan_Resp_Data_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 970 (LE Set Scan Response Data Command)

Sub OCF: 0x03

Sub-command parameter Size Purpose
Scan_Response_Data_Length Per spec Per spec
Scan_Response_Data Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command as specified in the Bluetooth Core 4.1 Specification, per the above command. The controller will respond with a non-success code (invalid parameter) if the advertising instance or Tx_Power parameters are invalid.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x03 [ Set_Scan_Resp_Data_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Random_Addr_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 963 (LE Set Random Address Command)

Sub OCF: 0x04

Sub-command parameter Size Purpose
Random Address Per spec Per spec
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x04 [ Set_Random_Addr_Multi_Sub_Cmd]

LE_Multi_Advt_Command: Set_Advt_Enable_Multi_Sub_Cmd

Base reference: Bluetooth Core 4.1 Specification, page 971 (LE Set Advertise Enable Command in that core specification)

OCF: 0x05

Sub-command parameter Size Purpose
Advertising_Enable 1 octet A value of 1 means enable. Any other value means disable.
Advertising_Instance 1 octet Specifies the applicability of the above parameters to an instance. Instance 0 means a standard HCI instance.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Multi_advt_opcode 1 octet 0x05 [ Set_Advt_Enable_Multi_Sub_Cmd]

Offloaded resolution of private address

This feature resolves a private address in the controller firmware or hardware, which provides the following benefits:

  • Latency involved with the host in resolving a private address
  • Saving power by refraining from waking up the host

LE_Set_RPA_Timeout

OCF: 0x15C

Command parameter Size Purpose
LE_local_IRK 16 octet The local device IRK used to generate the random resolvable address(es).
tRPA_min 2 octets The minimum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or after this timeout.
Valid range: 300-1800
tRPA_max 2 octets The maximum RPA generation timeout in seconds. The controller must generate new resolvable addresses for any advertising/scanning/connection events on or before this timeout.
Valid range: tRPA_min -1800
Return parameter Size Purpose
Status 1 octet The status of the command.

Suggested HCI status values:
0x00 Success
0x01 Unknown command (if not supported)
0x12 Invalid command parameters (if any parameters are outside the given range)

LE_RPA_offload_Command

OCF: 0x155

Command parameter Size Purpose
RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_RPA_offload_opcode 1 octet 0x1 - Enable customer specific feature
0x2 - Add IRK to the list
0x3 - Remove IRK from the list
0x4 - Clear IRK list
0x5 - Read IRK list entry

LE_RPA_offload: Enable_cust_specific_sub_Command

Sub OCF: 0x01

Sub-command parameter Size Purpose
enable_customer_specific_feature_set 1 octet 0x01 - Enable offloaded RPA feature
0x00 - Disable offloaded RPA feature

RPA offload is required to be enabled by the host, based on the chip capability. Refer to the LE_Get_Vendor_Capabilities_Command . Each chip can have a varying max_irk_list_sz in the firmware.

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x01 [Enable customer-specific feature]

LE_RPA_offload: Add_IRK_to_list_sub_Command

Sub OCF: 0x02

Sub-command parameter Size Purpose
LE_IRK 16 octets LE IRK (1st byte LSB)
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK (1st byte LSB)

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x02 [Add IRK to the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Remove_IRK_to_list_sub_Command

Sub OCF: 0x03

Sub-command parameter Size Purpose
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address that associates to the IRK

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x03 [Remove IRK from the list]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation

LE_RPA_offload: Clear_IRK_list_sub_Command

Sub OCF: 0x04

Sub-command parameter Size Purpose
None

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x04 [Clear IRK List]
LE_IrkList_AvailableSpaces 1 octet Available IRL list entries after current operation [ max_irk_list_sz]

LE_RPA_offload: Read_IRK_list_sub_Command

Sub OCF: 0x05

Sub-command parameter Size Purpose
LE_read_IRK_list_entry-index 1 octet Index of the IRK list [0, max_irk_list_sz-1]

A Command Complete event will be generated for this command.

Return parameter Size Purpose
Status 1 octet Command Complete status
Event_cust_specific_feature_opcode 1 octet 0x05 [Read IRK List Entry]
LE_Read_IRK_List_entry 1 octet Index of the IRK that the host wants to read back (maximum IRK list size is 32)
LE_IRK 16 octets IRK value
Address_Type 1 octet 0: Public address
1: Random address
LE_Device_Address 6 octets Public or random address associated to the IRK
LE_Resolved_Private_Address 6 octets Current resolved resolvable private address of this IRK