bt_interface_t Struct Reference

#include <bluetooth.h>

Data Fields

size_t size
int(* init )(bt_callbacks_t *callbacks)
int(* enable )(void)
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(* 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)
int(* config_clear )(void)

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 431 of file bluetooth.h.

Field Documentation

int(* cancel_bond)(const bt_bdaddr_t *bd_addr)

Cancel Bond

Definition at line 492 of file bluetooth.h.

int(* cancel_discovery)(void)

Cancel Discovery

Definition at line 483 of file bluetooth.h.

void(* cleanup)(void)

Closes the interface.

Definition at line 447 of file bluetooth.h.

int(* config_clear)(void)

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

Definition at line 549 of file bluetooth.h.

int(* config_hci_snoop_log)(uint8_t enable)

Definition at line 528 of file bluetooth.h.

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

Create Bluetooth Bonding

Definition at line 486 of file bluetooth.h.

int(* disable)(void)

Disable Bluetooth.

Definition at line 444 of file bluetooth.h.

void(* dump)(int fd)

Native support for dumpsys function Function is synchronous and |fd| is owned by caller.

Definition at line 544 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 519 of file bluetooth.h.

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

Definition at line 522 of file bluetooth.h.

int(* enable)(void)

Enable Bluetooth.

Definition at line 441 of file bluetooth.h.

int(* get_adapter_properties)(void)

Get all Bluetooth Adapter properties at init

Definition at line 450 of file bluetooth.h.

int(* get_adapter_property)(bt_property_type_t type)

Get Bluetooth Adapter property of 'type'

Definition at line 453 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 499 of file bluetooth.h.

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

Get Bluetooth profile interface

Definition at line 515 of file bluetooth.h.

int(* get_remote_device_properties)(bt_bdaddr_t *remote_addr)

Get all Remote Device properties

Definition at line 462 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 465 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 473 of file bluetooth.h.

int(* get_remote_services)(bt_bdaddr_t *remote_addr)

Start SDP to get remote services

Definition at line 477 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 438 of file bluetooth.h.

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

BLE Test Mode APIs

Definition at line 525 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 503 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 538 of file bluetooth.h.

int(* remove_bond)(const bt_bdaddr_t *bd_addr)

Remove Bond

Definition at line 489 of file bluetooth.h.

int(* set_adapter_property)(const bt_property_t *property)

Set Bluetooth Adapter property of 'type'

Definition at line 459 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 533 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 469 of file bluetooth.h.

size_t size

set to sizeof(bt_interface_t)

Definition at line 433 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 511 of file bluetooth.h.

int(* start_discovery)(void)

Start Discovery

Definition at line 480 of file bluetooth.h.

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