example 'meshtastic': review USB mode, add setting in menu

This commit is contained in:
pls.153 2024-04-15 16:41:24 +02:00
parent a8a6b0058b
commit 80354e321a
12 changed files with 119 additions and 72 deletions

View file

@ -35,6 +35,10 @@ void BLE::startDeviceDiscovery(const QString& name) {
discoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
}
void BLE::stopDeviceDiscovery() {
discoveryAgent->stop();
}
void BLE::addDevice(const QBluetoothDeviceInfo& device) {
if (deviceFilter(device)) {
QString name(device.name());
@ -176,7 +180,7 @@ void BLE::errorReceived(QLowEnergyController::Error) {
Q_EMIT bleError();
}
void BLE::disconnectFromDevice() {
void BLE::disconnect() {
if (controller->state() != QLowEnergyController::UnconnectedState) {
controller->disconnectFromDevice();
} else {