summaryrefslogtreecommitdiff
path: root/gatoperipheral.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gatoperipheral.cpp')
-rw-r--r--gatoperipheral.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gatoperipheral.cpp b/gatoperipheral.cpp
index 2225672..21244b8 100644
--- a/gatoperipheral.cpp
+++ b/gatoperipheral.cpp
@@ -149,7 +149,7 @@ bool GatoPeripheral::advertisesService(const GatoUUID &uuid) const
return d->service_uuids.contains(uuid);
}
-void GatoPeripheral::connectPeripheral()
+void GatoPeripheral::connectPeripheral(PeripheralConnectOptions options)
{
Q_D(GatoPeripheral);
if (d->att->state() != GatoSocket::StateDisconnected) {
@@ -157,7 +157,12 @@ void GatoPeripheral::connectPeripheral()
return;
}
- d->att->connectTo(d->addr);
+ GatoSocket::SecurityLevel sec_level = GatoSocket::SecurityLow;
+ if (options & PeripheralConnectOptionRequireEncryption) {
+ sec_level = GatoSocket::SecurityMedium;
+ }
+
+ d->att->connectTo(d->addr, sec_level);
}
void GatoPeripheral::disconnectPeripheral()