API Reference

Package Contents

The package ble_hci contains the BleHci object, which is used as a method of communication between the test host (PC) and the test controller(s) (PCB). The HCI is primarily used by the test controllers during board-to-board testing, but is provided publically due to the wide range of HCI applications and use cases.

Implementation details

The HCI object contained in this package has many of the base HCI functions already implemented. These include:

  • reset

  • maximize data length

  • send/sink ACL data

  • TX test (basic and vendor-specific)

  • RX test (basic and vendor-specific)

  • end test

  • PHY selection

  • TX power selection

  • BD address selection

  • channel map selection

  • start advertising

  • start scanning

  • initialize connection

  • disconnect

  • register read/write

Should an HCI command that is not currently implemented be needed, the BleHci object also provides a function for sending a raw HCI command.

Classes

  • BleHci

Usage

The BleHci object contains several initialization parameters which can be used to define the board UART COM/serial port, define a string identifier for the HCI, and specificy the HCI logging level. For the purpose of these examples, it is assumed the COM/serial port string has already been assigned to the variable port.

Create an HCI, basic:

hci = BleHci(port)

Create an HCI, set ID string to ‘DUT’:

hci = BleHci(port, id_tag='DUT')

Create an HCI, set log level to ‘ERROR’:

hci = BleHci(port, log_level='ERROR')