| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fact there are two socket leaks. The first is the socket for the incoming
l2cp connection from the central device and the second one is allocated in the
ctor of QBluetoothSocket. When QBluetoothSocket::setSocketDescriptor is called
the previously ctor allocated socket was simply ignorred. This patch closes
both socket.
Fixes: QTBUG-75278
Change-Id: Ia483e3c2a04bec3a53ddf744c22b794941edf848
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change subsequent calls to
QLowEnergyController::startAdvertising() failed to update the
to-be-advertised information.
Fixes: QTBUG-70754
Change-Id: I594f4f916307e12be6be17d50497aea324520620
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
| |
Change-Id: If7adc165e063445ee0c34291a3e3840ddae0f570
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
LEController in peripheral mode uses QBluetoothSocket::setSocketDescriptor().
Since QBluetoothsocket was ported to DBus (enabled when Bluez is 5.46 or later)
setSocketDescriptor()/server mode does not work. That's why
f602d7fef2e2f067e123e5740d4b0bf16c4ec0e2 made sure that QBluetoothServer
uses the old raw socket implementation. Unfortunately QLowEnergyController
was forgotten and needs the same workaround.
Change-Id: I6ba3654ee199d0ffcf4b69f16dfbc5508d6b13d4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
| |
Change-Id: I7dd2d055c8d667f049d7cb2c371619137bf76030
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
| |
To avoid unnecessary copies, const is used wherever possible.
Change-Id: Ic743716512751cfd24fad5bd37c244b115dd26fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Uses the new QBluetoothSocketBasePrivate interface to separate the Linux
implementations from other platforms. On Linux, there will be the
existing raw socket implementation and a BlueZ5 DBus implementation.
The DBus implementation is required for very recent Bluez5 deployments
(v5.4x+) which restrict access to traditional SDP discovery means like
sdptool.
For now the DBus implementation is non-existing/dysfunctional.
Task-number: QTBUG-68550
Change-Id: Idd248ecdb2a443a95cde521ced929218d40df3fe
Reviewed-by: Lubomir I. Ivanov <neolit123@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While the central role implementation properly invalidates all the
LowEnergyServicePrivate instances, peripheral mode was leaking service
instances. This is triggered when the peripheral disconnects from a client
or when the user calls disconnectService(). On the other hand
stopAdvertising() does not do that.
This patch fixes the service instance leak and ensures that the class
docs specifically state the behavior difference between stopAdvertising()
and disconnectService().
Change-Id: Ia52b141096dc1db3d0cefe3ed18c230eecccd9c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This fixes the problem for the custom GATT stack on Bluez4 and older
Bluez5 versions (below 5.42).
Task-number: QTBUG-67651
Change-Id: Ia3c64c06777c8d357f615d681838bcdc83b92236
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
In theory each time a new connection is established, central and
peripheral device should renegotiate the mtu. However this is not always
happening which leads to wrong MTU assumptions. The most likely assumption
is the default size of 23 bytes.
Task-number: QTBUG-66056
Change-Id: I27d2cd89558b0c08925d31e2c7ed42ee45c303a4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
Change-Id: I6e93fc7435a49b601a5c10519ed86d2a15125074
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
Change-Id: I6d2140aa8692bc7ce56f4366275fd02d008900f0
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Emitting just the signal does not change the error state. setError()
ensures that the error state/member and the error signal are emitted.
Change-Id: Idc044b8b97d4025b0f3a4d172c11c6b3a4e81ecb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When an ATT READ_REQUEST times out the ATT stack stops spinning
the event queue. This is particularly bad during the initial
service discovery when a lot of read requests are scheduled in one
go. The consequence was that the QLEService instance
was stuck in the ServiceDiscovering state. Subsequently the service object
is unusable.
The patch ensures that the ATT event loop continues after the timeout
happens. If multiple char or descriptor reads (on the same service) have
this problem the service discovery can still take a very long time.
The user can adjust this via the BLUETOOTH_GATT_TIMEOUT env variable.
[ChangeLog][Platform Specific Behavior][BlueZ] Fixed hanging service
discovery state when remote device does not respond to ATT read requests.
Task-number: QTBUG-64669
Change-Id: I8d22c13b825a921b140213b8b67e59e2310c362c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/bluetooth/bluetooth.pro
Change-Id: Ibccccc974b545696ae053f1fbffcc973d8be43cc
|
| |\|
| | |
| | |
| | | |
Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This bug was caused by a problem in the patch for QTBUG-55150.
While the termination of an ongoing BTLE connection is being
processed, the QLEController instance is in Connecting state and
the internal socket is still null. If the user triggers a call
to QLEController::disconnectDevice() while the above state is
pending, it crashes due to a call to the socket's close()
function. The time window for this to happen is very small.
It takes the duration of the bluez dbus call to disconnect
a device.
This patch addresses the above crash bug and adds a
bit more debug output to catch similar cases later on.
Task-number: QTBUG-63619
Change-Id: I893990a9ce8ccf55ddbf619fe177379f79dc9ee3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Id346f2f98e63c5c7ea9e2cd3fb7e68e4573ac1e5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This utilizes the new QLowEnergyController interface and separates the
existing Bluez implementation more clearly from other platforms.
The existing addServiceHelper() class is moved out into the individual
backends to avoid compiling the class into the new dbus backend.
Change-Id: I1eea99e493958c61cb1fae830c08a3eb26bda9c3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The base class is renamed to QLEControllerPrivate and
the existing QLEControllerPrivate becomes
QLEControllerPrivateCommon.
This is necessary to re-enable Q_DECLARE_PRIVATE. The macro uses by
convention the "Private" class prefix which is currently broken
because not every implementation uses QLEControllerPrivate as
d-pointer type. This also avoids a SC/BC break in
qlowenergycontroller.h as the d-pointer remains the same and the
functions declared via Q_DECLARE_PRIVATE still return the same
type.
Change-Id: I84890b06280b2c473a4d370606d3bbc58a258eea
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
This permits alternative implementations selectable at runtime.
Currently this is only used by Bluez.
Change-Id: I3ddeb7f888f3b09bdc62f10d5b9a36320500f329
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Qt 5.9 introduced this behavior change as part of a bug fix. Qt 5.10
will force the new behavior unless otherwise requested by the user.
Task-number: QTBUG-61554
Change-Id: I75a2107c64e0eaaf03490658669c9a23ac7dcf63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
|/
|
|
|
|
| |
Change-Id: I88ff16001280dea4967887ae711c463304c7ec7d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some devices require the Generic Access (GAP) and Generic Attribute (GATT)
services to be defined. Otherwise they refuse a proper interaction.
This is done implicitly by Android and BlueZ. The reason why BlueZ does
not do this for QtBluetooth is because QtBluetooth sets up its own GATT
infrastructure.
Normally a QLEController in central role cannot do that via public API
as the QLEController::addService() function blocks on peripheral use
cases. This patch sets the profiles up.
In the future the feature really requires a better form of API
(beyond the above env variable) or should be enabled by default
but since we need this earlier than Qt 5.10 a more subtle
approach was chosen. For now the feature can
only be enabled if the QT_DEFAULT_CENTRAL_SERVICES was set.
Another limitation is that the characteristics of the added services
are completely static.
Task-number: QTBUG-61554
Change-Id: Id03bddb2e54cc4f0869838e13ddf281311ad3a26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DBus does not expose this information. The Bluetooth Management API
advertises the information but requires CAP_NET_ADMIN. The Management
class monitors DEVICE FOUND events and records the random bit flag
of each new device. QBluetoothDeviceDiscoveryAgent can subsequently
add this information to the internal data set.
Ultimately this makes QLowEnergyController::setRemoteAddressType
obsolete. This function was only ever required on Linux.
Task-number: QTBUG-46776
Change-Id: If10df86d332dfc7cc98b7c783eb28487c3fa9045
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the same time we remove the redudant and temporary packet variable.
This was highlighted by a compiler warning:
In function void* memcpy(void*, const void*, size_t),
inlined from void qToUnaligned(T, void*) [with T = short unsigned int] at /home/ablasche/dev/qt/qt59/qtbase/include/QtCore/../../src/corelib/global/qendian.h:82:5,
inlined from void qToLittleEndian(T, void*) [with T = short unsigned int] at /home/ablasche/dev/qt/qt59/qtbase/include/QtCore/../../src/corelib/global/qendian.h:227:3,
inlined from void putBtData(T, void*) [with T = short unsigned int] at bluez/bluez_data_p.h:196:5,
inlined from void QLowEnergyControllerPrivate::readServiceValuesByOffset(uint, quint16, bool) at qlowenergycontroller_bluez.cpp:1692:34:
/usr/include/x86_64-linux-gnu/bits/string3.h:53:71: warning: call to void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int) will always overflow destination buffer
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
Change-Id: I5b8d7781b78ea3e07e30b9b830a4d8885bb8c989
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BlueZ's improving support for BTLE creates a new collision when
attenpting to connect to remote BTLE devices. There can only ever be
one connection.
This patch ensures that when QtBluetooth attempts to connect we do
not have a pending BTLE connection. This could have been caused via
other QtBLuetooth based processes or applications
such as bluetoothctl or bluetoothd in general. If a connection
is pending we close the connection external to the current QtBLuetooth
instance.
This is not an ideal situation as several processes can potentially
fight over btle access. The long term solution is a port of QtBluetooth
to BlueZ's new DBus API.
Task-number: QTBUG-55150
Change-Id: I96b30ae180d1348027e8f9f09c997f44409dfc48
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-55150
Change-Id: I223e2b2015e210162e59fb994b9352e790b036d4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
| |
Make them explicit.
Change-Id: I9bf1e35bffb044dcbf62fffd14bfe71bc374febf
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
| |
This singal was never emitted.
Task-number: QTBUG-59754
Change-Id: I5f6aba3f995933dc8a8c7b80492e1726a3177b54
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although this was not explicitly documented this is the behavior that
the associated heartrate example exhibits. This change ensures that it is
documented and enforced.
[ChangeLog][QtBluetooth][BlueZ] Fixed continued advertisement of
peripheral data once QLowEnergyController::disconnectFromDevice()
was called. Public documentation was added to publically state the
behavior.
Change-Id: I3678c92fbb0d12cca17cd65ef7566a3ae4b55dc2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some peripheral implementations do not respond with a response upon
reception of GATT requests. Since the Linux implementation does not
progress until a response is received, it stalls forever.
A new timeout was introduced to counter this. If the response is not
received within the timeout period an artificial GATT error response is
injected into the queue. In addition, a very large warning is printed
to highlight the fact and force the user to deal with it. In extreme
cases this could create strange ordering problems for extremely
delayed responses. Hence the implementation continues under
reservation.
A disconnect as response to the missing response from the peripheral
was briefly considered too. However user reports indicate that not every
user is able to change the peripheral implementation. This would block
further usage of QtBluetooth (especially if one characteristic is
non-conformant but the other characteristics of the same service are
OK).
Task-number: QTBUG-52692
Change-Id: I49ad7b75215101b3132ba97794e71021ee25a30e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cases such as partial writes were silently ignored.
Since QLowEnergyController works in unbuffered mode such incomplete
writes are ignored. The ATT layer will automatically recover from such
packets on the line.
The EAGAIN case is a similar case as it effectively
means the BTLE connection is still ok but the packet can temporarily
not be written anyway. In fact, previously QBluetoothSocket reported such cases by
returning -1 as a result of QBLuetoothSocket::write(). This was even worse
as it caused a drop of the connection without justification.
These issues are reproducable when the BTLE connection is flooded
with lots of notifications.
Task-number: QTBUG-54475
Change-Id: I2b6be555ff676c440971981db0974be83c901eaa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
QBluetoothUuid.toUInt128() always returns big endian notation.
We have to convert it to host order before we convert to Bluetooth
order.
Task-number: QTBUG-53421
Change-Id: Ibab4f06fa70739adb163523c803a203608454427
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
|
|
|
|
|
|
| |
Task-number: QTBUG-41175
Change-Id: I62d74236faf9161681306d952e409e23e0cea24d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/bluetooth/qlowenergycontroller_bluez.cpp
Change-Id: I00f45a2a22a045e7836f2caeb76cc5599ced6279
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While discovering descriptors, when handles are not numbered
sequentially, the discovery stopped as soon as "no attribute in given
range found" error is received. However, there could be more
characteristics pending. As a result, descriptors for those
characteristics where never discovered.
Change-Id: Iad9d7203020b0787f1d4571fc7063ef390448ce9
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
Otherwise, a malicious device could crash our application.
Change-Id: I427eb1ff88b08710d5c74230f5877b0c59b6fb0f
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The private class used a member in its constructor that was only set
afterwards.
Change-Id: I19b7ca2a5048771a447d63a56ad10ad56c311e91
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- This is how we get at the signature resolving key:
1) On connection from a client, we read the key from the
respective BlueZ settings file (BlueZ 5 only, as I did
not manage to find out where BlueZ 4 keeps this information).
2) Also monitor the HCI traffic for key updates (due to re-pairing).
- While there is an autotest for the actual hashing procedure, the
overall feature cannot be easily tested for various reasons (there is
no signed write support in our client API, for one). However, to help
with manual testing, the server part of our autotest now exposes a
characteristic that supports signed writes.
- This feature requires a Linux kernel >= 3.7.
Change-Id: I7ede9b430de167fe1f4519eedf8670d88d79aa25
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\ \
| | |
| | |
| | | |
Change-Id: If9cf6718cbd619dd7ce38db2da274fe9d0a41fb7
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: I856c13e2a6d4d12c46e1286b0ca1c092ee4608f8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: I93e9bd7fb3cf7d683907cd4ad6bc5f4781af91ae
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now take the following rules from the specification into account:
- Signed writes are only possible if the two devices are bonded.
- Signed writes are not allowed if the link is encrypted.
- If the link is encrypted, a normal (unsigned) write command can be
used to write an attribute even if it is specified that a signed
write is required. That is because the encryption provides the
same level of trust as the signature.
Change-Id: I15d6db10f9b039aeda026e57b0378aef2b88e73a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: Ieb903989c5ef5de924c9c4a0d31c4ef9a74e2c40
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
Implemented for BlueZ only.
Change-Id: I358a98bbc7499d5ce5437fb0d4672fde46c3b831
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: Iea44e99e8c7b38e3bdece4de989770831d40ff83
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Write Request, Write Command and Execute Write Request are fully
implemented now. Signed Write support is still missing. Notifications
and Indications are sent. The server side gets informed via the
respective signals when a client writes a characteristic or descriptor.
Change-Id: Icba6a0270f6e1c4c3ed2ba61b55c1a5fbb69752b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: I456d083d45569ea8d61f0a659f72646d653143d1
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|
|\|
| |
| |
| | |
Change-Id: I1fc766d26aadb7cc01d33c4c8a2260411d7bb138
|