Data Structures | |
struct | hci_cmd_t |
compact HCI Command packet description More... | |
Enumerations | |
enum | HCI_POWER_MODE { HCI_POWER_OFF = 0, HCI_POWER_ON, HCI_POWER_SLEEP } |
Hardware state of Bluetooth controller. More... | |
enum | HCI_STATE { HCI_STATE_OFF = 0, HCI_STATE_INITIALIZING, HCI_STATE_WORKING, HCI_STATE_HALTING, HCI_STATE_SLEEPING, HCI_STATE_FALLING_ASLEEP } |
State of BTstack. More... | |
Functions | |
uint16_t | hci_cmd_create_from_template (uint8_t *hci_cmd_buffer, const hci_cmd_t *cmd, va_list argptr) |
construct HCI Command based on template More... | |
enum HCI_POWER_MODE |
enum HCI_STATE |
uint16_t hci_cmd_create_from_template | ( | uint8_t * | hci_cmd_buffer, |
const hci_cmd_t * | cmd, | ||
va_list | argptr | ||
) |
construct HCI Command based on template
Format: 1,2,3,4: one to four byte value H: HCI connection handle B: Bluetooth Baseband Address (BD_ADDR) D: 8 byte data block E: Extended Inquiry Result N: Name up to 248 chars, \0 terminated P: 16 byte Pairing code A: 31 bytes advertising data S: Service Record (Data Element Sequence)
Format: 1,2,3,4: one to four byte value H: HCI connection handle B: Bluetooth Baseband Address (BD_ADDR) D: 8 byte data block E: Extended Inquiry Result N: Name up to 248 chars, \0 terminated P: 16 byte data block. Pairing code, Simple Pairing Hash and Randomizer A: 31 bytes advertising data S: Service Record (Data Element Sequence) Q: 32 byte data block, e.g. for X and Y coordinates of P-256 public key
References de_get_len(), hci_cmd_t::format, hci_cmd_t::opcode, and reverse_bytes().
Referenced by hci_send_cmd_va_arg().
const hci_cmd_t hci_accept_connection_request |
bd_addr | |
role | (become master, stay slave) |
Referenced by hci_run().
const hci_cmd_t hci_accept_synchronous_connection |
bd_addr | |
transmit_bandwidth | |
receive_bandwidth | |
max_latency | |
voice_settings | |
retransmission_effort | |
packet_type |
Referenced by hci_send_cmd_packet().
const hci_cmd_t hci_bcm_write_sco_pcm_int |
Configure SCO Routing (BCM)
sco_routing | is 0 for PCM, 1 for Transport, 2 for Codec and 3 for I2S |
pcm_interface_rate | is 0 for 128KBps, 1 for 256 KBps, 2 for 512KBps, 3 for 1024KBps, and 4 for 2048Kbps |
frame_type | is 0 for short and 1 for long |
sync_mode | is 0 for slave and 1 for master |
clock_mode | is 0 for slabe and 1 for master |
Referenced by hci_initializing_run().
const hci_cmd_t hci_change_connection_link_key |
handle |
const hci_cmd_t hci_change_connection_packet_type |
handle | |
packet_type |
const hci_cmd_t hci_create_connection |
bd_addr | |
packet_type | |
page_scan_repetition_mode | |
reserved | |
clock_offset | |
allow_role_switch |
Referenced by hci_run(), hci_send_cmd_packet(), and l2cap_run().
const hci_cmd_t hci_create_connection_cancel |
bd_addr |
Referenced by l2cap_hci_event_handler().
const hci_cmd_t hci_delete_stored_link_key |
bd_addr | |
delete_all_flags |
Referenced by hci_send_cmd_packet().
const hci_cmd_t hci_disconnect |
handle | |
reason | (0x05, 0x13-0x15, 0x1a, 0x29, see Errors Codes in BT Spec Part D) |
Referenced by hci_run(), and l2cap_hci_event_handler().
const hci_cmd_t hci_enable_device_under_test_mode |
const hci_cmd_t hci_enhanced_accept_synchronous_connection |
bd_addr | |
transmit_bandwidth | |
receive_bandwidth | |
transmit_coding_format_type | |
transmit_coding_format_company | |
transmit_coding_format_codec | |
receive_coding_format_type | |
receive_coding_format_company | |
receive_coding_format_codec | |
transmit_coding_frame_size | |
receive_coding_frame_size | |
input_bandwidth | |
output_bandwidth | |
input_coding_format_type | |
input_coding_format_company | |
input_coding_format_codec | |
output_coding_format_type | |
output_coding_format_company | |
output_coding_format_codec | |
input_coded_data_size | |
outupt_coded_data_size | |
input_pcm_data_format | |
output_pcm_data_format | |
input_pcm_sample_payload_msb_position | |
output_pcm_sample_payload_msb_position | |
input_data_path | |
output_data_path | |
input_transport_unit_size | |
output_transport_unit_size | |
max_latency | |
packet_type | |
retransmission_effort |
const hci_cmd_t hci_enhanced_setup_synchronous_connection |
handle | |
transmit_bandwidth | |
receive_bandwidth | |
transmit_coding_format_type | |
transmit_coding_format_company | |
transmit_coding_format_codec | |
receive_coding_format_type | |
receive_coding_format_company | |
receive_coding_format_codec | |
transmit_coding_frame_size | |
receive_coding_frame_size | |
input_bandwidth | |
output_bandwidth | |
input_coding_format_type | |
input_coding_format_company | |
input_coding_format_codec | |
output_coding_format_type | |
output_coding_format_company | |
output_coding_format_codec | |
input_coded_data_size | |
outupt_coded_data_size | |
input_pcm_data_format | |
output_pcm_data_format | |
input_pcm_sample_payload_msb_position | |
output_pcm_sample_payload_msb_position | |
input_data_path | |
output_data_path | |
input_transport_unit_size | |
output_transport_unit_size | |
max_latency | |
packet_type | |
retransmission_effort |
const hci_cmd_t hci_flush |
handle |
const hci_cmd_t hci_host_buffer_size |
Referenced by hci_initializing_run().
const hci_cmd_t hci_inquiry |
const hci_cmd_t hci_inquiry_cancel |
Referenced by event_handler(), and hci_run().
const hci_cmd_t hci_io_capability_request_negative_reply |
bd_addr | |
reason | (Part D, Error codes) |
Referenced by hci_run().
const hci_cmd_t hci_io_capability_request_reply |
bd_addr | |
IO_capability | |
OOB_data_present | |
authentication_requirements |
Referenced by hci_run().
const hci_cmd_t hci_le_clear_white_list |
const hci_cmd_t hci_le_create_connection |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_le_create_connection_cancel |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_le_encrypt |
Referenced by sm_aes128_start(), and sm_event_packet_handler().
const hci_cmd_t hci_le_rand |
Referenced by sm_event_packet_handler(), and sm_random_start().
const hci_cmd_t hci_le_read_advertising_channel_tx_power |
const hci_cmd_t hci_le_read_buffer_size |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_le_read_channel_map |
const hci_cmd_t hci_le_read_maximum_data_length |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_le_read_remote_used_features |
const hci_cmd_t hci_le_read_suggested_default_data_length |
const hci_cmd_t hci_le_read_supported_features |
const hci_cmd_t hci_le_read_supported_states |
const hci_cmd_t hci_le_read_white_list_size |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_le_receiver_test |
const hci_cmd_t hci_le_set_advertise_enable |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_le_set_data_length |
const hci_cmd_t hci_le_set_event_mask |
Referenced by hci_initializing_run().
const hci_cmd_t hci_le_set_host_channel_classification |
const hci_cmd_t hci_le_set_random_address |
Referenced by hci_send_cmd_packet(), and sm_run().
const hci_cmd_t hci_le_set_scan_parameters |
Referenced by hci_initializing_run(), and hci_run().
const hci_cmd_t hci_le_test_end |
const hci_cmd_t hci_le_transmitter_test |
const hci_cmd_t hci_le_write_suggested_default_data_length |
Referenced by hci_initializing_run().
const hci_cmd_t hci_link_key_request_negative_reply |
bd_addr |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_link_key_request_reply |
bd_addr | |
link_key |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_pin_code_request_negative_reply |
bd_addr |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_pin_code_request_reply |
bd_addr | |
pin_length | |
pin | (c-string) |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_qos_setup |
handle | |
flags | |
service_type | |
token_rate | (bytes/s) |
peak_bandwith | (bytes/s) |
latency | (us) |
delay_variation | (us) |
const hci_cmd_t hci_read_bd_addr |
Referenced by event_handler(), hci_initializing_run(), and sm_event_packet_handler().
const hci_cmd_t hci_read_buffer_size |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_read_le_host_supported |
const hci_cmd_t hci_read_link_policy_settings |
handle |
const hci_cmd_t hci_read_link_supervision_timeout |
handle |
const hci_cmd_t hci_read_local_extended_ob_data |
const hci_cmd_t hci_read_local_extended_oob_data |
const hci_cmd_t hci_read_local_name |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_read_local_oob_data |
const hci_cmd_t hci_read_local_supported_commands |
Referenced by event_handler(), hci_initialization_timeout_handler(), hci_initializing_run(), and sm_event_packet_handler().
const hci_cmd_t hci_read_local_supported_features |
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_read_local_version_information |
Informational Parameters.
Referenced by event_handler(), and hci_initializing_run().
const hci_cmd_t hci_read_loopback_mode |
Testing Commands.
const hci_cmd_t hci_read_num_broadcast_retransmissions |
const hci_cmd_t hci_read_remote_supported_features_command |
handle |
Referenced by hci_run().
const hci_cmd_t hci_read_rssi |
Status Paramters.
handle |
const hci_cmd_t hci_reject_connection_request |
bd_addr | |
reason | (e.g. CONNECTION REJECTED DUE TO LIMITED RESOURCES (0x0d)) |
Referenced by hci_run().
const hci_cmd_t hci_remote_name_request |
bd_addr | |
page_scan_repetition_mode | |
reserved | |
clock_offset |
Referenced by hci_run().
const hci_cmd_t hci_remote_name_request_cancel |
bd_addr |
const hci_cmd_t hci_remote_oob_data_request_negative_reply |
bd_addr |
const hci_cmd_t hci_remote_oob_data_request_reply |
bd_addr | |
c | Simple Pairing Hash C |
r | Simple Pairing Randomizer R |
const hci_cmd_t hci_reset |
Referenced by hci_initializing_event_handler(), and hci_initializing_run().
const hci_cmd_t hci_role_discovery |
handle |
const hci_cmd_t hci_set_connection_encryption |
handle | |
encryption_enable |
Referenced by hci_run().
const hci_cmd_t hci_set_controller_to_host_flow_control |
Referenced by hci_initializing_run().
const hci_cmd_t hci_set_event_mask |
Controller & Baseband Commands.
event_mask_lover_octets | |
event_mask_higher_octets |
Referenced by hci_initializing_run().
const hci_cmd_t hci_setup_synchronous_connection |
handle | |
transmit_bandwidth | 8000(64kbps) |
receive_bandwidth | 8000(64kbps) |
max_latency | >= 7ms for eSCO, 0xFFFF do not care |
voice_settings | e.g. CVSD, Input Coding: Linear, Input Data Format: 2’s complement, data 16bit: 00011000000 == 0x60 |
retransmission_effort | e.g. 0xFF do not care |
packet_type | at least EV3 for eSCO |
Referenced by hci_send_cmd_packet().
const hci_cmd_t hci_sniff_mode |
Link Policy Commands.
handle | |
sniff_max_interval | |
sniff_min_interval | |
sniff_attempt | |
sniff_timeout |
const hci_cmd_t hci_switch_role_command |
bd_addr | |
role | (0=master,1=slave) |
const hci_cmd_t hci_user_confirmation_request_negative_reply |
bd_addr |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_user_confirmation_request_reply |
bd_addr |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_user_passkey_request_negative_reply |
bd_addr |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_user_passkey_request_reply |
bd_addr | |
numeric_value |
Referenced by hci_run(), and hci_send_cmd_packet().
const hci_cmd_t hci_write_authentication_enable |
authentication_enable |
const hci_cmd_t hci_write_class_of_device |
class_of_device |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_default_erroneous_data_reporting |
mode | (0 = off, 1 = on) |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_extended_inquiry_response |
fec_required | |
exstended_inquiry_response |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_inquiry_mode |
inquiry_mode | (0x00 = standard, 0x01 = with RSSI, 0x02 = extended) |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_le_host_supported |
le_supported_host | |
simultaneous_le_host |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_link_policy_settings |
handle | |
settings |
const hci_cmd_t hci_write_link_supervision_timeout |
handle | |
timeout | (0x0001 - 0xFFFF Time -> Range: 0.625ms - 40.9 sec) |
const hci_cmd_t hci_write_local_name |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_loopback_mode |
loopback_mode |
Referenced by hci_send_cmd_packet().
const hci_cmd_t hci_write_num_broadcast_retransmissions |
num_broadcast_retransmissions | (e.g. 0 for a single broadcast) |
const hci_cmd_t hci_write_page_timeout |
page_timeout | (* 0.625 ms) |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_scan_enable |
scan_enable | (no, inq, page, inq+page) |
Referenced by event_handler(), hci_initializing_run(), and hci_run().
const hci_cmd_t hci_write_secure_connections_test_mode |
handle | |
dm1_acl_u_mode | |
esco_loopback_mode |
const hci_cmd_t hci_write_simple_pairing_debug_mode |
simple_pairing_debug_mode |
const hci_cmd_t hci_write_simple_pairing_mode |
mode | (0 = off, 1 = on) |
Referenced by hci_initializing_run().
const hci_cmd_t hci_write_synchronous_flow_control_enable |
synchronous_flow_control_enable | - if yes, num completed packet everts are sent for SCO packets |
Referenced by event_handler(), and hci_initializing_run().