Commit Graph

10 Commits

Author SHA1 Message Date
Juha Vuolle 2eede8a018 Avoid multiple client sockets in pingpong bluetooth example
This commit guards against creating multiple client sockets if multiple
services are found. In addition the service scanning is stopped when
a service has been found and we start connecting a bluetooth socket.

Fixes: QTBUG-100289
Change-Id: Iac2e7eaca17a186ac2d2f62e338be16911f08032
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 788c4980e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-02-12 19:21:22 +00:00
Ivan Solovev e2f13481ee PingPong example: let the parent QObject do the cleanup
The m_timer and m_serverInfo instances are created using 'this' as a
parent, so we do not need to explicitly delete them in the destructor,
but let the parent object deal with them.
This also prevents a crash at application close.

Change-Id: If91f01e1ab6dc8e839a06773464eeb9858d2fd36
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 4d2df2461f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-01-24 11:00:54 +00:00
Juha Vuolle f43bb5860f Store the serviceinfo in pingpong example
The service info returned by the QBluetoothServer::listen() overload
that returns it needs to be stored or otherwise it will be destroyed.

The consequence was that the SDP "advertisement" didn't properly
include the added pingpong service record on Windows.

Task-number: QTBUG-100042
Change-Id: I79cbd0f574e35bbc1c9c3123ce8382f3aad296d4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit debf0fd212)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-01-24 06:39:38 +00:00
Kai Koehne b171cddac0 Fix outdated BSD license header
Change-Id: I28f5936913a6127806325df34af4bf71a142e72e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-10-17 11:17:54 +00:00
Alex Blasche 9fcdb6bc25 Improve pingpong example
The following adjustments were done:

- Use new Qt connect syntax
- Add QLoggingCatergory enablers (easy to enable by uncommenting)
- Makes the UI more robust to High vs Low DPI issues

Change-Id: Iad99a67ac375de828883b4add99d440f7a6994c6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-06-28 07:05:44 +00:00
Alex Blasche 2aa2a2c7e8 Adjust pingpong example to Android UUID SDP discovery bug
Task-number: QTBUG-61392
Change-Id: Ie2173b57093db9285e8fc90dbec66f81b002f7c6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-23 19:48:43 +00:00
Jani Heikkinen 7354c6d393 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-16 11:48:42 +00:00
Alex Blasche b32a8ffc58 Fix pingpong example
1.) ElidedMiddle makes the text disappear on Debian and Ubuntu. Swapping
elide mode to wrap mode which serves the same purpose

2.) The server was started as rfcomm channel but the client used L2Cap
protocol. It may have worked anyway because rfcomm is based on l2cap.
In any case this shouldn't be relied upon especially since some
platforms don't support l2cap sockets as part of the public API offering.
This way the example becomes more widely usable.

Change-Id: Ibbcd7029d5843e86af0313037b6433017eb92c76
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-09-26 15:16:30 +02:00
Oleg Shparber 19a8f2f275 Replace all occurrences of Q_EMIT with emit
Change-Id: Ieec72048837abe70b0187086b265bcde96c7d6cd
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-04-29 12:22:45 +02:00
Nedim Hadzic 3909595e89 QML PingPong example added
Example presents the socket communication between two Bluetooth
devices. The basic concept is the ping pong game, where coordinate
updates of the ball and pedals are sent via socket.

Change-Id: I61d8eb0baaa11c1485a923bb0a6ae6b89cd0e6a9
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-04-02 14:06:19 +02:00