#include <bt/bt_hci_defs.h>
#include <bt/bt_defs.h>
struct bt_hci_cmd_response* _bt_hci_cmd_get_response | ( | struct btstack * | stack, | |
u_short | ogcocf, | |||
u_short | cmd_handle | |||
) |
Saves a bt_hci_cmd_response in the bt-internal layout. The calle can wait with his bt_hci_cmd_response for the event to come back!
stack | The bt-stack to use. | |
ogcocf | Which ocf/ogf event will be woken up | |
cmd_handle | The cmd handle (BT_HCI_HANDLE_INVALID if unused) |
void _bt_hci_dumpWaitQueue | ( | struct btstack * | stack | ) |
dumps the bt hci cmd waitqueue to stdout
stack | The bt-stack to use. |
bt_hci_con_handle_t _bt_hci_get_app_con_handle | ( | struct btstack * | stack, | |
_bt_hci_module_con_handle_t | module_con_handle | |||
) |
Translates a module con handle into the app (unique) con handle
stack | The bt-stack to use. | |
module_con_handle | The module con_handle |
short _bt_hci_get_free_con_entry_index | ( | struct btstack * | stack | ) |
Gets an index of a free connection entry from the stack
stack | The bt-stack to use. |
_bt_hci_module_con_handle_t _bt_hci_get_module_con_handle | ( | struct btstack * | stack, | |
bt_hci_con_handle_t | app_con_handle | |||
) |
Translates a app (unique) con handle into the module con handle
stack | The bt-stack to use. | |
app_con_handle | The module con_handle |
struct bt_hci_cmd_response* _bt_hci_intro_cmd | ( | struct btstack * | stack, | |
struct bt_hci_cmd_response * | wcmd, | |||
struct bt_hci_cmd_response * | response, | |||
struct bt_hci_pkt_cmd * | cmd, | |||
u_char | ogf, | |||
u_short | ocf | |||
) |
Gets called by all hci cmds. Waits until the controller accepts more pkts and the cmd-buffer is empty Then it checks, if the call is sync or async.
stack | The bt-stack to use. | |
wcmd | The local cmd_response, if the call is sync | |
response | Pointer to the response. | |
ogf | OGF | |
ocf | OCF |
long _bt_hci_outro_cmd | ( | struct btstack * | stack, | |
struct bt_hci_cmd_response * | wcmdpointer, | |||
struct bt_hci_cmd_response * | response, | |||
u_short | ogfocf, | |||
u_short | cmd_handle | |||
) |
Gets called by all hci cmds. If necessary, setup wcmdpointer struct with ocgfocf + connection handle, then register the wcmdpointer in the stack's waitqueue. Sends the pkt. to the transport If call is synchronous (response == BT_HCI_SYNC), wait for cmd completion
stack | The bt-stack to use. | |
wcmdpointer | Pointer to the used bt_hci_cmd_response | |
response | Pointer to the response. | |
ogfocf | OGF/OCF of this call | |
cmd_handle | Handle of this call (app con handle used!!, BT_HCI_HANDLE_INVALID if unused) |
void _bt_hci_pkts_init | ( | struct btstack * | stack | ) |
Initializes all the packets of a stack.
stack | The bt-stack to use. |
int _bt_hci_setWaitQueue | ( | struct btstack * | stack, | |
struct bt_hci_cmd_response * | resp | |||
) |
Saves a bt_hci_cmd_response in the bt-internal layout. The calle can wait with his bt_hci_cmd_response for the event to come back!
stack | The bt-stack to use. | |
resp | the pointer to bt_hci_cmd_response, that will be entered in the btstack-queue |
Wake all threads that wait on ogcocf & con_handle combination and stores the response in all waiting bt_hci_cmd_response structs The call can wait with his bt_hci_cmd_response for the event to come back!
stack | The bt-stack to use. | |
ogcocf | Which ocf/ogf event will be woken up | |
cmd_handle | the cmd handle (BT_HCI_HANDLE_INVALID if unused) | |
response | The response that the woken-up-thread gets back |
Wakes one thread of waitque and stores the response in all waiting bt_hci_cmd_response structs The call can wait with his bt_hci_cmd_response for the event to come back!
stack | The bt-stack to use. | |
index | The index of bt_hci_cmd_response to use. | |
response | The response that the woken-up-thread gets back |
void _bt_hci_wakeup_latest | ( | struct btstack * | stack, | |
long | response | |||
) |
Wakes thread that is waiting for Command Status Event and stores the response in all waiting bt_hci_cmd_response structs The call can wait with his bt_hci_cmd_response for the event to come back!
stack | The bt-stack to use. | |
response | The response that the woken-up-thread gets back |
void _bt_hci_wakeup_unset | ( | struct btstack * | stack | ) | [inline] |
Sets latest wait queue command entry to NONE