#include <inttypes.h>
#include "btstack_config.h"
#include "btstack_debug.h"
#include "hci.h"
#include "hci_transport.h"
#include "bluetooth_company_id.h"
#include "btstack_uart_block.h"
Macros | |
#define | __BTSTACK_FILE__ "hci_transport_h4.c" |
#define | ENABLE_LOG_EHCILL |
Enumerations | |
enum | H4_STATE { H4_W4_PACKET_TYPE, H4_W4_EVENT_HEADER, H4_W4_ACL_HEADER, H4_W4_SCO_HEADER, H4_W4_PAYLOAD } |
enum | TX_STATE { TX_IDLE = 1, TX_W4_PACKET_SENT } |
Functions | |
static void | dummy_handler (uint8_t packet_type, uint8_t *packet, uint16_t size) |
static void | hci_transport_h4_block_read (void) |
static void | hci_transport_h4_block_sent (void) |
static int | hci_transport_h4_can_send_now (uint8_t packet_type) |
static int | hci_transport_h4_close (void) |
static void | hci_transport_h4_init (const void *transport_config) |
const hci_transport_t * | hci_transport_h4_instance (const btstack_uart_block_t *uart_driver) |
static int | hci_transport_h4_open (void) |
static void | hci_transport_h4_register_packet_handler (void(*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)) |
static void | hci_transport_h4_reset_statemachine (void) |
static int | hci_transport_h4_send_packet (uint8_t packet_type, uint8_t *packet, int size) |
static int | hci_transport_h4_set_baudrate (uint32_t baudrate) |
static void | hci_transport_h4_trigger_next_read (void) |
Variables | |
static const btstack_uart_block_t * | btstack_uart |
static int | bytes_to_read |
static H4_STATE | h4_state |
static uint8_t * | hci_packet = &hci_packet_with_pre_buffer[HCI_INCOMING_PRE_BUFFER_SIZE] |
static uint8_t | hci_packet_with_pre_buffer [HCI_INCOMING_PRE_BUFFER_SIZE+1+HCI_PACKET_BUFFER_SIZE] |
static const hci_transport_t | hci_transport_h4 |
static void(* | packet_handler )(uint8_t packet_type, uint8_t *packet, uint16_t size) = dummy_handler |
static uint8_t | packet_sent_event [] = { HCI_EVENT_TRANSPORT_PACKET_SENT, 0} |
static int | read_pos |
static TX_STATE | tx_state |
static btstack_uart_config_t | uart_config |
#define __BTSTACK_FILE__ "hci_transport_h4.c" |
#define ENABLE_LOG_EHCILL |
enum H4_STATE |
enum TX_STATE |
|
static |
|
static |
References BLUETOOTH_COMPANY_ID_TEXAS_INSTRUMENTS_INC, bytes_to_read, h4_state, H4_W4_ACL_HEADER, H4_W4_EVENT_HEADER, H4_W4_PACKET_TYPE, H4_W4_PAYLOAD, H4_W4_SCO_HEADER, HCI_ACL_DATA_PACKET, HCI_ACL_HEADER_SIZE, HCI_EVENT_HEADER_SIZE, HCI_EVENT_PACKET, hci_packet, HCI_PACKET_BUFFER_SIZE, HCI_SCO_DATA_PACKET, HCI_SCO_HEADER_SIZE, hci_transport_h4_reset_statemachine(), hci_transport_h4_trigger_next_read(), little_endian_read_16(), log_error, log_info, packet_handler, and read_pos.
Referenced by hci_transport_h4_init().
|
static |
References HCI_EVENT_PACKET, packet_handler, packet_sent_event, TX_IDLE, tx_state, and TX_W4_PACKET_SENT.
Referenced by hci_transport_h4_init().
|
static |
|
static |
References btstack_uart_block_t::close.
|
static |
References btstack_uart_config_t::baudrate, hci_transport_config_uart_t::baudrate_init, btstack_uart_config_t::device_name, hci_transport_config_uart_t::device_name, btstack_uart_config_t::flowcontrol, hci_transport_config_uart_t::flowcontrol, HCI_TRANSPORT_CONFIG_UART, hci_transport_h4_block_read(), hci_transport_h4_block_sent(), btstack_uart_block_t::init, log_error, btstack_uart_block_t::set_block_received, and btstack_uart_block_t::set_block_sent.
const hci_transport_t* hci_transport_h4_instance | ( | const btstack_uart_block_t * | uart_driver | ) |
References hci_transport_h4, and uart_driver.
Referenced by bt_app_init().
|
static |
|
static |
References packet_handler.
|
static |
References bytes_to_read, h4_state, H4_W4_PACKET_TYPE, and read_pos.
Referenced by hci_transport_h4_block_read(), and hci_transport_h4_open().
|
static |
References log_info, btstack_uart_block_t::send_block, tx_state, and TX_W4_PACKET_SENT.
|
static |
References log_info, and btstack_uart_block_t::set_baudrate.
|
static |
References bytes_to_read, hci_packet, read_pos, and btstack_uart_block_t::receive_block.
Referenced by hci_transport_h4_block_read(), and hci_transport_h4_open().
|
static |
|
static |
|
static |
Referenced by hci_transport_h4_block_read(), and hci_transport_h4_reset_statemachine().
|
static |
Referenced by hci_transport_h4_block_read(), and hci_transport_h4_trigger_next_read().
|
static |
|
static |
Referenced by hci_transport_h4_instance().
|
static |
|
static |
Referenced by hci_transport_h4_block_sent().
|
static |
|
static |
|
static |