dotstack API Reference  1.10.37
Macros | Typedefs | Functions
HCI

The Host Controller Interface (HCI) provides a uniform interface method of accessing a Bluetooth Controller's capabilities. More...

Macros

#define bt_hci_add_param_uint(cmd, value)   bt_hci_add_param_int(cmd, (bt_int)(value))
 Add unsigned int parameter to an HCI command.
 
#define bt_hci_add_param_ulong(cmd, value)   bt_hci_add_param_long(cmd, (bt_long)(value))
 Add unsigned long parameter to an HCI command.
 
#define bt_hci_add_param_hconn(pcmd, value)   bt_hci_add_param_int(pcmd, value)
 Add connection handle parameter to an HCI command.
 
#define bt_hci_get_param_hconn(pcmd, pvalue, poffset)   bt_hci_get_param_int(pcmd, pvalue, poffset)
 Get connection handle parameter from HCI command.
 
#define bt_hci_get_evt_param_hconn(pevt, pvalue, poffset)   bt_hci_get_evt_param_int(pevt, pvalue, poffset)
 Get connection handle parameter from HCI event.
 
#define bt_hci_request_remote_name(pbdaddr, pg_scan_rpt_mode, clock_offset, cb)   bt_hci_request_remote_name_ex(pbdaddr, pg_scan_rpt_mode, clock_offset, cb, NULL)
 Request remote device's name. More...
 

Typedefs

typedef void(* bt_hci_start_callback_fp) (bt_bool success, void *param)
 HCI initialization callback. More...
 
typedef void(* bt_hci_stop_callback_fp) (void *param)
 HCI stop callback. More...
 
typedef void(* bt_hci_connect_callback_fp) (bt_byte status, bt_hci_conn_state_t *pconn, void *param)
 HCI connect callback. More...
 
typedef void(* bt_hci_disconnect_callback_fp) (bt_byte status, bt_byte reason, bt_hci_conn_state_t *pconn, void *param)
 HCI disconnect callback. More...
 

Functions

bt_hci_command_t * bt_hci_alloc_command (bt_int opcode, bt_hci_cmd_callback_fp callback)
 Allocate and initialize an HCI command structure.
 
void bt_hci_free_command (bt_hci_command_t *cmd)
 Free HCI command.
 
bt_hci_command_t * bt_hci_alloc_canned_command (const bt_byte *canned_command, bt_hci_cmd_callback_fp callback)
 Allocate and initialize an HCI command structure for a canned (pre-formatted) command.
 
bt_bool bt_hci_add_param_byte (bt_hci_command_t *pcmd, bt_byte value)
 Add byte parameter to an HCI command.
 
bt_bool bt_hci_add_param_int (bt_hci_command_t *pcmd, bt_int value)
 Add int parameter to an HCI command.
 
bt_bool bt_hci_add_param_long (bt_hci_command_t *pcmd, bt_long value)
 Add long parameter to an HCI command.
 
bt_bool bt_hci_add_param_bdaddr (bt_hci_command_t *pcmd, const bt_bdaddr_t *pbdaddr)
 Add BD address parameter to an HCI command.
 
bt_bool bt_hci_add_param_string (bt_hci_command_t *pcmd, const char *ps, bt_int len)
 Add string parameter to an HCI command.
 
bt_bool bt_hci_add_param_cod (bt_hci_command_t *pcmd, bt_long value)
 Add class of device parameter to an HCI command.
 
bt_bool bt_hci_add_param_linkkey (bt_hci_command_t *pcmd, const bt_linkkey_t *linkkey)
 Add link key parameter to an HCI command.
 
bt_bool bt_hci_get_param_byte (bt_hci_command_t *pcmd, bt_byte *pvalue, bt_int *offset)
 Get byte parameter from HCI command.
 
bt_bool bt_hci_get_param_int (bt_hci_command_t *pcmd, bt_int *pvalue, bt_int *poffset)
 Get int parameter from HCI command.
 
bt_bool bt_hci_get_param_long (bt_hci_command_t *pcmd, bt_long *pvalue, bt_int *poffset)
 Get long parameter from HCI command.
 
bt_bool bt_hci_get_param_bdaddr (bt_hci_command_t *pcm, bt_bdaddr_t *pvalue, bt_int *poffset)
 Get BD address parameter from HCI command.
 
bt_bool bt_hci_get_param_linkkey (bt_hci_command_t *pcmd, bt_byte *pvalue, bt_int *poffset)
 Get link key parameter from HCI command.
 
bt_bool bt_hci_get_evt_param_byte (bt_hci_event_t *pevt, bt_byte *pvalue, bt_int *poffset)
 Get byte parameter from HCI event.
 
bt_bool bt_hci_get_evt_param_int (bt_hci_event_t *pevt, bt_int *pvalue, bt_int *poffset)
 Get int parameter from HCI event.
 
bt_bool bt_hci_get_evt_param_long (bt_hci_event_t *pevt, bt_long *pvalue, bt_int *poffset)
 Get long parameter from HCI event.
 
bt_bool bt_hci_get_evt_param_bdaddr (bt_hci_event_t *pevt, bt_bdaddr_t *pvalue, bt_int *poffset)
 Get bd address parameter from HCI event.
 
bt_bool bt_hci_get_evt_param_devclass (bt_hci_event_t *pevt, bt_long *pvalue, bt_int *poffset)
 Get class of device parameter from HCI event.
 
bt_bool bt_hci_get_evt_param_linkkey (bt_hci_event_t *pevt, bt_linkkey_t *pvalue, bt_int *poffset)
 Get link key parameter from HCI event.
 
void bt_hci_init (void)
 Initialize the HCI layer. More...
 
void bt_hci_init_ex (bt_byte default_link_policy)
 Initialize the HCI layer. More...
 
bt_bool bt_hci_start (bt_hci_start_callback_fp callback, void *callback_param, bt_byte enable_scan)
 Start HCI layer. More...
 
void bt_hci_start_no_init (void)
 Start HCI layer without controller configuration. More...
 
void bt_hci_stop (bt_hci_stop_callback_fp callback, void *callback_param)
 Stop HCI layer. More...
 
bt_bool bt_hci_reset (bt_hci_cmd_callback_fp callback, void *callback_param)
 Reset controller. More...
 
bt_bool bt_hci_connect (bt_bdaddr_t *dest, bt_uint packet_type, bt_byte pg_scan_rpt_mode, bt_byte role_switch, bt_uint acl_config, bt_hci_connect_callback_fp callback, void *param)
 Connect to a remote device. More...
 
bt_bool bt_hci_connect_ex (bt_bdaddr_t *dest, bt_uint packet_type, bt_byte pg_scan_rpt_mode, bt_byte role_switch, bt_uint acl_config, bt_uint clock_offset, bt_hci_connect_callback_fp cb, void *param)
 Connect to a remote device. More...
 
bt_bool bt_hci_listen (bt_hci_connect_callback_fp cb, void *param)
 Listen for incoming connections. More...
 
bt_bool bt_hci_disconnect (bt_hci_conn_state_t *pconn)
 Abort connection.
 
bt_bool bt_hci_request_remote_name_ex (bt_bdaddr_t *pbdaddr, bt_byte pg_scan_rpt_mode, bt_int clock_offset, bt_hci_request_remote_name_callback_fp cb, void *cb_param)
 Request remote device's name. More...
 
bt_bool bt_hci_write_local_name (const char *device_name, bt_hci_cmd_callback_fp cb)
 Write local device name. More...
 
bt_bool bt_hci_write_local_name_ex (const char *device_name, bt_hci_cmd_callback_fp cb, void *callback_param)
 Write local device name. More...
 

Link control commands

The Link Control commands allow a Controller to control connections to other BR/EDR Controllers.

#define HCI_INQUIRY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0001)
 
#define HCI_INQUIRY_CANCEL   HCI_OPCODE(OGF_LINK_CONTROL, 0x0002)
 
#define HCI_PERIODIC_INQUIRY_MODE   HCI_OPCODE(OGF_LINK_CONTROL, 0x0003)
 
#define HCI_EXIT_PERIODIC_INQUIRY_MODE   HCI_OPCODE(OGF_LINK_CONTROL, 0x0004)
 
#define HCI_CREATE_CONNECTION   HCI_OPCODE(OGF_LINK_CONTROL, 0x0005)
 
#define HCI_DISCONNECT   HCI_OPCODE(OGF_LINK_CONTROL, 0x0006)
 
#define HCI_CREATE_CONNECTION_CANCEL   HCI_OPCODE(OGF_LINK_CONTROL, 0x0008)
 
#define HCI_ACCEPT_CONNECTION_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x0009)
 
#define HCI_REJECT_CONNECTION_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x000A)
 
#define HCI_LINK_KEY_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x000B)
 
#define HCI_LINK_KEY_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x000C)
 
#define HCI_PIN_CODE_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x000D)
 
#define HCI_PIN_CODE_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x000E)
 
#define HCI_CHANGE_CONNECTION_PACKET_TYPE   HCI_OPCODE(OGF_LINK_CONTROL, 0x000F)
 
#define HCI_AUTHENTICATION_REQUESTED   HCI_OPCODE(OGF_LINK_CONTROL, 0x0011)
 
#define HCI_SET_CONNECTION_ENCRYPTION   HCI_OPCODE(OGF_LINK_CONTROL, 0x0013)
 
#define HCI_CHANGE_CONNECTION_LINK_KEY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0015)
 
#define HCI_MASTER_LINK_KEY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0017)
 
#define HCI_REMOTE_NAME_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x0019)
 
#define HCI_REMOTE_NAME_REQUEST_CANCEL   HCI_OPCODE(OGF_LINK_CONTROL, 0x001A)
 
#define HCI_READ_REMOTE_SUPPORTED_FEATURES   HCI_OPCODE(OGF_LINK_CONTROL, 0x001B)
 
#define HCI_READ_REMOTE_EXTENDED_FEATURES   HCI_OPCODE(OGF_LINK_CONTROL, 0x001C)
 
#define HCI_READ_REMOTE_VERSION_INFORMATION   HCI_OPCODE(OGF_LINK_CONTROL, 0x001D)
 
#define HCI_READ_CLOCK_OFFSET   HCI_OPCODE(OGF_LINK_CONTROL, 0x001F)
 
#define HCI_READ_LMP_HANDLE   HCI_OPCODE(OGF_LINK_CONTROL, 0x0020)
 
#define HCI_SETUP_SYNCHRONOUS_CONNECTION   HCI_OPCODE(OGF_LINK_CONTROL, 0x0028)
 
#define HCI_ACCEPT_SYNCH_CONNECTION_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x0029)
 
#define HCI_REJECT_SYNCH_CONNECTION_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x002A)
 
#define HCI_IO_CAPABILITY_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x002B)
 
#define HCI_USER_CONFIRMATION_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x002C)
 
#define HCI_USER_CONFIRMATION_REQ_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x002D)
 
#define HCI_USER_PASSKEY_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x002E)
 
#define HCI_USER_PASSKEY_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x002F)
 
#define HCI_REMOTE_OOB_DATA_REQUEST_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0030)
 
#define HCI_REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0033)
 
#define HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LINK_CONTROL, 0x0034)
 
#define HCI_ENHANCED_SETUP_SYNCHRONOUS_CONNECTION   HCI_OPCODE(OGF_LINK_CONTROL, 0x003D)
 
#define HCI_ENHANCED_ACCEPT_SYNC_CONNECTION_REQUEST   HCI_OPCODE(OGF_LINK_CONTROL, 0x003E)
 

Link policy commands

The Link Policy Commands provide methods for the Host to affect how the Link Manager manages the piconet.

#define HCI_HOLD_MODE   HCI_OPCODE(OGF_LINK_POLICY, 0x0001)
 
#define HCI_SNIFF_MODE   HCI_OPCODE(OGF_LINK_POLICY, 0x0003)
 
#define HCI_EXIT_SNIFF_MODE   HCI_OPCODE(OGF_LINK_POLICY, 0x0004)
 
#define HCI_PARK_STATE   HCI_OPCODE(OGF_LINK_POLICY, 0x0005)
 
#define HCI_EXIT_PARK_STATE   HCI_OPCODE(OGF_LINK_POLICY, 0x0006)
 
#define HCI_QOS_SETUP   HCI_OPCODE(OGF_LINK_POLICY, 0x0007)
 
#define HCI_ROLE_DISCOVERY   HCI_OPCODE(OGF_LINK_POLICY, 0x0009)
 
#define HCI_SWITCH_ROLE   HCI_OPCODE(OGF_LINK_POLICY, 0x000B)
 
#define HCI_READ_LINK_POLICY_SETTINGS   HCI_OPCODE(OGF_LINK_POLICY, 0x000C)
 
#define HCI_WRITE_LINK_POLICY_SETTINGS   HCI_OPCODE(OGF_LINK_POLICY, 0x000D)
 
#define HCI_READ_DEFAULT_POLICY_SETTINGS   HCI_OPCODE(OGF_LINK_POLICY, 0x000E)
 
#define HCI_WRITE_DEFAULT_POLICY_SETTINGS   HCI_OPCODE(OGF_LINK_POLICY, 0x000F)
 
#define HCI_FLOW_SPECIFICATION   HCI_OPCODE(OGF_LINK_POLICY, 0x0010)
 
#define HCI_SNIFF_SUBRATING   HCI_OPCODE(OGF_LINK_POLICY, 0x0011)
 

Controller & Baseband commands

The Controller & Baseband Commands provide access and control to various capabilities of the Bluetooth hardware.

#define HCI_SET_EVENT_MASK   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0001)
 
#define HCI_RESET   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0003)
 
#define HCI_SET_EVENT_FILTER   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0005)
 
#define HCI_FLUSH   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0008)
 
#define HCI_READ_PIN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0009)
 
#define HCI_WRITE_PIN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x000A)
 
#define HCI_CREATE_NEW_UNIT_KEY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x000B)
 
#define HCI_READ_STORED_LINK_KEY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x000D)
 
#define HCI_WRITE_STORED_LINK_KEY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0011)
 
#define HCI_DELETE_STORED_LINK_KEY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0012)
 
#define HCI_WRITE_LOCAL_NAME   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0013)
 
#define HCI_READ_LOCAL_NAME   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0014)
 
#define HCI_READ_CONNECTION_ACCEPT_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0015)
 
#define HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0016)
 
#define HCI_READ_PAGE_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0017)
 
#define HCI_WRITE_PAGE_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0018)
 
#define HCI_READ_SCAN_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0019)
 
#define HCI_WRITE_SCAN_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001A)
 
#define HCI_READ_PAGE_SCAN_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001B)
 
#define HCI_WRITE_PAGE_SCAN_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001C)
 
#define HCI_READ_INQUIRY_SCAN_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001D)
 
#define HCI_WRITE_INQUIRY_SCAN_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001E)
 
#define HCI_READ_AUTHENTICATION_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x001F)
 
#define HCI_WRITE_AUTHENTICATION_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0020)
 
#define HCI_READ_ENCRYPTION_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0021)
 
#define HCI_WRITE_ENCRYPTION_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0022)
 
#define HCI_READ_CLASS_OF_DEVICE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0023)
 
#define HCI_WRITE_CLASS_OF_DEVICE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0024)
 
#define HCI_READ_VOICE_SETTING   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0025)
 
#define HCI_WRITE_VOICE_SETTING   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0026)
 
#define HCI_READ_AUTOMATIC_FLASH_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0027)
 
#define HCI_WRITE_AUTOMATIC_FLASH_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0028)
 
#define HCI_READ_NUM_BROADCST_RETR   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0029)
 
#define HCI_WRITE_NUM_BROADCST_RETR   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002A)
 
#define HCI_READ_HOLD_MODE_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002B)
 
#define HCI_WRITE_HOLD_MODE_ACTIVITY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002C)
 
#define HCI_READ_TRANSMIT_POWER_LEVEL   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002D)
 
#define HCI_READ_SYNC_FLOW_CONTROL_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002E)
 
#define HCI_WRITE_SYNC_FLOW_CONTROL_ENABLE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x002F)
 
#define HCI_SET_CTRL_TO_HOST_FLOW_CONTROL   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0031)
 
#define HCI_HOST_BUFFER_SIZE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0033)
 
#define HCI_HOST_NUM_OF_COMPLETED_PACKETS   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0035)
 
#define HCI_READ_LINK_SUPERVISION_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0036)
 
#define HCI_WRITE_LINK_SUPERVISION_TIMEOUT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0037)
 
#define HCI_READ_NUM_OF_SUPPORTED_IAC   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0038)
 
#define HCI_READ_CURRENT_IAC_LAP   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0039)
 
#define HCI_WRITE_CURRENT_IAC_LAP   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x003A)
 
#define HCI_READ_PAGE_SCAN_PERIOD_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x003B)
 
#define HCI_WRITE_PAGE_SCAN_PERIOD_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x003C)
 
#define HCI_SET_AFH_HOST_CHANNEL_CLASSIFICATION   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x003F)
 
#define HCI_READ_INQUIRY_SCAN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0042)
 
#define HCI_WRITE_INQUIRY_SCAN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0043)
 
#define HCI_READ_INQUIRY_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0044)
 
#define HCI_WRITE_INQUIRY_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0045)
 
#define HCI_READ_PAGE_SCAN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0046)
 
#define HCI_WRITE_PAGE_SCAN_TYPE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0047)
 
#define HCI_READ_AFH_CHANNEL_ASSESSMENT_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0048)
 
#define HCI_WRITE_AFH_CHANNEL_ASSESSMENT_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0049)
 
#define HCI_READ_EXTENDED_INQUIRY_RESPONSE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0051)
 
#define HCI_WRITE_EXTENDED_INQUIRY_RESPONSE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0052)
 
#define HCI_READ_REFRESH_ENCRYPTION_KEY   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0053)
 
#define HCI_READ_SIMPLE_PAIRING_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0055)
 
#define HCI_WRITE_SIMPLE_PAIRING_MODE   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0056)
 
#define HCI_READ_LOCAL_OOB_DATA   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0057)
 
#define HCI_READ_INQUIRY_RESPONSE_TX_POWER_LEVEL   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0058)
 
#define HCI_WRITE_INQUIRY_TX_POWER_LEVEL   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0059)
 
#define HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x005A)
 
#define HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x005B)
 
#define HCI_ENHANCED_FLUSH   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x005F)
 
#define HCI_SEND_KEY_PRESS_NOTIFICATION   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x0060)
 
#define HCI_READ_LE_HOST_SUPPORT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x006C)
 
#define HCI_WRITE_LE_HOST_SUPPORT   HCI_OPCODE(OGF_CTRL_BASEBAND, 0x006D)
 

Informational Parameters

The Informational Parameters are fixed by the manufacturer of the Bluetooth hardware. These parameters provide information about the BR/EDR Controller and the capabilities of the Link Manager and Baseband in the BR/EDR Controller and PAL in the AMP Controller. The host device cannot modify any of these parameters.

#define HCI_READ_LOCAL_VERSION_INFORMATION   HCI_OPCODE(OGF_INFORMATION, 0x0001)
 
#define HCI_READ_LOCAL_SUPPORTED_COMMANDS   HCI_OPCODE(OGF_INFORMATION, 0x0002)
 
#define HCI_READ_LOCAL_SUPPORTED_FEATURES   HCI_OPCODE(OGF_INFORMATION, 0x0003)
 
#define HCI_READ_LOCAL_EXTENDED_FEATURES   HCI_OPCODE(OGF_INFORMATION, 0x0004)
 
#define HCI_READ_BUFFER_SIZE   HCI_OPCODE(OGF_INFORMATION, 0x0005)
 
#define HCI_READ_BD_ADDR   HCI_OPCODE(OGF_INFORMATION, 0x0009)
 

Status Parameters

The Controller modifies all status parameters. These parameters provide information about the current state of the Link Manager and Baseband in the BR/EDR Controller and the PAL in an AMP Controller. The host device cannot modify any of these parameters other than to reset certain specific parameters.

#define HCI_READ_FAILED_CONTACT_COUNTER   HCI_OPCODE(OGF_STATUS, 0x0001)
 
#define HCI_RESET_FAILED_CONTACT_COUNTER   HCI_OPCODE(OGF_STATUS, 0x0002)
 
#define HCI_READ_LINK_QUALITY   HCI_OPCODE(OGF_STATUS, 0x0003)
 
#define HCI_READ_RSSI   HCI_OPCODE(OGF_STATUS, 0x0005)
 
#define HCI_READ_AFH_CHANNEL_MAP   HCI_OPCODE(OGF_STATUS, 0x0006)
 
#define HCI_READ_CLOCK_COMMAND   HCI_OPCODE(OGF_STATUS, 0x0007)
 

Testing Commands

The Testing commands are used to provide the ability to test various functional capabilities of the Bluetooth hardware.

#define HCI_READ_LOOPBACK_MODE   HCI_OPCODE(OGF_TESTING, 0x0001)
 
#define HCI_WRITE_LOOPBACK_MODE   HCI_OPCODE(OGF_TESTING, 0x0002)
 
#define HCI_ENABLE_DEVICE_UNDER_TEST_MODE   HCI_OPCODE(OGF_TESTING, 0x0003)
 
#define HCI_WRITE_SIMPLE_PAIRING_DEBUG_MODE   HCI_OPCODE(OGF_TESTING, 0x0004)
 

LE controller commands

The LE Controller Commands provide access and control to various capabilities of the Bluetooth hardware, as well as methods for the Host to affect how the Link Layer manages the piconet, and controls connections.

#define HCI_LE_SET_EVENT_MASK   HCI_OPCODE(OGF_LE, 0x0001)
 
#define HCI_LE_READ_BUFFER_SIZE   HCI_OPCODE(OGF_LE, 0x0002)
 
#define HCI_LE_READ_LOCAL_SUPPORTED_FEATURES   HCI_OPCODE(OGF_LE, 0x0003)
 
#define HCI_LE_SET_RANDOM_ADDRESS   HCI_OPCODE(OGF_LE, 0x0005)
 
#define HCI_LE_SET_ADVERTISING_PARAMETERS   HCI_OPCODE(OGF_LE, 0x0006)
 
#define HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER   HCI_OPCODE(OGF_LE, 0x0007)
 
#define HCI_LE_SET_ADVERTISING_DATA   HCI_OPCODE(OGF_LE, 0x0008)
 
#define HCI_LE_SET_SCAN_RESPONSE_DATA   HCI_OPCODE(OGF_LE, 0x0009)
 
#define HCI_LE_SET_ADVERTISE_ENABLE   HCI_OPCODE(OGF_LE, 0x000A)
 
#define HCI_LE_SET_SCAN_PARAMETERS   HCI_OPCODE(OGF_LE, 0x000B)
 
#define HCI_LE_SET_SCAN_ENABLE   HCI_OPCODE(OGF_LE, 0x000C)
 
#define HCI_LE_CREATE_CONNECTION   HCI_OPCODE(OGF_LE, 0x000D)
 
#define HCI_LE_CREATE_CONNECTION_CANCEL   HCI_OPCODE(OGF_LE, 0x000E)
 
#define HCI_LE_READ_WHITE_LIST_SIZE   HCI_OPCODE(OGF_LE, 0x000F)
 
#define HCI_LE_CLEAR_WHITE_LIST   HCI_OPCODE(OGF_LE, 0x0010)
 
#define HCI_LE_ADD_DEVICE_TO_WHITE_LIST   HCI_OPCODE(OGF_LE, 0x0011)
 
#define HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST   HCI_OPCODE(OGF_LE, 0x0012)
 
#define HCI_LE_CONNECTION_UPDATE   HCI_OPCODE(OGF_LE, 0x0013)
 
#define HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION   HCI_OPCODE(OGF_LE, 0x0014)
 
#define HCI_LE_READ_CHANNEL_MAP   HCI_OPCODE(OGF_LE, 0x0015)
 
#define HCI_LE_READ_REMOTE_USED_FEATURES   HCI_OPCODE(OGF_LE, 0x0016)
 
#define HCI_LE_ENCRYPT   HCI_OPCODE(OGF_LE, 0x0017)
 
#define HCI_LE_RAND   HCI_OPCODE(OGF_LE, 0x0018)
 
#define HCI_LE_START_ENCRYPTION   HCI_OPCODE(OGF_LE, 0x0019)
 
#define HCI_LE_LONG_TERM_KEY_REQUEST_REPLY   HCI_OPCODE(OGF_LE, 0x001A)
 
#define HCI_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LE, 0x001B)
 
#define HCI_LE_READ_SUPPORTED_STATES   HCI_OPCODE(OGF_LE, 0x001C)
 
#define HCI_LE_RECEIVE_TEST   HCI_OPCODE(OGF_LE, 0x001D)
 
#define HCI_LE_TRANSMITTER_TEST   HCI_OPCODE(OGF_LE, 0x001E)
 
#define HCI_LE_TEST_END   HCI_OPCODE(OGF_LE, 0x001F)
 
#define HCI_LE_REMOTE_CONN_PARAM_REQUEST_REPLY   HCI_OPCODE(OGF_LE, 0x0020)
 
#define HCI_LE_REMOTE_CONN_PARAM_REQUEST_NEGATIVE_REPLY   HCI_OPCODE(OGF_LE, 0x0021)
 
#define HCI_LE_SET_DATA_LENGTH   HCI_OPCODE(OGF_LE, 0x0022)
 
#define HCI_LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH   HCI_OPCODE(OGF_LE, 0x0023)
 
#define HCI_LE_WRITE_SUGGESTED_DEFAULT_DATA_LENGTH   HCI_OPCODE(OGF_LE, 0x0024)
 
#define HCI_LE_READ_LOCAL_P_256_PUBLIC_KEY   HCI_OPCODE(OGF_LE, 0x0025)
 
#define HCI_LE_GENERATE_DHKEY   HCI_OPCODE(OGF_LE, 0x0026)
 
#define HCI_LE_ADD_DEVICE_TO_RESOLVING_LIST   HCI_OPCODE(OGF_LE, 0x0027)
 
#define HCI_LE_REMOVE_DEVICE_FROM_RESOLVING_LIST   HCI_OPCODE(OGF_LE, 0x0028)
 
#define HCI_LE_CLEAR_RESOLVING_LIST   HCI_OPCODE(OGF_LE, 0x0029)
 
#define HCI_LE_READ_RESOLVING_LIST_SIZE   HCI_OPCODE(OGF_LE, 0x002A)
 
#define HCI_LE_READ_PEER_RESOLVABLE_ADDRESS   HCI_OPCODE(OGF_LE, 0x002B)
 
#define HCI_LE_READ_LOCAL_RESOLVABLE_ADDRESS   HCI_OPCODE(OGF_LE, 0x002C)
 
#define HCI_LE_SET_ADDRESS_RESOLUTION_ENABLE   HCI_OPCODE(OGF_LE, 0x002D)
 
#define HCI_LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT   HCI_OPCODE(OGF_LE, 0x002E)
 
#define HCI_LE_READ_MAXIMUM_DATA_LENGTH   HCI_OPCODE(OGF_LE, 0x002F)
 
#define HCI_LE_READ_PHY   HCI_OPCODE(OGF_LE, 0x0030)
 
#define HCI_LE_SET_DEFAULT_PHY   HCI_OPCODE(OGF_LE, 0x0031)
 
#define HCI_LE_SET_PHY   HCI_OPCODE(OGF_LE, 0x0032)
 
#define HCI_LE_RECEIVER_TEST_V2   HCI_OPCODE(OGF_LE, 0x0033)
 
#define HCI_LE_TRANSMITTER_TEST_V2   HCI_OPCODE(OGF_LE, 0x0034)
 
#define HCI_LE_SET_ADVERTISING_SET_RANDOM_ADDRESS   HCI_OPCODE(OGF_LE, 0x0035)
 
#define HCI_LE_SET_EXTENDED_ADVERTISING_PARAMETERS   HCI_OPCODE(OGF_LE, 0x0036)
 
#define HCI_LE_SET_EXTENDED_ADVERTISING_DATA   HCI_OPCODE(OGF_LE, 0x0037)
 
#define HCI_LE_SET_EXTENDED_SCAN_RESPONSE_DATA   HCI_OPCODE(OGF_LE, 0x0038)
 
#define HCI_LE_SET_EXTENDED_ADVERTISING_ENABLE   HCI_OPCODE(OGF_LE, 0x0039)
 
#define HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH   HCI_OPCODE(OGF_LE, 0x003A)
 
#define HCI_LE_READ_NUMBER_OF_SUPPORTED_ADV_SETS   HCI_OPCODE(OGF_LE, 0x003B)
 
#define HCI_LE_REMOVE_ADVERTISING_SET   HCI_OPCODE(OGF_LE, 0x003C)
 
#define HCI_LE_CLEAR_ADVERTISING_SETS   HCI_OPCODE(OGF_LE, 0x003D)
 
#define HCI_LE_SET_PERIODIC_ADVERTISING_PARAMETERS   HCI_OPCODE(OGF_LE, 0x003E)
 
#define HCI_LE_SET_PERIODIC_ADVERTISING_DATA   HCI_OPCODE(OGF_LE, 0x003F)
 
#define HCI_LE_SET_PERIODIC_ADVERTISING_ENABLE   HCI_OPCODE(OGF_LE, 0x0040)
 
#define HCI_LE_SET_EXTENDED_SCAN_PARAMETERS   HCI_OPCODE(OGF_LE, 0x0041)
 
#define HCI_LE_SET_EXTENDED_SCAN_ENABLE   HCI_OPCODE(OGF_LE, 0x0042)
 
#define HCI_LE_EXTENDED_CREATE_CONNECTION   HCI_OPCODE(OGF_LE, 0x0043)
 
#define HCI_LE_PERIODIC_ADVERTISING_CREATE_SYNC   HCI_OPCODE(OGF_LE, 0x0044)
 
#define HCI_LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL   HCI_OPCODE(OGF_LE, 0x0045)
 
#define HCI_LE_PERIODIC_ADVERTISING_TERMINATE_SYNC   HCI_OPCODE(OGF_LE, 0x0046)
 
#define HCI_LE_ADD_DEVICE_TO_PERIODIC_ADVERTISER_LIST   HCI_OPCODE(OGF_LE, 0x0047)
 
#define HCI_LE_REMOVE_DEVICE_FROM_PERIODIC_ADV_LIST   HCI_OPCODE(OGF_LE, 0x0048)
 
#define HCI_LE_CLEAR_PERIODIC_ADVERTISER_LIST   HCI_OPCODE(OGF_LE, 0x0049)
 
#define HCI_LE_READ_PERIODIC_ADVERTISER_LIST_SIZE   HCI_OPCODE(OGF_LE, 0x004A)
 
#define HCI_LE_READ_TRANSMIT_POWER   HCI_OPCODE(OGF_LE, 0x004B)
 
#define HCI_LE_READ_RF_PATH_COMPENSATION   HCI_OPCODE(OGF_LE, 0x004C)
 
#define HCI_LE_WRITE_RF_PATH_COMPENSATION   HCI_OPCODE(OGF_LE, 0x004D)
 
#define HCI_LE_SET_PRIVACY_MODE   HCI_OPCODE(OGF_LE, 0X004E)
 
#define HCI_LE_RECEIVER_TEST_V3   HCI_OPCODE(OGF_LE, 0X004F)
 
#define HCI_LE_TRANSMITTER_TEST_V3   HCI_OPCODE(OGF_LE, 0X0050)
 
#define HCI_LE_SET_CONNECTIONLESS_CTE_TRANSMIT_PARAMS   HCI_OPCODE(OGF_LE, 0X0051)
 
#define HCI_LE_SET_CONNECTIONLESS_CTE_TRANSMIT_ENABLE   HCI_OPCODE(OGF_LE, 0X0052)
 
#define HCI_LE_SET_CONNECTIONLESS_IQ_SAMPLING_ENABLE   HCI_OPCODE(OGF_LE, 0X0053)
 
#define HCI_LE_SET_CONNECTION_CTE_RECEIVE_PARAMS   HCI_OPCODE(OGF_LE, 0X0054)
 
#define HCI_LE_SET_CONNECTION_CTE_TRANSMIT_PARAMS   HCI_OPCODE(OGF_LE, 0X0055)
 
#define HCI_LE_CONNECTION_CTE_REQUEST_ENABLE   HCI_OPCODE(OGF_LE, 0X0056)
 
#define HCI_LE_CONNECTION_CTE_RESPONSE_ENABLE   HCI_OPCODE(OGF_LE, 0X0057)
 
#define HCI_LE_READ_ANTENNA_INFORMATION   HCI_OPCODE(OGF_LE, 0X0058)
 
#define HCI_LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE   HCI_OPCODE(OGF_LE, 0X0059)
 
#define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER   HCI_OPCODE(OGF_LE, 0X005A)
 
#define HCI_LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER   HCI_OPCODE(OGF_LE, 0X005B)
 
#define HCI_LE_SET_PERIODIC_ADV_SYNC_TRANSFER_PARAMS   HCI_OPCODE(OGF_LE, 0X005C)
 
#define HCI_LE_SET_DEFAULT_PERIODIC_ADV_SYNC_TX_PARAMS   HCI_OPCODE(OGF_LE, 0X005D)
 
#define HCI_LE_GENERATE_DHKEY_V2   HCI_OPCODE(OGF_LE, 0X005E)
 
#define HCI_LE_MODIFY_SLEEP_CLOCK_ACCURACY   HCI_OPCODE(OGF_LE, 0X005F)
 
#define HCI_LE_READ_ISO_TX_SYNC   HCI_OPCODE(OGF_LE, 0X0061)
 
#define HCI_LE_SET_CIG_PARAMETERS   HCI_OPCODE(OGF_LE, 0X0062)
 
#define HCI_LE_SET_CIG_PARAMETERS_TEST   HCI_OPCODE(OGF_LE, 0X0063)
 
#define HCI_LE_CREATE_CIS   HCI_OPCODE(OGF_LE, 0X0064)
 
#define HCI_LE_REMOVE_CIG   HCI_OPCODE(OGF_LE, 0X0065)
 
#define HCI_LE_ACCEPT_CIS_REQUEST   HCI_OPCODE(OGF_LE, 0X0066)
 
#define HCI_LE_REJECT_CIS_REQUEST   HCI_OPCODE(OGF_LE, 0X0067)
 
#define HCI_LE_CREATE_BIG   HCI_OPCODE(OGF_LE, 0X0068)
 
#define HCI_LE_CREATE_BIG_TEST   HCI_OPCODE(OGF_LE, 0X0069)
 
#define HCI_LE_TERMINATE_BIG   HCI_OPCODE(OGF_LE, 0X006A)
 
#define HCI_LE_BIG_CREATE_SYNC   HCI_OPCODE(OGF_LE, 0X006B)
 
#define HCI_LE_BIG_TERMINATE_SYNC   HCI_OPCODE(OGF_LE, 0X006C)
 
#define HCI_LE_REQUEST_PEER_SCA   HCI_OPCODE(OGF_LE, 0X006D)
 
#define HCI_LE_SETUP_ISO_DATA_PATH   HCI_OPCODE(OGF_LE, 0X006E)
 
#define HCI_LE_REMOVE_ISO_DATA_PATH   HCI_OPCODE(OGF_LE, 0X006F)
 
#define HCI_LE_ISO_TRANSMIT_TEST   HCI_OPCODE(OGF_LE, 0X0079)
 
#define HCI_LE_ISO_RECEIVE_TEST   HCI_OPCODE(OGF_LE, 0X0071)
 
#define HCI_LE_ISO_READ_TEST_COUNTERS   HCI_OPCODE(OGF_LE, 0X0072)
 
#define HCI_LE_ISO_TEST_END   HCI_OPCODE(OGF_LE, 0X0073)
 
#define HCI_LE_SET_HOST_FEATURE   HCI_OPCODE(OGF_LE, 0X0074)
 
#define HCI_LE_READ_ISO_LINK_QUALITY   HCI_OPCODE(OGF_LE, 0X0075)
 
#define HCI_LE_ENHANCED_READ_TRANSMIT_POWER_LEVEL   HCI_OPCODE(OGF_LE, 0X0076)
 
#define HCI_LE_READ_REMOTE_TRANSMIT_POWER_LEVEL   HCI_OPCODE(OGF_LE, 0X0077)
 
#define HCI_LE_SET_PATH_LOSS_REPORTING_PARAMETERS   HCI_OPCODE(OGF_LE, 0X0078)
 
#define HCI_LE_SET_PATH_LOSS_REPORTING_ENABLE   HCI_OPCODE(OGF_LE, 0X0079)
 
#define HCI_LE_SET_TRANSMIT_POWER_REPORTING_ENABLE   HCI_OPCODE(OGF_LE, 0X007A)
 

Events

#define HCI_EVT_INQUIRY_COMPLETE   0x01
 
#define HCI_EVT_INQUIRY_RESULT   0x02
 
#define HCI_EVT_CONNECTION_COMPLETE   0x03
 
#define HCI_EVT_CONNECTION_REQUEST   0x04
 
#define HCI_EVT_DISCONNECTION_COMPLETE   0x05
 
#define HCI_EVT_AUTHENTICATION_COMPLETE   0x06
 
#define HCI_EVT_REMOTE_NAME_REQUEST_COMPLETE   0x07
 
#define HCI_EVT_ENCRYPTION_CHANGE   0x08
 
#define HCI_EVT_CHANGE_CONN_LINK_COMPLETE   0x09
 
#define HCI_EVT_MASTER_LINK_KEY_COMPLETE   0x0A
 
#define HCI_EVT_READ_RMT_SUP_FEATURES_COMP   0x0B
 
#define HCI_EVT_READ_RMT_VERSION_INFO_COMP   0x0C
 
#define HCI_EVT_QOS_SETUP_COMPLETE   0x0D
 
#define HCI_EVT_COMMAND_COMPLETE   0x0E
 
#define HCI_EVT_COMMAND_STATUS   0x0F
 
#define HCI_EVT_HARDWARE_ERROR   0x10
 
#define HCI_EVT_FLUSH_OCCURED   0x11
 
#define HCI_EVT_ROLE_CHANGE   0x12
 
#define HCI_EVT_NUM_OF_COMPLETED_PACKETS   0x13
 
#define HCI_EVT_MODE_CHANGE   0x14
 
#define HCI_EVT_RETURN_LINK_KEYS   0x15
 
#define HCI_EVT_PIN_CODE_REQUEST   0x16
 
#define HCI_EVT_LINK_KEY_REQUEST   0x17
 
#define HCI_EVT_LINK_KEY_NOTIFICATION   0x18
 
#define HCI_EVT_LOOPBACK_COMMAND   0x19
 
#define HCI_EVT_DATA_BUFFER_OVERFLOW   0x1A
 
#define HCI_EVT_MAX_SLOTS_CHANGE   0x1B
 
#define HCI_EVT_READ_CLOCK_OFFSET_COMPLETE   0x1C
 
#define HCI_EVT_CONN_PACKET_TYPE_CHANGED   0x1D
 
#define HCI_EVT_QOS_VIOLATION   0x1E
 
#define HCI_EVT_PAGE_SCAN_REPET_MODE_CHANGE   0x20
 
#define HCI_EVT_FLOW_SPECIFICATION_COMPLETE   0x21
 
#define HCI_EVT_INQUIRY_RESULT_WITH_RSSI   0x22
 
#define HCI_EVT_READ_RMT_EXT_FEATURES_COMP   0x23
 
#define HCI_EVT_SYNCH_CONNECTION_COMPLETE   0x2C
 
#define HCI_EVT_SYNCH_CONNECTION_CHANGED   0x2D
 
#define HCI_EVT_SNIFF_SUBRATING   0x2E
 
#define HCI_EVT_EXTENDED_INQUIRY_RESULT   0x2F
 
#define HCI_EVT_ENCRYPTION_KEY_REFRESH_COMPLETE   0x30
 
#define HCI_EVT_IO_CAPABILITY_REQUEST   0x31
 
#define HCI_EVT_IO_CAPABILITY_RESPONSE   0x32
 
#define HCI_EVT_USER_CONFIRMATION_REQUEST   0x33
 
#define HCI_EVT_USER_PASSKEY_REQUEST   0x34
 
#define HCI_EVT_REMOTE_OOB_DATA_REQUEST   0x35
 
#define HCI_EVT_SIMPLE_PAIRING_COMPLETE   0x36
 
#define HCI_EVT_LINK_SUPERVISION_TO_CHANGED   0x38
 
#define HCI_EVT_ENHANCED_FLUSH_COMPLETE   0x39
 
#define HCI_EVT_USER_PASSKEY_NOTIFICATION   0x3B
 
#define HCI_EVT_KEYPRESS_NOTIFICATION   0x3C
 
#define HCI_EVT_RMT_HOST_SUPP_FEATURES_NTF   0x3D
 
#define HCI_EVT_LE_META_EVENT   0x3E
 
#define HCI_EVT_LAST   HCI_EVT_LE_META_EVENT
 
#define HCI_EVT_FIRST   HCI_EVT_INQUIRY_COMPLETE
 

Errors

#define HCI_ERR_SUCCESS   0x00
 
#define HCI_SUCCESS   0x00
 
#define HCI_ERR_UNKNOWN_COMMAND   0x01
 
#define HCI_ERR_UNKNOWN_CONNECTION_ID   0x02
 
#define HCI_ERR_HARDWARE_FAILURE   0x03
 
#define HCI_ERR_PAGE_TIMEOUT   0x04
 
#define HCI_ERR_AUTHENTICATION_FAILURE   0x05
 
#define HCI_ERR_PIN_OR_KEY_MISSING   0x06
 
#define HCI_ERR_MEMORY_CAPACITY_EXCEEDED   0x07
 
#define HCI_ERR_CONNECTION_TIMEOUT   0x08
 
#define HCI_ERR_CONNECTION_LIMIT_EXCEEDED   0x09
 
#define HCI_ERR_SCO_CONN_LIMIT_EXCEEDED   0x0a
 
#define HCI_ERR_ACL_CONN_ALREADY_EXISTS   0x0b
 
#define HCI_ERR_COMMAND_DISALLOWED   0x0c
 
#define HCI_ERR_CONN_REJECT_LIMITED_RESOURCES   0x0d
 
#define HCI_ERR_CONN_REJECT_SECURITY_REASONS   0x0e
 
#define HCI_ERR_CONN_REJECTUNACCEPTABLE_ADDR   0x0f
 
#define HCI_ERR_CONN_ACCEPT_TIMEOUT_EXCEEDED   0x10
 
#define HCI_ERR_UNSUPPORTED_FEATURE_OR_PARAM_VALUE   0x11
 
#define HCI_ERR_INVALID_PARAMETERS   0x12
 
#define HCI_ERR_CONN_TERMINATED_BY_REMOTE_HOST   0x13
 
#define HCI_ERR_CONN_TERMINATED_BY_LOCAL_HOST   0x16
 
#define HCI_ERR_PAIRING_NOT_ALLOWED   0x18
 
#define HCI_ERR_UNSPECIFIED   0x1F
 
#define HCI_ERR_SIMPLE_PAIRING_NOT_SUPPORTED   0x37
 
#define HCI_ERR_CONN_FAILED   0x3E
 
#define HCI_ERR_CANCELLED   0x8001
 

Detailed Description

The Host Controller Interface (HCI) provides a uniform interface method of accessing a Bluetooth Controller's capabilities.

This module describes function and data structures used to send HCI commands and receive responses.

Macro Definition Documentation

#define bt_hci_request_remote_name (   pbdaddr,
  pg_scan_rpt_mode,
  clock_offset,
  cb 
)    bt_hci_request_remote_name_ex(pbdaddr, pg_scan_rpt_mode, clock_offset, cb, NULL)

Request remote device's name.

The function is used to obtain the user-friendly name of another BR/EDR Controller.

Parameters
pbaddrBluetooth address of the remote device.
pg_scan_rpt_modeThe Page Scan Repetition mode supported by the remote device.
clock_offsetThe difference between local controller's clock and the clock of the remote device.
cbPointer to a callback function that is called when the name has been received.
Returns
  • TRUE when an HCI command buffer has been allocated and added to the send queue.
  • FALSE otherwise. The callback function is not called in this case.

Typedef Documentation

typedef void(* bt_hci_connect_callback_fp) (bt_byte status, bt_hci_conn_state_t *pconn, void *param)

HCI connect callback.

This typedef defines a type for the callback function that is called when HCI connect operation initiated by a call to bt_hci_connect() is complete.

Parameters
statusOperation status. It is 0 if connection was successfully established.
pconnpointer to a structure representing the established connection.
parampointer to arbitrary data passed to the bt_hci_connect() function through its param parameter.
typedef void(* bt_hci_disconnect_callback_fp) (bt_byte status, bt_byte reason, bt_hci_conn_state_t *pconn, void *param)

HCI disconnect callback.

This typedef defines a type for the callback function that is called when an HCI connection has been terminated.

Parameters
statusOperation status. It is 0 if connection has been successfully terminated.
reasonReason for disconnection.
pconnpointer to a structure representing the connection.
parampointer to arbitrary data associated with an event listener.
typedef void(* bt_hci_start_callback_fp) (bt_bool success, void *param)

HCI initialization callback.

This typedef defines a function pointer type for the HCI initialization callback functions. Such a function must be passed to the bt_hci_start() function.

Parameters
successSpecifies whether HCI initialization succeeded or not.
typedef void(* bt_hci_stop_callback_fp) (void *param)

HCI stop callback.

This typedef defines a function pointer type for the HCI stop callback functions. Such a function must be passed to the bt_hci_stop() function.

Function Documentation

bt_bool bt_hci_connect ( bt_bdaddr_t *  dest,
bt_uint  packet_type,
bt_byte  pg_scan_rpt_mode,
bt_byte  role_switch,
bt_uint  acl_config,
bt_hci_connect_callback_fp  callback,
void *  param 
)

Connect to a remote device.

This function tries to establish an HCI connection with a remote device specified by the Bluetooth address dest. Upon completion, the callback function specified by the callback parameter is called.

Parameters
destBluetooth address of the remote device.
packet_type
role_switch
acl_config
callbackPointer to a callback function that is called when the connect operation completes.
paramPointer to arbitrary data that is to be passed to the callback function.
Returns
  • TRUE when the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_hci_connect_ex ( bt_bdaddr_t *  dest,
bt_uint  packet_type,
bt_byte  pg_scan_rpt_mode,
bt_byte  role_switch,
bt_uint  acl_config,
bt_uint  clock_offset,
bt_hci_connect_callback_fp  cb,
void *  param 
)

Connect to a remote device.

This function tries to establish an HCI connection with a remote device specified by the Bluetooth address dest. Upon completion, the callback function specified by the callback parameter is called.

Parameters
destBluetooth address of the remote device.
packet_type
role_switch
acl_config
clock_offset
callbackPointer to a callback function that is called when the connect operation completes.
paramPointer to arbitrary data that is to be passed to the callback function.
Returns
  • TRUE when the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
void bt_hci_init ( void  )

Initialize the HCI layer.

This function initializes all internal variables of the HCI layer. The application, unless it's going to use only HCI layer, does not need to call this function as it is implicitly called by bt_sys_init.

This function essentially calls bt_hci_init_ex(HCI_LINK_POLICY_ENABLE_ALL) so all link policy setting are enabled.

void bt_hci_init_ex ( bt_byte  default_link_policy)

Initialize the HCI layer.

This function initializes all internal variables of the HCI layer. The application, unless it's going to use only HCI layer, does not need to call this function as it is implicitly called by bt_sys_init_ex.

Parameters
default_link_policydefault link policy settings. This is a bitmask that defines the initial value of the link policy settings for all new BR/EDR connections. This value can be a combination of the following values:
  • HCI_LINK_POLICY_ENABLE_ROLE_SWITCH
  • HCI_LINK_POLICY_ENABLE_HOLD_MODE
  • HCI_LINK_POLICY_ENABLE_SNIFF_MODE
  • HCI_LINK_POLICY_ENABLE_PARK_STATE
To enable all settings pass HCI_LINK_POLICY_ENABLE_ALL.
bt_bool bt_hci_listen ( bt_hci_connect_callback_fp  cb,
void *  param 
)

Listen for incoming connections.

Parameters
callbackPointer to a callback function that is called when a new incoming connection has been established.
paramPointer to arbitrary data that is to be passed to the callback function.
Returns
  • TRUE when the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_hci_request_remote_name_ex ( bt_bdaddr_t *  pbdaddr,
bt_byte  pg_scan_rpt_mode,
bt_int  clock_offset,
bt_hci_request_remote_name_callback_fp  cb,
void *  cb_param 
)

Request remote device's name.

The function is used to obtain the user-friendly name of another BR/EDR Controller.

Parameters
pbaddrBluetooth address of the remote device.
pg_scan_rpt_modeThe Page Scan Repetition mode supported by the remote device.
clock_offsetThe difference between local controller's clock and the clock of the remote device.
cbPointer to a callback function that is called when the name has been received.
paramPointer to arbitrary data that is to be passed to the callback function.
Returns
  • TRUE when an HCI command buffer has been allocated and added to the send queue.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_hci_reset ( bt_hci_cmd_callback_fp  callback,
void *  callback_param 
)

Reset controller.

This function resets the BT controller.

Parameters
callbackCompletion callback. Called when the controller has been reset.
callback_paramA pointer to arbitrary data to be passed to the callback callback.
bt_bool bt_hci_start ( bt_hci_start_callback_fp  callback,
void *  callback_param,
bt_byte  enable_scan 
)

Start HCI layer.

This function starts the HCI layer of the stack. Starting the HCI layer consists essentially of two steps:

  1. Make the HCI transport receive packets from the controller. This results in a call to bt_oem_recv.
  2. Reset and configure the controller.

Upon completion of controller initialization the callback function passed in the callback parameter is called.

Parameters
callbackCompletion callback. Called when controller initialization is complete.
callback_paramA pointer to arbitrary data to be passed to the callback callback.
enable_scanThis is a bitmask that defines which scans are enabled during the controller configuration. This value can be a combination of the following values:
  • HCI_SCAN_INQUIRY (the controller is discoverable)
  • HCI_SCAN_PAGE (the controller is connectable)
Returns
  • TRUE when the function succeeds.
  • FALSE otherwise. The callback function is not called in this case.
void bt_hci_start_no_init ( void  )

Start HCI layer without controller configuration.

This function is similar to bt_hci_start but unlike the former it does not perform the controller configuration. I.e., bt_hci_start_no_init simply calls the HCI transport and makes it receive packets from the controller. The main purpose of this function is make the HCI transport ready to exchange packets if controller needs some vendor specific configuration before it can be used with the stack. E.g., controllers based on CRS8811 chip need loading various values that configure its operating mode using CSR's proprietary protocol. So the application after configuring the HCI transport would call bt_hci_init(), bt_hci_start_no_init() and then load configuration values. Once the vendor specific configuration is done, the application will re-initialize the HCI transport and perform full start of the stack with bt_sys_init() and bt_sys_start().

void bt_hci_stop ( bt_hci_stop_callback_fp  callback,
void *  callback_param 
)

Stop HCI layer.

This function makes the HCI layer inoperable. After this call the application must perform the full reset of the HCI transport and stack.

Parameters
callbackCompletion callback. Called when the HCI layer has been stopped.
callback_paramA pointer to arbitrary data to be passed to the callback callback.
bt_bool bt_hci_write_local_name ( const char *  device_name,
bt_hci_cmd_callback_fp  cb 
)

Write local device name.

The Write_Local_Name command provides the ability to modify the user friendly name for the BR/EDR Controller.

Parameters
device_nameThe user friendly name for the BR/EDR Controller
cbPointer to a callback function that is called when the name has been set.
Returns
  • TRUE when an HCI command buffer has been allocated and added to the send queue.
  • FALSE otherwise. The callback function is not called in this case.
bt_bool bt_hci_write_local_name_ex ( const char *  device_name,
bt_hci_cmd_callback_fp  cb,
void *  callback_param 
)

Write local device name.

The Write_Local_Name command provides the ability to modify the user friendly name for the BR/EDR Controller.

Parameters
device_nameThe user friendly name for the BR/EDR Controller
cbPointer to a callback function that is called when the name has been set.
paramPointer to arbitrary data that is to be passed to the callback function.
Returns
  • TRUE when an HCI command buffer has been allocated and added to the send queue.
  • FALSE otherwise. The callback function is not called in this case.