dotstack API Reference
1.10.37
|
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... | |
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 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.
len | Number 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.
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.
buffer | Pointer to a buffer for the received data. The buffer must be long enough to accommodate the number of bytes specified by the |
len | Number of bytes to receive. |
callback | A 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.
buffer | Pointer to the data to be sent . |
len | Number of bytes to send. |
callback | A callback function that must be called when all data have been sent. |