对于蓝牙适配器的封装
更多...
#include <dbluetoothadapter.h>
|
void | addressTypeChanged (DDevice::AddressType type) |
| 信号,当地址类型改变时发出信号
|
|
void | nameChanged (const QString &name) |
| 信号,当名字改变时发出信号
|
|
void | aliasChanged (const QString &alias) |
| 信号,当别称类型改变时发出信号
|
|
void | poweredChanged (bool powered) |
| 信号,当适配器启用状态改变时发出信号
|
|
void | discoverableChanged (bool discoverable) |
| 信号,当可发现属性改变时发出信号
|
|
void | discoverableTimeoutChanged (quint32 discoverableTimeout) |
| 信号,当发现超时属性改变时发出信号
|
|
void | discoveringChanged (bool discovering) |
| 信号,当发现状态改变时发出信号
|
|
void | removed () |
| 信号,当本适配器被移除时发出信号
|
|
void | deviceAdded (const QString &deviceAddress) |
| 信号,当本适配器下的由设备添加时发出信号
|
|
void | deviceRemoved (const QString &deviceAddress) |
| 信号,当本适配器下的由设备移除时发出信号
|
|
|
QString | address |
|
DDevice::AddressType | addressType |
|
QString | name |
|
QString | alias |
|
bool | powered |
|
bool | discoverable |
|
quint32 | discoverableTimeout |
|
bool | discovering |
|
◆ address()
QString DAdapter::address |
( |
| ) |
const |
获取当前适配器地址
- 返回
- 代表地址的字符串, 形如"FF:FF:FF:FF:FF:FF"
◆ addressType()
◆ alias()
QString DAdapter::alias |
( |
| ) |
const |
◆ devices()
DExpected< QStringList > DAdapter::devices |
( |
| ) |
const |
列出当前适配器下的所有设备
- 返回
- 由蓝牙设备组成的列表
◆ discoverable()
bool DAdapter::discoverable |
( |
| ) |
const |
当前适配器是否能被发现
- 返回
- 代表是否能被发现的布尔值
◆ discoverableTimeout()
quint32 DAdapter::discoverableTimeout |
( |
| ) |
const |
发现超时时间
- 返回
- 代表超时时间, 以秒为单位
- 注解
- 当超时为0时代表禁用, 默认值180秒
◆ discovering()
bool DAdapter::discovering |
( |
| ) |
const |
是否正处于发现状态中
- 返回
- 表示是否正在发现的布尔值
◆ name()
QString DAdapter::name |
( |
| ) |
const |
获取当前适配器名字, 具体名称由外部控制
- 返回
- 代表适配器名字的字符串
◆ powered()
bool DAdapter::powered |
( |
| ) |
const |
◆ removeDevice
DExpected< void > DAdapter::removeDevice |
( |
const QString & |
device | ) |
const |
|
slot |
◆ setAlias()
void DAdapter::setAlias |
( |
const QString & |
alias | ) |
|
◆ setDiscoverable()
void DAdapter::setDiscoverable |
( |
bool |
discoverable | ) |
|
◆ setDiscoverableTimeout()
void DAdapter::setDiscoverableTimeout |
( |
quint32 |
discoverableTimeout | ) |
|
设置发现超时时间
- 参数
-
[in] | discoverableTimeout | 超时时间 |
◆ setPowered()
void DAdapter::setPowered |
( |
bool |
powered | ) |
|
设置适配器是否打开
- 参数
-
- 注解
- 此属性设置的值不是持久的。重新启动或拔下适配器后, 它将重置回到false。
◆ startDiscovery
DExpected< void > DAdapter::startDiscovery |
( |
| ) |
const |
|
slot |
◆ stopDiscovery
DExpected< void > DAdapter::stopDiscovery |
( |
| ) |
const |
|
slot |
该类的文档由以下文件生成: