12,796
回編集
(→使用例) |
(→使用例) |
||
190行目: | 190行目: | ||
{ | { | ||
// デバイス探索エージェントのシグナル接続 | // デバイス探索エージェントのシグナル接続 | ||
connect(discoveryAgent | connect(&discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &BLEDeviceScanner::onDeviceDiscovered); | ||
connect(discoveryAgent | connect(&discoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &BLEDeviceScanner::onScanFinished); | ||
connect(discoveryAgent | connect(&discoveryAgent, static_cast<void(QBluetoothDeviceDiscoveryAgent::*)(QBluetoothDeviceDiscoveryAgent::Error)>(&QBluetoothDeviceDiscoveryAgent::error), | ||
this, &BLEDeviceScanner::onError); | this, &BLEDeviceScanner::onError); | ||
333行目: | 333行目: | ||
if (isContinuousScan) { | if (isContinuousScan) { | ||
QTimer::singleShot(1000, this, [this]() { | QTimer::singleShot(1000, this, [this]() { | ||
discoveryAgent | discoveryAgent.start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod); | ||
}); | }); | ||
} | } | ||
349行目: | 349行目: | ||
if (isContinuousScan) { | if (isContinuousScan) { | ||
QTimer::singleShot(5000, this, [this]() { | QTimer::singleShot(5000, this, [this]() { | ||
discoveryAgent | discoveryAgent.start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod); | ||
}); | }); | ||
} | } |