dotstack API Reference  1.10.37
Modules | Typedefs | Functions
OEM - HCI Communication Interface

Modules

 HCI UART (H4) transport protocol
 

Typedefs

typedef void(* bt_oem_send_callback_fp) (void)
 Send callback. More...
 
typedef void(* bt_oem_recv_callback_fp) (bt_uint len)
 Receive callback. More...
 

Functions

void bt_oem_send (const bt_byte *buffer, bt_uint len, bt_oem_send_callback_fp callback)
 Send data. More...
 
void bt_oem_recv (bt_byte *buffer, bt_uint len, bt_oem_recv_callback_fp callback)
 Receive data. More...
 

Detailed Description

The DotStack library provides several HCI transport protocols (e.g., H4, 3-wire protocol). However, the code that actually moves octets of data between the CPU and HCI controller is application specific.

This module declares an interface that allows DotStack to communicate with the HCI controller. The application has to implement this interface.

The interface consist of the following functions that must be implemented by the application:

Typedef Documentation

typedef void(* bt_oem_recv_callback_fp) (bt_uint len)

Receive callback.

This callback function is called when a receive operation initiated by bt_oem_recv() has completed.

Parameters
lenNumber of received bytes. The value of this parameter should always be the same as the number of bytes requested in a call to bt_oem_recv().
typedef void(* bt_oem_send_callback_fp) (void)

Send callback.

This callback function is called when a send operation initiated by bt_oem_send() has completed.

Function Documentation

void bt_oem_recv ( bt_byte *  buffer,
bt_uint  len,
bt_oem_recv_callback_fp  callback 
)

Receive data.

This function is called by the HCI layer when it needs more data from the HCI controller. Implementation of this function must receive the specified number of bytes from the HCI controller and call the provided callback function.

Parameters
bufferPointer to a buffer for the received data. The buffer must be long enough to accommodate the number of bytes specified by the
len parameter.
Parameters
lenNumber of bytes to receive.
callbackA callback function that must be called when the requested number of bytes have been received.
void bt_oem_send ( const bt_byte *  buffer,
bt_uint  len,
bt_oem_send_callback_fp  callback 
)

Send data.

This function is called by the HCI layer when it needs to send data to the HCI controller. Implementation of this function must send the specified number of bytes to the HCI controller and call the provided callback function.

Parameters
bufferPointer to the data to be sent .
lenNumber of bytes to send.
callbackA callback function that must be called when all data have been sent.