Mistake on this page?
Report an issue in GitHub or email us
Public Types | Public Member Functions | Protected Member Functions
NRFCordioHCIDriver Class Reference

Nordic port of CordioHCIDriver. More...

#include <NRFCordioHCIDriver.h>

Inheritance diagram for NRFCordioHCIDriver:
CordioHCIDriver

Public Types

typedef mbed::Callback< void(bool, uint16_t)> test_end_handler_t
 Callback to inform the caller of the result of the test, the parameters are success and the number of packets received. More...
 

Public Member Functions

 NRFCordioHCIDriver (CordioHCITransportDriver &transport_driver)
 Construct a new instance of an HCI driver. More...
 
virtual ~NRFCordioHCIDriver ()
 Driver destructor. More...
 
virtual buf_pool_desc_t get_buffer_pool_description ()
 Return the set of memory pool which will be used by the Cordio stack. More...
 
virtual void start_reset_sequence ()
 Start the reset sequence of the BLE module. More...
 
virtual bool get_random_static_address (ble::address_t &address)
 Handle HCI messages received during the reset sequence. More...
 
void initialize ()
 Initialize the HCI driver. More...
 
void terminate ()
 Termination of the driver. More...
 
virtual void handle_reset_sequence (uint8_t *msg)
 Handle HCI messages received during the reset sequence. More...
 
void signal_reset_sequence_done ()
 Signal to the stack that the reset sequence has been done. More...
 
uint16_t write (uint8_t type, uint16_t len, uint8_t *pData)
 Write data in the transport channel. More...
 
virtual void on_host_stack_inactivity ()
 React to host stack inactivity. More...
 
void handle_test_end (bool success, uint16_t packets)
 This will be called by host part of the stack to indicate the end of the test. More...
 
ble_error_t rf_test_start_le_receiver_test (test_end_handler_t test_end_handler, uint8_t channel)
 Start BLE receiver test. More...
 
ble_error_t rf_test_start_le_transmitter_test (test_end_handler_t test_end_handler, uint8_t channel, uint8_t length, uint8_t type)
 Start BLE transmitter test. More...
 
ble_error_t rf_test_end ()
 Complete the test. More...
 
virtual ble_error_t set_tx_power (int8_t level_db)
 Set desired transmit power. More...
 

Protected Member Functions

buf_pool_desc_t get_default_buffer_pool_description ()
 Return a default set of memory pool that the Cordio stack can use. More...
 
void set_random_static_address (const ble::address_t &random_static_address)
 Allows the driver to set a random static address. More...
 

Detailed Description

Nordic port of CordioHCIDriver.

Definition at line 28 of file NRFCordioHCIDriver.h.

Member Typedef Documentation

typedef mbed::Callback<void(bool, uint16_t)> test_end_handler_t
inherited

Callback to inform the caller of the result of the test, the parameters are success and the number of packets received.

Definition at line 164 of file CordioHCIDriver.h.

Constructor & Destructor Documentation

Construct a new instance of an HCI driver.

Parameters
transport_driverThe driver used to communicate with the chip.
virtual ~NRFCordioHCIDriver ( )
virtual

Driver destructor.

Member Function Documentation

virtual buf_pool_desc_t get_buffer_pool_description ( )
virtual

Return the set of memory pool which will be used by the Cordio stack.

Implements CordioHCIDriver.

buf_pool_desc_t get_default_buffer_pool_description ( )
protectedinherited

Return a default set of memory pool that the Cordio stack can use.

This function can be used to implement get_buffer_pool_description().

virtual bool get_random_static_address ( ble::address_t address)
virtual

Handle HCI messages received during the reset sequence.

Parameters
msgThe HCI message received.
Note
The driver should signal to the stack that the initialization sequence is done by calling the function: signal_reset_sequence_done. Get the random static address of the controller.
Returns
false if the address has not been set and true otherwise.

Reimplemented from CordioHCIDriver.

virtual void handle_reset_sequence ( uint8_t *  msg)
virtualinherited

Handle HCI messages received during the reset sequence.

Parameters
msgThe HCI message received.
Note
The driver should signal to the stack that the initialization sequence is done by calling the function: signal_reset_sequence_done.
void handle_test_end ( bool  success,
uint16_t  packets 
)
inherited

This will be called by host part of the stack to indicate the end of the test.

Parameters
successTrue if the TEST END command was a success.
packetsNumber of packets received during the test.
Returns
BLE_ERROR_NONE on success.
void initialize ( )
inherited

Initialize the HCI driver.

This function start by initializing the transport driver then it delegates what's remain of the initialization to the function do_initialize.

virtual void on_host_stack_inactivity ( )
virtualinherited

React to host stack inactivity.

The host stack invoke this function when it is inactive. It allows a driver to put its controller to sleep if all the conditions are met.

Any call to write signals to the driver that the host stack is active.

ble_error_t rf_test_end ( )
inherited

Complete the test.

This will trigger the end test event which will call handle_test_end

Returns
BLE_ERROR_NONE on success.
ble_error_t rf_test_start_le_receiver_test ( test_end_handler_t  test_end_handler,
uint8_t  channel 
)
inherited

Start BLE receiver test.

Call rf_test_end when you want to stop.

Parameters
test_end_handlerHandler that will be called with the number of packets received.
channelChannel to use.
Returns
BLE_ERROR_NONE on success.
ble_error_t rf_test_start_le_transmitter_test ( test_end_handler_t  test_end_handler,
uint8_t  channel,
uint8_t  length,
uint8_t  type 
)
inherited

Start BLE transmitter test.

Call rf_test_end when you want to stop.

Parameters
test_end_handlerHandler that will be called with status and the number of packets set to 0.
channelChannel to use.
lengthSize of payload.
typeType of pattern to transmit
See also
BLE spec Volume 6 Part F, Section 4.1.5.
Returns
BLE_ERROR_NONE on success.
void set_random_static_address ( const ble::address_t random_static_address)
protectedinherited

Allows the driver to set a random static address.

Unlike the HCI command this function reports the random static address to the whole BLE system.

Parameters
random_static_addressThe random static address to set.
virtual ble_error_t set_tx_power ( int8_t  level_db)
virtualinherited

Set desired transmit power.

Value equal or bigger will be used from available levels. Consult chip documentation for available values. Actual TX power is not guaranteed and is down to the implementation.

Parameters
level_dbSignal level in dBm.
Returns
BLE_ERROR_NONE on success.
void signal_reset_sequence_done ( )
inherited

Signal to the stack that the reset sequence has been done.

virtual void start_reset_sequence ( )
virtual

Start the reset sequence of the BLE module.

Reimplemented from CordioHCIDriver.

void terminate ( )
inherited

Termination of the driver.

It call in sequence:

  • do_terminate
  • terminate the transport driver.
uint16_t write ( uint8_t  type,
uint16_t  len,
uint8_t *  pData 
)
inherited

Write data in the transport channel.

Parameters
typeThe type of packet to transmit. It might be an HCI command packet, ACL packet or EVT packet. Depending on the type of transport it can prefix the packet itself.
lenNumber of bytes to transmit.
pDatapointer to the data to transmit.
Returns
The number of bytes which have been transmited.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.