TpBluetoothDiscovery 类
V0.2.1TpExtUtils
2025-11-14
介绍
蓝牙扫描,可以用于扫描周围的蓝牙
基础信息
| 头文件: | include <TpBluetoothDiscovery.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 类型
enum TpBluetoothDiscovery::TpDiscoveryInquiryType
| 名称 | 值 | 描述 |
|---|---|---|
| TP_DISCOVER_INQU_AUTO | 0 | |
| TP_DISCOVER_INQU_CLASSIC | 1 | |
| TP_DISCOVER_INQU_LOW_ENERGY | 2 |
信号
| 信号名称 | 参数 | 描述 |
|---|---|---|
| bluetoothDeviceRemove | TpBluetoothAddress & | |
| bluetoothDeviceAdd | TpBluetoothDevice & |
Public 成员函数
| TpBluetoothDiscovery(const char *local) | ||
|---|---|---|
| TpBluetoothDiscovery(const TpString &local) | ||
| ~TpBluetoothDiscovery() | ||
| start() | 开始扫描 | |
| stop() | 停止扫描 | |
| isDiscovering() | 是否处于扫描中 | |
| setInquiryType(TpDiscoveryInquiryType type) | 设置扫描蓝牙的类型 | |
| setRssiThreshold(int value) | 设置蓝牙扫描的rssi阈值(暂不支持) | |
| setTimeout(uint32_t ms) | 获取蓝牙扫描的设备列表(改为信号的方式后此接口暂不支持) | |
| onDeviceAdd(const void *remote) | ||
| onDeviceRemove(const void *remote) |
成员函数说明
TpBluetoothDiscovery::TpBluetoothDiscovery(const char *local)
暂无注释...
TpBluetoothDiscovery::TpBluetoothDiscovery(const TpString &local)
暂无注释...
TpBluetoothDiscovery::~TpBluetoothDiscovery()
暂无注释...
void TpBluetoothDiscovery::start()
开始扫描...
开始扫描
void TpBluetoothDiscovery::stop()
停止扫描...
停止扫描
tpBool TpBluetoothDiscovery::isDiscovering()
是否处于扫描中...
是否处于扫描中
返回值:
int TpBluetoothDiscovery::setInquiryType(TpDiscoveryInquiryType type)
设置扫描蓝牙的类型...
设置扫描蓝牙的类型
参数:type: 类型
返回值:
int TpBluetoothDiscovery::setRssiThreshold(int value)
设置蓝牙扫描的rssi阈值(暂不支持)...
设置蓝牙扫描的rssi阈值(暂不支持)
参数:value:
返回值:
int TpBluetoothDiscovery::setTimeout(uint32_t ms)
获取蓝牙扫描的设备列表(改为信号的方式后此接口暂不支持)...
获取蓝牙扫描的设备列表(改为信号的方式后此接口暂不支持)
设置扫描超时时间(应用于低功耗)(暂不支持)
参数:ms:
返回值:TpList<TpBluetoothDevice *> getDeviceList();
返回值:
