| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make our private controller class to inherit the shared
base as other platforms do. Rename it into PrivateDarwin.
Remove QLowEnergyController's code duplicate on Darwin.
Get rid of Darwin's copy of QLowEnergyService.
As a bonus, a number of bugs/inconsistencies were fixed
in setting the state and not emitting stateChanged.
Reduced the usage of 'isValid'.
Task-number: QTBUG-75348
Change-Id: I77495870597b61fecae8bca1617590fd9ad2def4
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- use the shared *._p.h file/class declaration for the private class
- use the shared *.cpp with the public class implementation
- get rid of *_ios.mm - iOS/tvOS/watchOS specific implementation
and use the shared (by macOS, iOS, tvOS, watchOS) *_darwin.mm source.
- get rid of somewhat weird 'isValid' in the private class, it is
is not taken care of in the public API anyway and today its
whole concept/usage looks (quite) buggy to me. I only have to
check that the default controller is not nil and has the
state 'ON'.
Task-number: QTBUG-75348
Change-Id: I5383e4f8df02ac12f069c2f59e252cb8a200800b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
| |
Change-Id: I9d59d4bbf5d17c7b45fb04d5cb131c7f44e4c3ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|\
| |
| |
| | |
Change-Id: I3996d42b34d1a0b3534d5673694914c97c4e8d8d
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For some devices the attribute map does not have a protocol descriptor
set which throws off Qt's logic. As Windows can only discover RFCOMM
services, we can just add that protocol to the service ourselves if it
is not found automatically.
Task-number: QTBUG-62520
Change-Id: I6ce3948892699049b678b026840d346879b98269
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
MSDN documentation states that the recommended way of RFCOMM service
connection is via connectionHostName and connectionServiceName (see
https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.rfcomm.rfcommdeviceservice).
So whenever possible, we should use this information from the native
device service when connecting directly to the discovered service.
As QBluetoothServiceInfo is basically just a wrapper for the attributes
map this information is stored in its private pendant and extracted when
a connection attempt is being made.
Task-number: QTBUG-62520
Change-Id: I95be5df89a722531393b45fd136d37f302393ca8
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |\
| | |
| | |
| | | |
Change-Id: I0d7c92be8609cb7ec46b1895e1f270678ad681ae
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|\| |
| | |
| | |
| | | |
Change-Id: I77de4f58db88f827b006d1e6501b3a1a836347bc
|
| |\|
| | |
| | |
| | | |
Change-Id: Ieb05b1eb0fa8247726f5f5de771496a9b50b9f55
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It is possible that the service will appear to be the same but have
different server channels. So these services should not be seen as
duplicates as a result.
Change-Id: I36f9c376fcfd9378f4f18c639e87e1a7aad1815b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
... to simplify future code de-duplication. In this patch we:
- For simplicity move all C++ delegate classes into their
own header. Since we have to hide Objective-C from C++ compiler
(while compiling *.cpp files), these updated delegates
have to use void * instead of Objective-C classes.
- Introduce a new RAII classes, that work with Objective-C
instances but have a header that can be included into the
*.cpp files, thus making it possible to share *_p.h files with
all back-ends.
I'm also switching to a new naming convention, which will later
propagate to the pre-existing code - given files are already in
a sub-directory 'osx', having a prefix 'osxbt' in a name is
excessive. Now it's becoming 'bt' (include "osx/btsomething.h").
Later 'osx' dir is to be renamed into 'darwin', which is what
it is these days. Namespace OSXBluetooth is to become DarwinBluetooth.
Task-number: QTBUG-75348
Change-Id: Iebaeab7d0c5e672efebab8218debdec761353633
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The related functions were deprecated by fac56a229b45395488f3e41bf178361c72b3ee1e.
Change-Id: Ia94b1824bb6ea7d1a8e3bb8eb5e82074e9facb7a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new API requires Android SDK v21 or higher and Qt 5.13 just raised
the minimum API version to 21. The PendingIntent version of the same API
cannot be used yet as it requires v24+.
Fixes: QTBUG-67482
Change-Id: Ided02e36796ef66f0244934ef67262f1e6f69b8c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andrew Dolby <andrewdolby@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: Ie3b3c4f031c843dd6debdae09a902e55ad255b8e
|
| |\|
| | |
| | |
| | | |
Change-Id: Ifa3782b009430df67ef2e7ba78ea7d14cc053aa8
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With some peculiar device we suddenly (during the service details discovery)
got a crash with CBDescriptor suddenly becoming something else - NSString,
NSMutableArray etc. - meaning the object was deleted and its memory re-used.
It would appear, CBPeripheral can suddenly change it's services tree and
it informs its delegate (aka 'us') about this change using the (previously)
missing method. In this method we cannot do much, due to the specificity of our
public API that allows concurrent discoveries, it's 'non-monolitic' (in several
steps) discoveries etc. etc. So the only thing we can do - stop everything,
remove all services, transition to QLowEnergyController::ConnectedState and
wait for a user to re-discover services.
Fixes: QTBUG-75043
Change-Id: Ie98d90aea112e40b4c6771e3f7315772dfd92b39
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have to access the service data instead of relying on passed
references as these references might have run out of scope and thus
might not be valid any more.
Fixes: QTBUG-75070
Change-Id: I02ad0fef2337488c926fb950ddf2da6eda56a396
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: Ie63057b5773415a566e801731741006cf8626310
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I795c9b60454c350c56a4dd362b5b359b12a3a8f9
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
That code has been (unneededly) duplicated several times. We should have
that helper function just once.
Change-Id: I28fc9c5f7f7218b7870dc30bec228c9af8c6b090
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I1759d7507d778ee60c6727621a3f58a7c7509718
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |\|
| | |
| | |
| | | |
Change-Id: I92b7c4a2948ddb8bdf7fead0a3351379138b0905
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Sometimes Android returns a null uuid as SDP result. There is no point
processing them further.
Change-Id: I07b52e79a31becda72452e3446aca9ea4933968b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Even though it is not recommended to listen on reserverd BT UUIDs,
there are SPP services which do not advertise with a custom uuid
or the custom uuid is not an SPP service. In such cases we want a
BluetoothServiceInfo instance that advertises SPP as serviceUuid().
Change-Id: Ic54d663392f8f8b2ba5684c57216bf2b69aca477
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The changes are of cosmetic or code optimization nature. The functionality is
not changed at all.
Change-Id: Ideb63d87ed07201024b73e2f40d33393b68963bc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SDP discovery on Android only returns a flat list of uuids. It mixes
service class uuid and service uuids. Furthermore it is unable to detect
whether a serial connection uses rfcomm or l2cp as base protocol. The
last limitation is the fact that serial sockets can only be established
using rfcomm (no l2cp).
This poses a serious challenge because there is no way to say whether
a given custom service uuid is indeed an SPP based service or whether
it uses rfcomm. The only way to know for sure is to connect and check
whether it succeeds.
This also means QBluetoothServiceInfo instances returned by
QBluetoothServiceDiscoveryAgent may or may not mark a serial service
with SPP uuid or rfcomm protocol tag. Currently, it guess that that a
custom uuid together with SPP uuid implies an rfcomm setup. If the SPP
uuid was not found, rfcomm is never set (but is a requirement for
QBluetoothSocket). This patch makes QBluetoothSocket on Android a bit
more forgiving by assuming every given QBluetoothServiceInfo instance
requires rfcomm. After all that's the only supported protocol on Android.
Fixes: QTBUG-75035
Change-Id: I498ac5acd2a394b198a113fd23d750bbf17a7f7b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Force value to be a DWORD (unsigned long) instead of HRESULT (signed long).
Fixes
bluetoothsocket_winrt.cpp(770,10): error: case value evaluates to
2147952460, which cannot be narrowed to type 'long' [-Wc++11-narrowing]
Change-Id: I4f1eb75807d4783b835094ad1b33e56f601ffb39
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I518201f08040260e85968347cc4c68330f1b8787
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ib949c16d80a09c47a0bb332e026459438c901031
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I3044324fb300b918ae466d3c4430c4dd55eed2bd
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I3617e22fcded5dc7066bf05c6d7bf791fce4dd02
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ib8de4e76893104f27d79f44440a0186985d9abe5
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I0a446e5bc81e3d306da7c15e0c1907dab459a129
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
get_GattServices is deprecated and we should use the operation's result
to obtain the list of services.
Change-Id: I45e7217f0667ade4fe975e13010238dbe48f197e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GetAllIncludedServices is marked deprecated and GetIncludedServicesAsync
should be used instead.
Change-Id: Ib5778809c1f90be9cddc9dd12e831c998f50469c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I4a555222071c75a56b45477b1a894b929ffc1e58
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have to prevent late callbacks.
Change-Id: Iedb36cdfb9708403bdbd68b68718c4b26f38d657
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
get_GattServices is marked deprecated and GetGattServicesAsync should be
used instead. We should avoid asserts whenever possible as users might
run into "crashes" otherwise.
Change-Id: Ibd07a846f3a23d3390061e42fd034d21ec2b9901
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I6ea4ae73b53cd705156e15ce8820467bddedcf6f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GetAllCharacteristics was deprecated by MS and GetCharacteristicsAsync
should be used. Additionally we should avoid asserts and instead try to
handle errors gracefully whenever possible as users will run into
"crashes" otherwise
Change-Id: I45d52374f8612621b5b3974a973d9a1a95b851ee
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: I92bdddd630d739b83aa8837d238eefbd3108e32e
|
| |\|
| | |
| | |
| | | |
Change-Id: Ieeeab88ca3afd1fb42aafb9e05bf426caec065ef
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I357091799f04a3ef1c8df78960eb63a46e2b3d6c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ide883a3c354eb42ea0017e1d623843967b522083
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Idb12d3bb116d6c5b34f1ca145f473b118b58d5ee
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: Ie85bb5c9311cfdb2f18dc4fd04854ec22e620ff5
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The signal about device disconnections has to be done at the very end of
disconnectFromDevice as a user's application might access an invalid
mDevice otherwise if it tries to reconnect automatically.
The list of device services has to be invalidated when a remote device
disconnects. The same is done in other backends.
Additionally the "valueChanged" callbacks should be unregistered on
device disconnection. Thus we avoid late callbacks which might cause
asserts.
Task-number: QTBUG-74394
Change-Id: I156be8ebefc9d9e5533bc60e7018088641680ba3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
Change-Id: Id7c4409314c2ad5daf5bc9860befe096a2384849
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
[ChangeLog][QtBluetooth][Linux/BlueZ] Fixed missing emission
of QBluetoothSocket::bytesWritten() signal on Bluez v5.46+.
Fixes: QTBUG-74513
Change-Id: I93cb5abe65e13f6a5cc5bb195cc98526a507916a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|