summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gatocentralmanager.cpp2
-rw-r--r--gatosocket.cpp10
2 files changed, 8 insertions, 4 deletions
diff --git a/gatocentralmanager.cpp b/gatocentralmanager.cpp
index 0d3efd9..4e6458b 100644
--- a/gatocentralmanager.cpp
+++ b/gatocentralmanager.cpp
@@ -86,7 +86,7 @@ void GatoCentralManager::scanForPeripheralsWithServices(const QList<GatoUUID> &u
hci_le_set_scan_enable(d->hci, 0, 0, d->timeout);
rc = hci_le_set_scan_parameters(d->hci, scan_type,
- htobs(0x0010), htobs(0x0010),
+ htobs(0x0100), htobs(0x0030),
0 /* Public address */,
0 /* No filter ? */,
d->timeout);
diff --git a/gatosocket.cpp b/gatosocket.cpp
index c29b154..5d30c6f 100644
--- a/gatosocket.cpp
+++ b/gatosocket.cpp
@@ -20,8 +20,6 @@
#include <QtCore/QDebug>
-#include <limits>
-
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
@@ -167,7 +165,7 @@ void GatoSocket::writeNotify()
int soerror = 0;
socklen_t len = sizeof(soerror);
if (::getsockopt(fd, SOL_SOCKET, SO_ERROR, &soerror, &len) != 0) {
- // An error while reading the error?
+ // An error while reading the error
qErrnoWarning("Could not get L2 socket options");
close();
return;
@@ -180,6 +178,12 @@ void GatoSocket::writeNotify()
s = StateConnected;
emit connected();
+
+ bt_security bt_sec;
+ len = sizeof(bt_sec);
+ if (::getsockopt(fd, SOL_BLUETOOTH, BT_SECURITY, &bt_sec, &len) == 0) {
+ qDebug() << "Established a bluetooth channel with security level " << bt_sec.level;
+ }
} else if (s == StateConnected) {
if (!writeQueue.isEmpty()) {
if (transmit(writeQueue.head())) {