bt_interface_t 结构参考

bt_interface_t 结构参考

#include < bluetooth.h >

数据字段

尺寸_t尺寸
整数(*初始化)( bt_callbacks_t *callbacks)
整数(*启用)(bool guest_mode)
整数(*禁用)(无效)
空白(*清理)(无效)
整数(* get_adapter_properties )(无效)
整数(* get_adapter_property )( bt_property_type_t类型)
整数(* set_adapter_property )(const bt_property_t *property)
整数(* get_remote_device_properties )(bt_bdaddr_t *remote_addr)
整数(* get_remote_device_property )(bt_bdaddr_t *remote_addr, bt_property_type_t类型)
整数(* set_remote_device_property )(bt_bdaddr_t *remote_addr, const bt_property_t *property)
整数(* get_remote_service_record )(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
整数(* get_remote_services )(bt_bdaddr_t *remote_addr)
整数(*开始发现)(无效)
整数(*取消发现)(无效)
整数(* create_bond )(const bt_bdaddr_t *bd_addr, int transport)
整数(* create_bond_out_of_band )(const bt_bdaddr_t *bd_addr, int transport, const bt_out_of_band_data_t *oob_data)
整数(* remove_bond )(const bt_bdaddr_t *bd_addr)
整数(* cancel_bond )(const bt_bdaddr_t *bd_addr)
整数(* get_connection_state )(const bt_bdaddr_t *bd_addr)
整数(* pin_reply )(const bt_bdaddr_t *bd_addr, uint8_t accept, uint8_t pin_len, bt_pin_code_t *pin_code)
整数(* ssp_reply )(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t变体, uint8_t 接受, uint32_t 密码)
常量无效*(* get_profile_interface )(const char *profile_id)
整数(* dut_mode_configure )(uint8_t enable )
整数(* dut_mode_send )(uint16_t 操作码, uint8_t *buf, uint8_t len)
整数(* le_test_mode )(uint16_t 操作码, uint8_t *buf, uint8_t len)
整数(* config_hci_snoop_log )(uint8_t enable )
整数(* set_os_callouts )( bt_os_callouts_t *callouts)
整数(* read_energy_info )()
空白(* dump )(int fd, const char **参数)
整数(* config_clear )(无效)
空白(* interop_database_clear )(无效)
空白(* interop_database_add )(uint16_t 特征, const bt_bdaddr_t *addr, size_t len)

详细说明

注意:默认情况下,在初始化/启用时不会初始化任何配置文件。每当应用程序调用配置文件的“init”API 时,将发生以下情况之一:

1.) 如果蓝牙未启用,则蓝牙核心应将配置文件标记为启用。随后,当应用程序调用蓝牙“启用”时,作为启用序列的一部分,被标记的配置文件应通过调用适当的堆栈 API 来启用。 'adapter_properties_cb' 应返回已启用配置文件的 UUID 列表。

2.) 如果启用了蓝牙,则蓝牙核心应调用堆栈配置文件 API 以初始化配置文件并触发带有当前 UUID 列表的“adapter_properties_cb”,包括新添加的配置文件的 UUID。

每当调用配置文件“cleanup”API 时,就会发生相反的情况。代表标准蓝牙 DM 接口。

在文件bluetooth.h的第456行定义。

现场文件

int(* cancel_bond)(const bt_bdaddr_t *bd_addr)

取消债券

在文件bluetooth.h的第521行定义。

整数(*取消发现)(无效)

取消发现

在文件bluetooth.h的第508行定义。

无效(*清理)(无效)

关闭界面。

在文件bluetooth.h的第472行定义。

整数(* config_clear)(无效)

清除 /data/misc/bt_config.conf 并清除所有存储的连接

在文件bluetooth.h的第580行定义。

int(* config_hci_snoop_log)(uint8_t enable )

在文件bluetooth.h的第557行定义。

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

创建蓝牙绑定

在文件bluetooth.h的第511行定义。

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

使用带外数据创建蓝牙绑定

在文件bluetooth.h的第514行定义。

整数(*禁用)(无效)

禁用蓝牙。

在文件bluetooth.h的第469行定义。

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

对 dumpsys 函数的原生支持 函数是同步的和 |fd|归调用者所有。 |论据|是可能影响输出的参数,编码为 UTF-8 字符串。

在文件bluetooth.h的第575行定义。

int(* dut_mode_configure)(uint8_t启用)

蓝牙测试模式 API - 必须为这些 API 启用蓝牙

在文件bluetooth.h的第548行定义。

int(* dut_mode_send)(uint16_t 操作码,uint8_t *buf,uint8_t len)

在文件bluetooth.h的第551行定义。

int(* enable)(bool guest_mode)

启用蓝牙。

在文件bluetooth.h的第466行定义。

整数(* get_adapter_properties)(无效)

在初始化时获取所有蓝牙适配器属性

在文件bluetooth.h的第475行定义。

int(* get_adapter_property)( bt_property_type_t类型)

获取“类型”的蓝牙适配器属性

在文件bluetooth.h的第478行定义。

int(* get_connection_state)(const bt_bdaddr_t *bd_addr)

获取给定远程设备的连接状态。返回值为 0 表示设备未连接,非零返回状态表示连接处于活动状态。

在文件bluetooth.h的第528行定义。

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

获取蓝牙配置文件接口

在文件bluetooth.h的第544行定义。

int(* get_remote_device_properties)(bt_bdaddr_t *remote_addr)

获取所有远程设备属性

在文件bluetooth.h的第487行定义。

int(* get_remote_device_property)(bt_bdaddr_t *remote_addr, bt_property_type_t类型)

获取“类型”的远程设备属性

在文件bluetooth.h的第490行定义。

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

获取给定 UUID 的远程设备服务记录

在文件bluetooth.h的第498行定义。

int(* get_remote_services)(bt_bdaddr_t *remote_addr)

启动SDP获取远程服务

在文件bluetooth.h的第502行定义。

int(* init)( bt_callbacks_t *callbacks)

打开接口并提供回调例程来实现该接口。

在文件bluetooth.h的第463行定义。

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

为第一个 |len| 的远程设备添加新的设备互操作性解决方法其设备地址的字节匹配|addr|。注意:|特征|必须匹配在 interop_feature_t (interop.h) 中定义的项目。

在文件bluetooth.h的第592行定义。

无效(* interop_database_clear)(无效)

清除(重置)设备互操作性数据库的动态部分。

在文件bluetooth.h的第585行定义。

int(* le_test_mode)(uint16_t 操作码, uint8_t *buf, uint8_t len)

BLE 测试模式 API

在文件bluetooth.h的第554行定义。

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 如果 accept==FALSE,则 pin_len 和 pin_code 应为 0x0

在文件bluetooth.h的第532行定义。

int(* read_energy_info)()

读取能源信息详细信息 - 返回值表示 BT_STATUS_SUCCESS 或 BT_STATUS_NOT_READY 成功表示 VSC 命令已发送到控制器

在文件bluetooth.h的第567行定义。

int(* remove_bond)(const bt_bdaddr_t *bd_addr)

删除键

在文件bluetooth.h的第518行定义。

int(* set_adapter_property)(const bt_property_t *property)

设置“类型”的蓝牙适配器属性

在文件bluetooth.h的第484行定义。

int(* set_os_callouts)( bt_os_callouts_t *callouts)

设置 bluedroid 警报和唤醒锁所需的操作系统调用功能。这应该在成功的|init| 之​​后立即调用。

在文件bluetooth.h的第562行定义。

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

设置“类型”的远程设备属性

在文件bluetooth.h的第494行定义。

size_t 大小

设置为 sizeof(bt_interface_t)

在文件bluetooth.h的第458行定义。

int(* ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t变体, uint8_t 接受, uint32_t 密码)

BT SSP 回复 - 对于 BT_SSP_VARIANT_PASSKEY_COMPARISON 和 BT_SSP_VARIANT_CONSENT 而言,Just Works、数字比较和密钥密钥应为零 对于 BT_SSP_VARIANT_PASSKEY_ENTRY,如果接受 ==FALSE,则密钥应为零

在文件bluetooth.h的第540行定义。

整数(* start_discovery)(无效)

开始发现

在文件bluetooth.h的第505行定义。


此结构的文档是从以下文件生成的: