#include "btstack_config.h"
#include "btstack_chipset.h"
#include "btstack_control.h"
#include "btstack_linked_list.h"
#include "btstack_util.h"
#include "classic/btstack_link_key_db.h"
#include "hci_cmd.h"
#include "gap.h"
#include "hci_transport.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
Data Structures | |
struct | hci_connection_t |
struct | hci_stack_t |
main data structure More... | |
struct | whitelist_entry_t |
Typedefs | |
typedef enum hci_init_state | hci_substate_t |
HCI Inititizlization State Machine. More... | |
Functions | |
int | gap_ssp_supported_on_both_sides (hci_con_handle_t handle) |
Check if SSP is supported on both sides. More... | |
void | hci_add_event_handler (btstack_packet_callback_registration_t *callback_handler) |
Add event packet handler. More... | |
int | hci_authentication_active_for_handle (hci_con_handle_t handle) |
Check if authentication is active. More... | |
int | hci_can_send_acl_classic_packet_now (void) |
Check hci packet buffer is free and a classic acl packet can be sent to controller. More... | |
int | hci_can_send_acl_le_packet_now (void) |
Check hci packet buffer is free and an LE acl packet can be sent to controller. More... | |
int | hci_can_send_acl_packet_now (hci_con_handle_t con_handle) |
Check hci packet buffer is free and an acl packet for the given handle can be sent to controller. More... | |
int | hci_can_send_command_packet_now (void) |
Check if CMD packet can be sent to controller. More... | |
int | hci_can_send_prepared_acl_packet_now (hci_con_handle_t con_handle) |
Check if acl packet for the given handle can be sent to controller. More... | |
int | hci_can_send_prepared_sco_packet_now (void) |
Check if SCO packet can be sent to controller. More... | |
int | hci_can_send_sco_packet_now (void) |
Check HCI packet buffer and if SCO packet can be sent to controller. More... | |
void | hci_close (void) |
Shutdown HCI. More... | |
hci_connection_t * | hci_connection_for_bd_addr_and_type (bd_addr_t addr, bd_addr_type_t addr_type) |
Get internal hci_connection_t for given Bluetooth addres. More... | |
hci_connection_t * | hci_connection_for_handle (hci_con_handle_t con_handle) |
Get internal hci_connection_t for given handle. More... | |
void | hci_connections_get_iterator (btstack_linked_list_iterator_t *it) |
Get connection iterator. More... | |
void | hci_disable_l2cap_timeout_check (void) |
Disable automatic L2CAP disconnect if no L2CAP connection is established. More... | |
void | hci_disconnect_all (void) |
Disconnect all HCI connections. More... | |
void | hci_disconnect_security_block (hci_con_handle_t con_handle) |
Disconn because of security block. More... | |
void | hci_emit_state (void) |
Emit current HCI state. More... | |
int | hci_extended_sco_link_supported (void) |
Check if extended SCO Link is supported. More... | |
uint16_t | hci_get_manufacturer (void) |
Get Manufactured. More... | |
uint8_t * | hci_get_outgoing_packet_buffer (void) |
Get pointer for outgoing packet buffer. More... | |
int | hci_get_sco_packet_length (void) |
Get SCO packet length for current SCO Voice setting. More... | |
uint16_t | hci_get_sco_voice_setting (void) |
Get SCO Voice Setting. More... | |
HCI_STATE | hci_get_state (void) |
Get state. More... | |
void | hci_init (const hci_transport_t *transport, const void *config) |
Set up HCI. More... | |
int | hci_is_packet_buffer_reserved (void) |
Check if outgoing packet buffer is reserved. More... | |
void | hci_le_advertisements_set_params (uint16_t adv_int_min, uint16_t adv_int_max, uint8_t adv_type, uint8_t direct_address_typ, bd_addr_t direct_address, uint8_t channel_map, uint8_t filter_policy) |
Set Advertisement Parameters. More... | |
void | hci_le_set_own_address_type (uint8_t own_address_type) |
uint16_t | hci_max_acl_data_packet_length (void) |
Get maximal ACL Classic data packet length based on used buffer size. More... | |
int | hci_non_flushable_packet_boundary_flag_supported (void) |
Check if ACL packets marked as non flushable can be sent. More... | |
int | hci_number_free_acl_slots_for_handle (hci_con_handle_t con_handle) |
Get number of free acl slots for packets of given handle. More... | |
int | hci_power_control (HCI_POWER_MODE mode) |
Requests the change of BTstack power mode. More... | |
void | hci_register_acl_packet_handler (btstack_packet_handler_t handler) |
Registers a packet handler for ACL data. More... | |
void | hci_register_sco_packet_handler (btstack_packet_handler_t handler) |
Registers a packet handler for SCO data. More... | |
void | hci_release_packet_buffer (void) |
Release outgoing packet buffer More... | |
int | hci_remote_esco_supported (hci_con_handle_t con_handle) |
Query if remote side supports eSCO. More... | |
void | hci_request_sco_can_send_now_event (void) |
Request emission of HCI_EVENT_SCO_CAN_SEND_NOW as soon as possible. More... | |
int | hci_reserve_packet_buffer (void) |
Reserves outgoing packet buffer. More... | |
int | hci_send_acl_packet_buffer (int size) |
Send acl packet prepared in hci packet buffer. More... | |
int | hci_send_cmd (const hci_cmd_t *cmd,...) |
Creates and sends HCI command packets based on a template and a list of parameters. More... | |
int | hci_send_cmd_packet (uint8_t *packet, int size) |
Send complete CMD packet. More... | |
int | hci_send_cmd_va_arg (const hci_cmd_t *cmd, va_list argtr) |
va_list version of hci_send_cmd More... | |
int | hci_send_sco_packet_buffer (int size) |
Send SCO packet prepared in HCI packet buffer. More... | |
void | hci_set_bd_addr (bd_addr_t addr) |
Set Public BD ADDR - passed on to Bluetooth chipset during init if supported in bt_control_h. More... | |
void | hci_set_chipset (const btstack_chipset_t *chipset_driver) |
Configure Bluetooth chipset driver. More... | |
void | hci_set_control (const btstack_control_t *hardware_control) |
Configure Bluetooth hardware control. More... | |
void | hci_set_hardware_error_callback (void(*fn)(uint8_t error)) |
Set callback for Bluetooth Hardware Error. More... | |
void | hci_set_inquiry_mode (inquiry_mode_t mode) |
Set inquiry mode: standard, with RSSI, with RSSI + Extended Inquiry Results. More... | |
void | hci_set_link_key_db (btstack_link_key_db_t const *link_key_db) |
Configure Bluetooth hardware control. More... | |
void | hci_set_sco_voice_setting (uint16_t voice_setting) |
Configure Voice Setting for use with SCO data in HSP/HFP. More... | |
uint16_t | hci_usable_acl_packet_types (void) |
Get supported packet types. More... | |
#define HCI_ACL_BUFFER_SIZE (HCI_ACL_HEADER_SIZE + HCI_ACL_PAYLOAD_SIZE) |
Referenced by acl_handler().
#define HCI_CMD_BUFFER_SIZE (HCI_CMD_HEADER_SIZE + HCI_CMD_PAYLOAD_SIZE_LE) |
#define HCI_CMD_PAYLOAD_SIZE_LE 32 |
#define HCI_EVENT_BUFFER_SIZE (HCI_EVENT_HEADER_SIZE + HCI_EVENT_PAYLOAD_SIZE + 1) |
#define HCI_EVENT_IS_COMMAND_COMPLETE | ( | event, | |
cmd | |||
) | ( event[0] == HCI_EVENT_COMMAND_COMPLETE && little_endian_read_16(event,3) == cmd.opcode) |
Referenced by event_handler(), l2cap_hci_event_handler(), and sm_event_packet_handler().
#define HCI_EVENT_IS_COMMAND_STATUS | ( | event, | |
cmd | |||
) | ( event[0] == HCI_EVENT_COMMAND_STATUS && little_endian_read_16(event,4) == cmd.opcode) |
#define HCI_INCOMING_PRE_BUFFER_SIZE 0 |
Referenced by acl_handler(), hci_transport_h5_process_frame(), and hci_transport_slip_init().
#define HCI_OUTGOING_PRE_BUFFER_SIZE 1 |
Referenced by hci_init().
#define HCI_PACKET_BUFFER_SIZE HCI_CMD_BUFFER_SIZE |
#define IS_COMMAND | ( | packet, | |
command | |||
) | (little_endian_read_16(packet,0) == command.opcode) |
Referenced by hci_send_cmd_packet().
#define OFFSET_OF_DATA_IN_COMMAND_COMPLETE 5 |
Referenced by event_handler(), and sm_event_packet_handler().
#define READ_ACL_CONNECTION_HANDLE | ( | buffer | ) | ( little_endian_read_16(buffer,0) & 0x0fff) |
Referenced by acl_handler(), event_handler(), hci_run(), hci_send_acl_packet_buffer(), and l2cap_acl_handler().
Referenced by acl_handler().
#define READ_ACL_LENGTH | ( | buffer | ) | (little_endian_read_16(buffer, 2)) |
Referenced by acl_handler().
#define READ_L2CAP_CHANNEL_ID | ( | buffer | ) | ( little_endian_read_16(buffer, 6)) |
Referenced by l2cap_acl_classic_handler(), and l2cap_acl_le_handler().
#define READ_L2CAP_LENGTH | ( | buffer | ) | ( little_endian_read_16(buffer, 4)) |
Referenced by acl_handler().
#define READ_SCO_CONNECTION_HANDLE | ( | buffer | ) | ( little_endian_read_16(buffer,0) & 0x0fff) |
typedef enum hci_init_state hci_substate_t |
HCI Inititizlization State Machine.
anonymous enum |
anonymous enum |
anonymous enum |
enum BLUETOOTH_STATE |
enum CONNECTION_STATE |
enum hci_init_state |
HCI Inititizlization State Machine.
enum le_scanning_state_t |
int gap_ssp_supported_on_both_sides | ( | hci_con_handle_t | handle | ) |
Check if SSP is supported on both sides.
Called by L2CAP
void hci_add_event_handler | ( | btstack_packet_callback_registration_t * | callback_handler | ) |
Add event packet handler.
References btstack_linked_list_add_tail(), and hci_stack_t::event_handlers.
Referenced by ancs_client_init(), att_server_init(), gatt_client_init(), l2cap_init(), le_counter_setup(), le_prov_app_setup(), sm_init(), and tss_app_setup().
int hci_authentication_active_for_handle | ( | hci_con_handle_t | handle | ) |
Check if authentication is active.
It delays automatic disconnect while no L2CAP connection Called by l2cap.
Referenced by l2cap_hci_event_handler().
int hci_can_send_acl_classic_packet_now | ( | void | ) |
Check hci packet buffer is free and a classic acl packet can be sent to controller.
Referenced by l2cap_notify_channel_can_send().
int hci_can_send_acl_le_packet_now | ( | void | ) |
Check hci packet buffer is free and an LE acl packet can be sent to controller.
References BD_ADDR_TYPE_LE_PUBLIC, hci_can_send_prepared_acl_packet_for_address_type(), and hci_stack_t::hci_packet_buffer_reserved.
Referenced by att_packet_handler(), and l2cap_notify_channel_can_send().
int hci_can_send_acl_packet_now | ( | hci_con_handle_t | con_handle | ) |
Check hci packet buffer is free and an acl packet for the given handle can be sent to controller.
References hci_can_send_prepared_acl_packet_now(), and hci_stack_t::hci_packet_buffer_reserved.
Referenced by l2cap_can_send_fixed_channel_packet_now(), l2cap_notify_channel_can_send(), l2cap_run(), and l2cap_send_connectionless().
int hci_can_send_command_packet_now | ( | void | ) |
Check if CMD packet can be sent to controller.
References hci_can_send_comand_packet_transport(), and hci_stack_t::num_cmd_packets.
Referenced by hci_initializing_run(), hci_run(), hci_send_cmd_va_arg(), l2cap_hci_event_handler(), l2cap_run(), and sm_run().
int hci_can_send_prepared_acl_packet_now | ( | hci_con_handle_t | con_handle | ) |
Check if acl packet for the given handle can be sent to controller.
References HCI_ACL_DATA_PACKET, hci_number_free_acl_slots_for_handle(), and hci_transport_can_send_prepared_packet_now().
Referenced by hci_can_send_acl_packet_now(), hci_run(), hci_send_acl_packet_buffer(), hci_send_acl_packet_fragments(), and l2cap_send_prepared_connectionless().
int hci_can_send_prepared_sco_packet_now | ( | void | ) |
Check if SCO packet can be sent to controller.
int hci_can_send_sco_packet_now | ( | void | ) |
Check HCI packet buffer and if SCO packet can be sent to controller.
void hci_close | ( | void | ) |
Shutdown HCI.
References btstack_linked_list_iterator_has_next(), btstack_linked_list_iterator_init(), btstack_linked_list_iterator_next(), btstack_link_key_db_t::close, hci_connection_t::con_handle, hci_stack_t::connections, hci_emit_disconnection_complete(), hci_power_control(), HCI_POWER_OFF, hci_shutdown_connection(), hci_stack_t::link_key_db, and NULL.
hci_connection_t* hci_connection_for_bd_addr_and_type | ( | bd_addr_t | addr, |
bd_addr_type_t | addr_type | ||
) |
Get internal hci_connection_t for given Bluetooth addres.
Called by L2CAP
Get internal hci_connection_t for given Bluetooth addres.
References hci_connection_t::address, hci_connection_t::address_type, btstack_linked_list_iterator_has_next(), btstack_linked_list_iterator_init(), btstack_linked_list_iterator_next(), hci_stack_t::connections, and NULL.
Referenced by event_handler(), and hci_send_cmd_packet().
hci_connection_t* hci_connection_for_handle | ( | hci_con_handle_t | con_handle | ) |
Get internal hci_connection_t for given handle.
Used by L2CAP, SM, daemon
Get internal hci_connection_t for given handle.
References btstack_linked_list_iterator_has_next(), btstack_linked_list_iterator_init(), btstack_linked_list_iterator_next(), hci_connection_t::con_handle, hci_stack_t::connections, and NULL.
Referenced by acl_handler(), att_server_for_handle(), event_handler(), gap_disconnect(), gap_get_connection_type(), hci_disconnect_security_block(), hci_number_free_acl_slots_for_handle(), hci_run(), hci_send_acl_packet_buffer(), l2cap_acl_handler(), l2cap_hci_event_handler(), and sm_get_connection_for_handle().
void hci_connections_get_iterator | ( | btstack_linked_list_iterator_t * | it | ) |
Get connection iterator.
Get connection iterator.
References btstack_linked_list_iterator_init(), and hci_stack_t::connections.
Referenced by att_server_handle_can_send_now(), l2cap_run(), and sm_run().
void hci_disable_l2cap_timeout_check | ( | void | ) |
Disable automatic L2CAP disconnect if no L2CAP connection is established.
void hci_disconnect_all | ( | void | ) |
Disconnect all HCI connections.
Called by daemon
References btstack_linked_list_iterator_has_next(), btstack_linked_list_iterator_init(), btstack_linked_list_iterator_next(), hci_stack_t::connections, hci_run(), SEND_DISCONNECT, SENT_DISCONNECT, and hci_connection_t::state.
void hci_disconnect_security_block | ( | hci_con_handle_t | con_handle | ) |
Disconn because of security block.
Called by L2CAP
References BONDING_DISCONNECT_SECURITY_BLOCK, hci_connection_t::bonding_flags, and hci_connection_for_handle().
Referenced by l2cap_hci_event_handler(), and l2cap_run().
void hci_emit_state | ( | void | ) |
Emit current HCI state.
Called by daemon
References BTSTACK_EVENT_STATE, hci_emit_event(), and hci_stack_t::state.
Referenced by hci_init_done(), hci_power_control(), and hci_run().
int hci_extended_sco_link_supported | ( | void | ) |
Check if extended SCO Link is supported.
Referenced by event_handler().
uint16_t hci_get_manufacturer | ( | void | ) |
uint8_t* hci_get_outgoing_packet_buffer | ( | void | ) |
Get pointer for outgoing packet buffer.
References hci_stack_t::hci_packet_buffer.
Referenced by l2cap_get_outgoing_buffer(), l2cap_run(), l2cap_send_connectionless(), and l2cap_send_prepared_connectionless().
int hci_get_sco_packet_length | ( | void | ) |
Get SCO packet length for current SCO Voice setting.
uint16_t hci_get_sco_voice_setting | ( | void | ) |
Get SCO Voice Setting.
HCI_STATE hci_get_state | ( | void | ) |
void hci_init | ( | const hci_transport_t * | transport, |
const void * | config | ||
) |
Set up HCI.
Needs to be called before any other function.
References hci_stack_t::acl_data_packet_length, hci_stack_t::bondable, hci_stack_t::class_of_device, hci_stack_t::config, HCI_OUTGOING_PRE_BUFFER_SIZE, hci_stack_t::hci_packet_buffer, hci_stack_t::hci_packet_buffer_data, hci_stack_static, HCI_STATE_OFF, hci_state_reset(), hci_stack_t::hci_transport, le_connection_parameter_range::le_conn_interval_max, le_connection_parameter_range::le_conn_interval_min, le_connection_parameter_range::le_conn_latency_max, le_connection_parameter_range::le_conn_latency_min, hci_stack_t::le_connection_parameter_range, le_connection_parameter_range::le_supervision_timeout_max, le_connection_parameter_range::le_supervision_timeout_min, hci_stack_t::local_name, packet_handler(), hci_transport_t::register_packet_handler, hci_stack_t::sco_voice_setting, hci_stack_t::ssp_authentication_requirement, hci_stack_t::ssp_auto_accept, hci_stack_t::ssp_enable, SSP_IO_AUTHREQ_MITM_PROTECTION_NOT_REQUIRED_GENERAL_BONDING, hci_stack_t::ssp_io_capability, SSP_IO_CAPABILITY_NO_INPUT_NO_OUTPUT, and hci_stack_t::state.
Referenced by bt_app_init().
int hci_is_packet_buffer_reserved | ( | void | ) |
Check if outgoing packet buffer is reserved.
Used for internal checks in l2cap.c
References hci_stack_t::hci_packet_buffer_reserved.
Referenced by l2cap_send_prepared_connectionless().
void hci_le_advertisements_set_params | ( | uint16_t | adv_int_min, |
uint16_t | adv_int_max, | ||
uint8_t | adv_type, | ||
uint8_t | direct_address_typ, | ||
bd_addr_t | direct_address, | ||
uint8_t | channel_map, | ||
uint8_t | filter_policy | ||
) |
Set Advertisement Parameters.
adv_int_min | |
adv_int_max | |
adv_type | |
direct_address_type | |
direct_address | |
channel_map | |
filter_policy |
void hci_le_set_own_address_type | ( | uint8_t | own_address_type | ) |
Referenced by gap_random_address_set_mode().
uint16_t hci_max_acl_data_packet_length | ( | void | ) |
Get maximal ACL Classic data packet length based on used buffer size.
Called by L2CAP
References hci_stack_t::acl_data_packet_length.
Referenced by l2cap_run().
int hci_non_flushable_packet_boundary_flag_supported | ( | void | ) |
Check if ACL packets marked as non flushable can be sent.
Called by L2CAP
References hci_stack_t::local_supported_features.
Referenced by l2cap_create_signaling_internal().
int hci_number_free_acl_slots_for_handle | ( | hci_con_handle_t | con_handle | ) |
Get number of free acl slots for packets of given handle.
Called by daemon
References hci_connection_t::address_type, hci_connection_for_handle(), hci_number_free_acl_slots_for_connection_type(), and log_error.
Referenced by hci_can_send_prepared_acl_packet_now().
int hci_power_control | ( | HCI_POWER_MODE | mode | ) |
Requests the change of BTstack power mode.
References hci_emit_state(), HCI_FALLING_ASLEEP_DISCONNECT, HCI_INIT_AFTER_SLEEP, HCI_INIT_WRITE_SCAN_ENABLE, hci_power_control_off(), hci_power_control_on(), hci_power_control_sleep(), hci_power_control_wake(), HCI_POWER_OFF, HCI_POWER_ON, HCI_POWER_SLEEP, hci_power_transition_to_initializing(), hci_run(), HCI_STATE_FALLING_ASLEEP, HCI_STATE_HALTING, HCI_STATE_INITIALIZING, HCI_STATE_OFF, HCI_STATE_SLEEPING, HCI_STATE_WORKING, log_error, log_info, hci_stack_t::state, and hci_stack_t::substate.
Referenced by btstack_main(), and hci_close().
void hci_register_acl_packet_handler | ( | btstack_packet_handler_t | handler | ) |
Registers a packet handler for ACL data.
Used by L2CAP
Registers a packet handler for ACL data.
References hci_stack_t::acl_packet_handler.
Referenced by l2cap_init().
void hci_register_sco_packet_handler | ( | btstack_packet_handler_t | handler | ) |
Registers a packet handler for SCO data.
Used for HSP and HFP profiles.
void hci_release_packet_buffer | ( | void | ) |
Release outgoing packet buffer
References hci_stack_t::hci_packet_buffer_reserved.
Referenced by event_handler(), hci_send_acl_packet_buffer(), hci_send_acl_packet_fragments(), and l2cap_release_packet_buffer().
int hci_remote_esco_supported | ( | hci_con_handle_t | con_handle | ) |
Query if remote side supports eSCO.
void hci_request_sco_can_send_now_event | ( | void | ) |
Request emission of HCI_EVENT_SCO_CAN_SEND_NOW as soon as possible.
int hci_reserve_packet_buffer | ( | void | ) |
Reserves outgoing packet buffer.
References hci_stack_t::hci_packet_buffer_reserved, and log_error.
Referenced by hci_initializing_run(), hci_send_cmd_va_arg(), l2cap_reserve_packet_buffer(), l2cap_run(), and l2cap_send_connectionless().
int hci_send_acl_packet_buffer | ( | int | size | ) |
Send acl packet prepared in hci packet buffer.
References hci_stack_t::acl_fragmentation_pos, hci_stack_t::acl_fragmentation_total_size, BTSTACK_ACL_BUFFERS_FULL, con_handle, hci_can_send_prepared_acl_packet_now(), hci_connection_for_handle(), hci_stack_t::hci_packet_buffer, hci_stack_t::hci_packet_buffer_reserved, hci_release_packet_buffer(), hci_send_acl_packet_fragments(), log_error, and READ_ACL_CONNECTION_HANDLE.
Referenced by l2cap_run(), and l2cap_send_prepared_connectionless().
int hci_send_cmd | ( | const hci_cmd_t * | cmd, |
... | |||
) |
Creates and sends HCI command packets based on a template and a list of parameters.
Will return error if outgoing data buffer is occupied.
Creates and sends HCI command packets based on a template and a list of parameters.
References hci_send_cmd_va_arg().
Referenced by hci_initialization_timeout_handler(), hci_initializing_run(), hci_run(), l2cap_hci_event_handler(), l2cap_run(), sm_aes128_start(), sm_random_start(), and sm_run().
int hci_send_cmd_packet | ( | uint8_t * | packet, |
int | size | ||
) |
Send complete CMD packet.
Called by daemon
References bd_addr_to_str(), BD_ADDR_TYPE_CLASSIC, BTSTACK_MEMORY_ALLOC_FAILED, hci_connection_t::con_handle, create_connection_for_bd_addr_and_type(), btstack_link_key_db_t::delete_link_key, hci_accept_synchronous_connection, HCI_COMMAND_DATA_PACKET, hci_connection_for_bd_addr_and_type(), hci_create_connection, hci_delete_stored_link_key, hci_dump_packet(), hci_le_create_connection, hci_le_create_connection_cancel, hci_le_set_advertise_enable, hci_le_set_random_address, hci_link_key_request_negative_reply, hci_link_key_request_reply, hci_stack_t::hci_packet_buffer, hci_stack_t::hci_packet_buffer_reserved, hci_pin_code_request_negative_reply, hci_pin_code_request_reply, hci_setup_synchronous_connection, hci_stack_t::hci_transport, hci_transport_synchronous(), hci_user_confirmation_request_negative_reply, hci_user_confirmation_request_reply, hci_user_passkey_request_negative_reply, hci_user_passkey_request_reply, hci_write_loopback_mode, IS_COMMAND, LE_CONNECTING_DIRECT, LE_CONNECTING_IDLE, LE_CONNECTING_WHITELIST, LEGACY_PAIRING_ACTIVE, hci_stack_t::link_key_db, little_endian_read_16(), log_error, log_info, hci_stack_t::loopback_mode, hci_stack_t::num_cmd_packets, OPEN, reverse_bd_addr(), hci_stack_t::sco_voice_setting_active, SEND_CREATE_CONNECTION, hci_transport_t::send_packet, SENT_CREATE_CONNECTION, SENT_LINK_KEY_NEGATIVE_REQUEST, SENT_LINK_KEY_REPLY, SSP_PAIRING_ACTIVE, and hci_connection_t::state.
Referenced by hci_initializing_run(), and hci_send_cmd_va_arg().
int hci_send_cmd_va_arg | ( | const hci_cmd_t * | cmd, |
va_list | argtr | ||
) |
va_list version of hci_send_cmd
References hci_can_send_command_packet_now(), hci_cmd_create_from_template(), hci_stack_t::hci_packet_buffer, hci_reserve_packet_buffer(), hci_send_cmd_packet(), hci_stack_t::last_cmd_opcode, log_error, and hci_cmd_t::opcode.
Referenced by hci_send_cmd().
int hci_send_sco_packet_buffer | ( | int | size | ) |
Send SCO packet prepared in HCI packet buffer.
void hci_set_bd_addr | ( | bd_addr_t | addr | ) |
Set Public BD ADDR - passed on to Bluetooth chipset during init if supported in bt_control_h.
References hci_stack_t::custom_bd_addr, and hci_stack_t::custom_bd_addr_set.
void hci_set_chipset | ( | const btstack_chipset_t * | chipset_driver | ) |
Configure Bluetooth chipset driver.
Has to be called before power on, or right after receiving the local version information.
Has to be called before power on, or right after receiving the local version information
References hci_stack_t::chipset, hci_stack_t::config, and btstack_chipset_t::init.
Referenced by bt_app_init().
void hci_set_control | ( | const btstack_control_t * | hardware_control | ) |
Configure Bluetooth hardware control.
Has to be called before power on.
Has to be called after hci_init() but before power on.
References hci_stack_t::config, hci_stack_t::control, and btstack_control_t::init.
void hci_set_hardware_error_callback | ( | void(*)(uint8_t error) | fn | ) |
Set callback for Bluetooth Hardware Error.
References hci_stack_t::hardware_error_callback.
void hci_set_inquiry_mode | ( | inquiry_mode_t | mode | ) |
Set inquiry mode: standard, with RSSI, with RSSI + Extended Inquiry Results.
Has to be called before power on.
inquriy_mode | see bluetooth_defines.h |
void hci_set_link_key_db | ( | btstack_link_key_db_t const * | link_key_db | ) |
Configure Bluetooth hardware control.
Has to be called before power on.
Referenced by bt_app_init().
void hci_set_sco_voice_setting | ( | uint16_t | voice_setting | ) |
Configure Voice Setting for use with SCO data in HSP/HFP.
uint16_t hci_usable_acl_packet_types | ( | void | ) |