#include "btstack_config.h"
#include "classic/sdp_util.h"
#include "hci.h"
#include "hci_cmd.h"
#include "btstack_debug.h"
#include <string.h>
Macros | |
#define | __BTSTACK_FILE__ "hci_cmd.c" |
#define | OPCODE(ogf, ocf) (ocf | ogf << 10) |
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... | |
#define __BTSTACK_FILE__ "hci_cmd.c" |
#define OPCODE | ( | ogf, | |
ocf | |||
) | (ocf | ogf << 10) |
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 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 |
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_authentication_requested |
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 |
const hci_cmd_t hci_delete_stored_link_key |
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_inquiry |
Link Control Commands.
lap | |
inquiry_length | |
num_responses |
Referenced by hci_run().
const hci_cmd_t hci_inquiry_cancel |
Referenced by event_handler(), and hci_run().
const hci_cmd_t hci_io_capability_request_negative_reply |
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_link_key_request_negative_reply |
const hci_cmd_t hci_link_key_request_reply |
const hci_cmd_t hci_pin_code_request_negative_reply |
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_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 |
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 |
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 |
const hci_cmd_t hci_user_confirmation_request_reply |
const hci_cmd_t hci_user_passkey_request_negative_reply |
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 |
const hci_cmd_t hci_write_default_erroneous_data_reporting |
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_loopback_mode |
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 |
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 |
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().