bt_interface_t Struct Reference

#include <bluetooth.h>

Data Fields

size_t size
int(* init )(bt_callbacks_t *callbacks)
int(* enable )(bool guest_mode)
int(* disable )(void)
void(* cleanup )(void)
int(* get_adapter_properties )(void)
int(* get_adapter_property )(bt_property_type_t type)
int(* set_adapter_property )(const bt_property_t *property)
int(* get_remote_device_properties )(bt_bdaddr_t *remote_addr)
int(* get_remote_device_property )(bt_bdaddr_t *remote_addr, bt_property_type_t type)
int(* set_remote_device_property )(bt_bdaddr_t *remote_addr, const bt_property_t *property)
int(* get_remote_service_record )(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
int(* get_remote_services )(bt_bdaddr_t *remote_addr)
int(* start_discovery )(void)
int(* cancel_discovery )(void)
int(* create_bond )(const bt_bdaddr_t *bd_addr, int transport)
int(* create_bond_out_of_band )(const bt_bdaddr_t *bd_addr, int transport, const bt_out_of_band_data_t *oob_data)
int(* remove_bond )(const bt_bdaddr_t *bd_addr)
int(* cancel_bond )(const bt_bdaddr_t *bd_addr)
int(* get_connection_state )(const bt_bdaddr_t *bd_addr)
int(* pin_reply )(const bt_bdaddr_t *bd_addr, uint8_t accept, uint8_t pin_len, bt_pin_code_t *pin_code)
int(* ssp_reply )(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, uint8_t accept, uint32_t passkey)
const void *(* get_profile_interface )(const char *profile_id)
int(* dut_mode_configure )(uint8_t enable)
int(* dut_mode_send )(uint16_t opcode, uint8_t *buf, uint8_t len)
int(* le_test_mode )(uint16_t opcode, uint8_t *buf, uint8_t len)
int(* config_hci_snoop_log )(uint8_t enable)
int(* set_os_callouts )(bt_os_callouts_t *callouts)
int(* read_energy_info )()
void(* dump )(int fd, const char **arguments)
int(* config_clear )(void)
void(* interop_database_clear )(void)
void(* interop_database_add )(uint16_t feature, const bt_bdaddr_t *addr, size_t len)

Detailed Description

NOTE: By default, no profiles are initialized at the time of init/enable. Whenever the application invokes the 'init' API of a profile, then one of the following shall occur:

1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the profile as enabled. Subsequently, when the application invokes the Bluetooth 'enable', as part of the enable sequence the profile that were marked shall be enabled by calling appropriate stack APIs. The 'adapter_properties_cb' shall return the list of UUIDs of the enabled profiles.

2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack profile API to initialize the profile and trigger a 'adapter_properties_cb' with the current list of UUIDs including the newly added profile's UUID.

The reverse shall occur whenever the profile 'cleanup' APIs are invokedRepresents the standard Bluetooth DM interface.

Definition at line 456 of file bluetooth.h.

Field Documentation

int(* cancel_bond)(const bt_bdaddr_t *bd_addr)

Cancel Bond

Definition at line 521 of file bluetooth.h.

int(* cancel_discovery)(void)

Cancel Discovery

Definition at line 508 of file bluetooth.h.

void(* cleanup)(void)

Closes the interface.

Definition at line 472 of file bluetooth.h.

int(* config_clear)(void)

Clear /data/misc/bt_config.conf and erase all stored connections

Definition at line 580 of file bluetooth.h.

int(* config_hci_snoop_log)(uint8_t enable)

Definition at line 557 of file bluetooth.h.

int(* create_bond)(const bt_bdaddr_t *bd_addr, int transport)

Create Bluetooth Bonding

Definition at line 511 of file bluetooth.h.

int(* create_bond_out_of_band)(const bt_bdaddr_t *bd_addr, int transport, const bt_out_of_band_data_t *oob_data)

Create Bluetooth Bond using out of band data

Definition at line 514 of file bluetooth.h.

int(* disable)(void)

Disable Bluetooth.

Definition at line 469 of file bluetooth.h.

void(* dump)(int fd, const char **arguments)

Native support for dumpsys function Function is synchronous and |fd| is owned by caller. |arguments| are arguments which may affect the output, encoded as UTF-8 strings.

Definition at line 575 of file bluetooth.h.

int(* dut_mode_configure)(uint8_t enable)

Bluetooth Test Mode APIs - Bluetooth must be enabled for these APIs

Definition at line 548 of file bluetooth.h.

int(* dut_mode_send)(uint16_t opcode, uint8_t *buf, uint8_t len)

Definition at line 551 of file bluetooth.h.

int(* enable)(bool guest_mode)

Enable Bluetooth.

Definition at line 466 of file bluetooth.h.

int(* get_adapter_properties)(void)

Get all Bluetooth Adapter properties at init

Definition at line 475 of file bluetooth.h.

int(* get_adapter_property)(bt_property_type_t type)

Get Bluetooth Adapter property of 'type'

Definition at line 478 of file bluetooth.h.

int(* get_connection_state)(const bt_bdaddr_t *bd_addr)

Get the connection status for a given remote device. return value of 0 means the device is not connected, non-zero return status indicates an active connection.

Definition at line 528 of file bluetooth.h.

const void*(* get_profile_interface)(const char *profile_id)

Get Bluetooth profile interface

Definition at line 544 of file bluetooth.h.

int(* get_remote_device_properties)(bt_bdaddr_t *remote_addr)

Get all Remote Device properties

Definition at line 487 of file bluetooth.h.

int(* get_remote_device_property)(bt_bdaddr_t *remote_addr, bt_property_type_t type)

Get Remote Device property of 'type'

Definition at line 490 of file bluetooth.h.

int(* get_remote_service_record)(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)

Get Remote Device's service record for the given UUID

Definition at line 498 of file bluetooth.h.

int(* get_remote_services)(bt_bdaddr_t *remote_addr)

Start SDP to get remote services

Definition at line 502 of file bluetooth.h.

int(* init)(bt_callbacks_t *callbacks)

Opens the interface and provides the callback routines to the implemenation of this interface.

Definition at line 463 of file bluetooth.h.

void(* interop_database_add)(uint16_t feature, const bt_bdaddr_t *addr, size_t len)

Add a new device interoperability workaround for a remote device whose first |len| bytes of the its device address match |addr|. NOTE: |feature| has to match an item defined in interop_feature_t (interop.h).

Definition at line 592 of file bluetooth.h.

void(* interop_database_clear)(void)

Clear (reset) the dynamic portion of the device interoperability database.

Definition at line 585 of file bluetooth.h.

int(* le_test_mode)(uint16_t opcode, uint8_t *buf, uint8_t len)

BLE Test Mode APIs

Definition at line 554 of file bluetooth.h.

int(* pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept, uint8_t pin_len, bt_pin_code_t *pin_code)

BT Legacy PinKey Reply If accept==FALSE, then pin_len and pin_code shall be 0x0

Definition at line 532 of file bluetooth.h.

int(* read_energy_info)()

Read Energy info details - return value indicates BT_STATUS_SUCCESS or BT_STATUS_NOT_READY Success indicates that the VSC command was sent to controller

Definition at line 567 of file bluetooth.h.

int(* remove_bond)(const bt_bdaddr_t *bd_addr)

Remove Bond

Definition at line 518 of file bluetooth.h.

int(* set_adapter_property)(const bt_property_t *property)

Set Bluetooth Adapter property of 'type'

Definition at line 484 of file bluetooth.h.

int(* set_os_callouts)(bt_os_callouts_t *callouts)

Sets the OS call-out functions that bluedroid needs for alarms and wake locks. This should be called immediately after a successful |init|.

Definition at line 562 of file bluetooth.h.

int(* set_remote_device_property)(bt_bdaddr_t *remote_addr, const bt_property_t *property)

Set Remote Device property of 'type'

Definition at line 494 of file bluetooth.h.

size_t size

set to sizeof(bt_interface_t)

Definition at line 458 of file bluetooth.h.

int(* ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, uint8_t accept, uint32_t passkey)

BT SSP Reply - Just Works, Numeric Comparison and Passkey passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON & BT_SSP_VARIANT_CONSENT For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey shall be zero

Definition at line 540 of file bluetooth.h.

int(* start_discovery)(void)

Start Discovery

Definition at line 505 of file bluetooth.h.

The documentation for this struct was generated from the following file: