btstack_uart_block: add set_wakeup_handler to allow wake up notifications

This commit is contained in:
Matthias Ringwald 2017-05-01 18:13:51 +02:00
parent c4e86052e3
commit c3dafd4604
5 changed files with 14 additions and 4 deletions

View File

@ -156,7 +156,8 @@ static const btstack_uart_block_t btstack_uart_embedded = {
/* void (*receive_block)(uint8_t *buffer, uint16_t len); */ &btstack_uart_embedded_receive_block,
/* void (*send_block)(const uint8_t *buffer, uint16_t length); */ &btstack_uart_embedded_send_block,
/* int (*get_supported_sleep_modes); */ NULL,
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL,
/* void (*set_wakeup_handler)(void (*handler)(void)); */ NULL,
};
const btstack_uart_block_t * btstack_uart_block_embedded_instance(void){

View File

@ -380,7 +380,8 @@ static const btstack_uart_block_t btstack_uart_posix = {
/* void (*receive_block)(uint8_t *buffer, uint16_t len); */ &btstack_uart_posix_receive_block,
/* void (*send_block)(const uint8_t *buffer, uint16_t length); */ &btstack_uart_posix_send_block,
/* int (*get_supported_sleep_modes); */ NULL,
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL,
/* void (*set_wakeup_handler)(void (*handler)(void)); */ NULL,
};
const btstack_uart_block_t * btstack_uart_block_posix_instance(void){

View File

@ -411,7 +411,8 @@ static const btstack_uart_block_t btstack_uart_windows = {
/* void (*receive_block)(uint8_t *buffer, uint16_t len); */ &btstack_uart_windows_receive_block,
/* void (*send_block)(const uint8_t *buffer, uint16_t length); */ &btstack_uart_windows_send_block,
/* int (*get_supported_sleep_modes); */ NULL,
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL,
/* void (*set_wakeup_handler)(void (*handler)(void)); */ NULL,
};
const btstack_uart_block_t * btstack_uart_block_windows_instance(void){

View File

@ -323,7 +323,8 @@ static const btstack_uart_block_t btstack_uart_block_wiced = {
/* void (*receive_block)(uint8_t *buffer, uint16_t len); */ &btstack_uart_block_wiced_receive_block,
/* void (*send_block)(const uint8_t *buffer, uint16_t length); */ &btstack_uart_block_wiced_send_block,
/* int (*get_supported_sleep_modes); */ NULL,
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL
/* void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode); */ NULL,
/* void (*set_wakeup_handler)(void (*handler)(void)); */ NULL,
};
const btstack_uart_block_t * btstack_uart_block_wiced_instance(void){

View File

@ -132,6 +132,12 @@ typedef struct {
*/
void (*set_sleep)(btstack_uart_sleep_mode_t sleep_mode);
/**
* set wakeup handler - needed to notify hci transport of wakeup requests by Bluetooth controller
* Called upon CTS pulse or RX data. See sleep modes.
*/
void (*set_wakeup_handler)(void (*wakeup_handler)(void));
} btstack_uart_block_t;
// common implementations