mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-09 21:45:54 +00:00
hci_transport_h4: add hci_transport_h4_instance_for_uart with btstack_uart
This commit is contained in:
parent
79530e3778
commit
f9bd6dd702
@ -134,16 +134,17 @@ typedef struct {
|
||||
// inline various hci_transport_X.h files
|
||||
|
||||
/*
|
||||
* @brief Setup H4 instance with uart_driver
|
||||
* @param uart_driver to use
|
||||
* @brief Setup H4 instance with btstack_uart implementation
|
||||
* @param btstack_uart_block_driver to use
|
||||
*/
|
||||
const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * uart_driver);
|
||||
|
||||
/*
|
||||
* @brief Setup H5 instance with uart_driver
|
||||
* @param uart_driver to use
|
||||
* @brief Setup H4 instance with btstack_uart_block implementation
|
||||
* @param btstack_uart_block_driver to use
|
||||
* @deprecated use hci_transport_h4_instance_for_uart instead
|
||||
*/
|
||||
const hci_transport_t * hci_transport_h5_instance(const btstack_uart_block_t * uart_driver);
|
||||
const hci_transport_t * hci_transport_h4_instance_for_uart(const btstack_uart_t * uart_driver);
|
||||
|
||||
/*
|
||||
* @brief Setup H5 instance with btstack_uart implementation that supports SLIP frames
|
||||
|
@ -126,7 +126,7 @@ typedef enum {
|
||||
} TX_STATE;
|
||||
|
||||
// UART Driver + Config
|
||||
static const btstack_uart_block_t * btstack_uart;
|
||||
static const btstack_uart_t * btstack_uart;
|
||||
static btstack_uart_config_t uart_config;
|
||||
|
||||
// write state
|
||||
@ -728,8 +728,6 @@ static void hci_transport_h4_ehcill_handle_ehcill_command_sent(void){
|
||||
|
||||
|
||||
// configure and return h4 singleton
|
||||
const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * uart_driver) {
|
||||
|
||||
static const hci_transport_t hci_transport_h4 = {
|
||||
/* const char * name; */ "H4",
|
||||
/* void (*init) (const void *transport_config); */ &hci_transport_h4_init,
|
||||
@ -743,6 +741,13 @@ const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * u
|
||||
/* void (*set_sco_config)(uint16_t voice_setting, int num_connections); */ NULL,
|
||||
};
|
||||
|
||||
const hci_transport_t * hci_transport_h4_instance_for_uart(const btstack_uart_t * uart_driver){
|
||||
btstack_uart = uart_driver;
|
||||
return &hci_transport_h4;
|
||||
}
|
||||
|
||||
// @deprecated
|
||||
const hci_transport_t * hci_transport_h4_instance(const btstack_uart_block_t * uart_driver) {
|
||||
btstack_uart = (const btstack_uart_t *) uart_driver;
|
||||
return &hci_transport_h4;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user