Commit Graph

71 Commits

Author SHA1 Message Date
Andrzej Hunt
664ceee384 fdo#74697 Add Bluez 5 support for impress remote.
Change-Id: I32f781e4cb662653a2993803cbdc0be90f8e3d0d
Reviewed-on: https://gerrit.libreoffice.org/8821
Reviewed-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Tested-by: Andrzej Hunt <andrzej.hunt@collabora.com>
2014-04-10 19:28:39 +00:00
Caolán McNamara
904fe66ce1 downgrade sdremote.bluetooth warning to info
Change-Id: Iec39551dafead84f4f0ad246e7e1d1ad16e15b4a
2013-11-14 11:05:38 +00:00
Arnaud Versini
ebf5e56e20 Name threads for debug purpose
Change-Id: Id99ba394b898b7da0057d4a145ce8dce46122782
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-11-07 09:33:06 +01:00
Tor Lillqvist
a7724966ab Bin comments that claim to say why some header is included
They are practically always useless, often misleading or obsolete.

Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-22 16:56:28 +03:00
Stephan Bergmann
0f1357200e D-Bus is not thread safe
...so it could happen that both the main thread at

> internal_bus_get
> dbus_bus_get_private
> avahi_dbus_bus_get
> avahi_client_new
> sd::AvahiNetworkService::setup
> sd::DiscoveryService::DiscoveryService
> sd::DiscoveryService::setup
> SdDLL::RegisterRemotes
[...]

as well as the thread

> internal_bus_get
> dbus_bus_get
> dbusConnectToNameOnBus
> sd::BluetoothServer::run
> threadFunc
> osl_thread_start_Impl
> start_thread

spawned from the main thread at

> sd::BluetoothServer::setup
> sd::RemoteServer::setup
> SdDLL::RegisterRemotes
[...]

are in D-Bus's internal_bus_get simultaneously (with disastrous consequences,
like SEGV) despite the _DBUS_LOCK(bus) there, unless you previously called
dbus_threads_init_default.  (Which the D-Bus documentation makes you believe can
be called from multiple threads, though a look at the implemenation makes it
clear that it really should be called from the main thread before any other
threads are created---which we still don't do; oh my.)

Other places that (indirectly) use D-Bus (tubes/source/file-transfer-helper.c,
vcl/generic/fontmanager/fontconfig.cxx, vcl/unx/gtk/window/gtksalframe.cxx might
need this, too.

Change-Id: I912829c615b46b05a89c07bd044b04f1e5f5e7ba
2013-10-14 18:00:54 +02:00
Tor Lillqvist
09a4c4d176 Odd instability in what Bluetooth headers to include in OS X SDKs
Change-Id: Ia8e835373bea3287cf16f3d505dbb420c874fed3
2013-07-30 20:48:19 +03:00
Michael Stahl
1b5763c406 BluetoothServer::addCommunicator not unused after all
was erroneously removed in 6a59659541

Change-Id: Ib95fccaaccb8baf269f7d393af00d9b95b25161a
2013-07-01 14:11:50 +02:00
Petr Vorel
6a59659541 Remove unused code
Change-Id: Id789250d6aeae642ef5c712e33c5583628638218
Reviewed-on: https://gerrit.libreoffice.org/4604
Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
2013-07-01 11:39:43 +00:00
Fridrich Štrba
cd3b1847a5 Deprecated conversion to char* from string litteral
Change-Id: I64fc36b38be59c909aa96a9faf876232caaac182
2013-06-10 14:03:39 +02:00
Mark Wielaard
44a7759b29 valgrind: Initialize all of struct sockaddr_rc for binding AF_BLUETOOTH.
valgrind doesn't know that struct sockaddr_rc contains some padding that
isn't used. Since we pass bind sizeof (struct sockaddr_rc) valgrind will
check all bytes are initialized. So explicitly clear all bytes before
passing to bind.

https://bugs.kde.org/show_bug.cgi?id=320116 tracks adding explicit
support to valgrind.

Change-Id: I05d2f221a5794228dae3077e8ea1bcda5ba1f8b0
Reviewed-on: https://gerrit.libreoffice.org/3998
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-05-22 05:04:40 +00:00
Luboš Luňák
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Julien Nabet
0e2ad090d4 Some cppcheck cleaning
Change-Id: I53ddb92d1fef3513536fa9a54bcedad35581f4aa
2013-03-06 23:07:23 +01:00
Michael Stahl
846e0f1563 sd: BluetoothServer: put the ifdeffery in the right place
Change-Id: Ide62e3624271c3550e17ea2386363cffe8c2897d
2013-03-01 12:19:22 +01:00
Jan Holesovsky
8eeb0acb44 MinGW: Make mpImpl available only on Linux.
Change-Id: I35c3ccab01e4607510bd67628f4dfa94633aa8d7
2013-03-01 10:53:41 +01:00
Michael Stahl
01b913387b sd: BluetoothServer: appease MSVC's appetite for type definitions
Change-Id: I05a0cc7534e6504c73ad1ccee42ca6e9ecb489ed
2013-02-28 22:20:53 +01:00
Markus Mohrhard
75082a3bf7 coverity#988423: fix memory leak
Change-Id: I3ac2cca7e24e6cc1b47b42c2d42bc7caee91b559
Reviewed-on: https://gerrit.libreoffice.org/2458
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
2013-02-28 09:54:27 +00:00
Tor Lillqvist
f49b4581a0 Avoid warning on non-Linux: private field 'mpImpl' is not used
Change-Id: I0f7e35254ecbf604c375ccebaa58d769a51e43f1
2013-02-19 19:57:26 +02:00
Michael Meeks
0c3d3d58c9 sdremote: fix linux conditional.
Change-Id: I911863f07b08e771d78a4a98d9a4f82c93a7d55e
2013-02-19 10:07:43 +00:00
Michael Meeks
c45e45c5c3 sdremote: listening to dynamic changes to adapters.
Allows LibreOffice to start with no bluetooth, and for it to
appear and disappear dynamically at run-time, cleaning up stale
bluetooth sockets, and re-binding successfully each time.

Change-Id: Ifa04c8cc1859c98adca94ac0e57c7ebd85f2f31f
2013-02-19 09:12:20 +00:00
Michael Meeks
e8f2870be1 sdremote: re-work discoverable property get/set to use libdbus.
Change-Id: I5e11a0fcfd8db648a40c738cbc8181889cb36136
2013-02-19 09:12:15 +00:00
Michael Meeks
033a2c71fd sdremote: switch to a non-blocking socket, and polling glib mainloop.
Change-Id: I84c0a522fe16fbc8fc86a8e4bccb84aec0a1acd1
2013-02-19 09:12:10 +00:00
Michael Meeks
f45ea70357 sdremote: re-write SDP registration to use raw dbus-1 not dbus-glib.
Change-Id: I65ff5e603b6719df69b3c2aef7ff438ad54d23e2
2013-02-19 09:12:05 +00:00
Michael Meeks
fe72f19a9b improve bluetooth discoverability toggling API.
Change-Id: I289d43fcb173b64b01183a41f780bc74d2ba0abe
2013-02-19 09:12:00 +00:00
Tor Lillqvist
6ce04df28c Handle gracefully the remote end closing the RFCOMM channel
Avoids a crash if one presses the "back" key on the Android remote
control.

Change-Id: Icc7562676a79910b77c7f95d76ce07c348ec2b22
2013-02-18 22:13:03 +02:00
Tor Lillqvist
b008101fd7 Plug autorelease leak
Change-Id: I0e1c04547b90279c49851d6a877917d6376b33ef
2013-02-18 13:18:06 +02:00
Tor Lillqvist
da3d37b968 Be specific in the logging as multiple threads involved
Sure, each SAL_INFO output line includes the thread ID, but still,
good to avoid confusion from where this line is coming.

Change-Id: Idc531640e661ed363c7badbad8b83fbb43eaf3ad
2013-02-18 13:17:20 +02:00
Tor Lillqvist
21bec368ad WaE: comparison is always true due to limited range of data type
Change-Id: Id88e1d8a29972ca9384ddc905697d7d32d94cc35
2013-02-18 11:59:41 +02:00
Tor Lillqvist
730cff74c0 std::vector::data() is C++11
Change-Id: I729606a879cfd6330ce9cf3ad7723d2558c07c4a
2013-02-18 11:59:41 +02:00
Tor Lillqvist
bd6201ee4d Fix compilation for Linux and hopefully Windows, too
Change-Id: Ib8d6e4e73443d5ee233133cbb9e201783405c49a
2013-02-16 12:31:39 +02:00
Tor Lillqvist
f9685dc555 More work on the Impress Remote Control Bluetooth code for OS X
Mostly the work of Thorsten, from December, adapted to compile against
the current remote control code, and with one or two crucial things
added. Plus lots of SAL_INFO calls added; once it works well many of
them can be dropped. Does not work properly yet, do not cherry-pick
just this to 4.0.

Change-Id: I53361b49a2b6938c768be1ea0fc17eb5e46b6aa4
2013-02-16 12:03:27 +02:00
Luboš Luňák
a04ab93608 Revert "fix build", not needed in master
I meant to do this for 4-0, not for master, as the commits mentioned in the message
show, this is not needed in master.

This reverts commit b60ccd4d4d.
2013-02-15 14:32:27 +01:00
Luboš Luňák
b60ccd4d4d fix build
Caused by 185e1be6cd1954b8cc5a302c879384f2549cd060,
fix is more or less d0d07cd297.

Change-Id: Ia7d228139126b3e60370b85c106bc970f4e68cce
Reviewed-on: https://gerrit.libreoffice.org/2154
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
2013-02-14 18:31:37 +00:00
Tor Lillqvist
bc96a84370 Fix build against Mac OS X SDK 10.4
Change-Id: I077afe48e0d375f75a8c35bc87c6c177b68512f7
2013-02-14 16:52:34 +02:00
Tor Lillqvist
100ac0876f Start on Bluetooth code for the Impress Remote for OS X
Work in progress. It sets up the SDP service record and registers it,
and that seems to work. Does not do anything with it yet.

I wonder if the current approach to use the standard SerialPort
service class will work for Macs, as they by default have one
SerialPort service running, "Bluetooth-PDA-Sync", whatever that
is.

There is no code in the Android app to handle the case of there being
several Serial Port services on the computer it wants to connect to,
so what happens then when there are two will be interesting to see.

(I can't find in the Android API any way to enumerate services that
use the same service class. If there was, the app could choose the
correct one based on its name.)

So probably we should pretty soon switch to using a dedicated service
class UUID instead of using the standard serial port one. As we
already have the app out in the wild it will probably have to be
modified to look for both Serial Port and our own service then? Sigh.

Change-Id: I1bee6403642e9b8953b5a8fa8fb5fe6a9dc76a09
2013-02-14 12:10:40 +02:00
Tor Lillqvist
646dc01ea1 Use the remote control same service name on Windows, too
Change-Id: I45ecc4a745722cc6bf1f5017429a3e532200bf03
2013-02-12 17:17:46 +02:00
Michael Meeks
e48b708da6 sdremote - cleanup and annotate bluetooth SDP record.
Change-Id: Ie6c3d12387cececce4e169482659cbcbbcfd0975
2013-02-12 11:04:08 +00:00
Jan Holesovsky
9e27b9057e sdremote: More logging.
Change-Id: I5fe792ddfe1fac5166865c51014d87309d48bab2
2013-02-07 23:48:43 +01:00
Michael Meeks
e99b540d89 sdremote: kill memory corruption / mis-matched alloc/free's.
Change-Id: I253f28d7c83371282adde86c8eaadd6f25beff5a
2013-01-26 12:56:42 +11:00
Luboš Luňák
e7f7053b22 remove no longer needed hack 2012-12-27 16:14:27 +01:00
Luboš Luňák
d0d07cd297 ugly workaround for msvc+ccache problem with gbuild MSC define
Change-Id: I06ab10df77e2b3598f7268173206429596a50217
2012-12-21 11:18:22 +01:00
Peter Foley
f7e37ae44f Revert "define must be overridden on cmdline"
This reverts commit 0743ccea54.

This seems to be unnecessary and generates a lot of warning spam.

Conflicts:

	sd/source/ui/remotecontrol/BluetoothServer.cxx

Change-Id: Ib0cda3ca560a5ddc4ba86d5a0c80774a992d7296
2012-12-15 09:39:25 -05:00
Tor Lillqvist
cbbdd2f07e Correct the function names in two SAL_INFOs 2012-12-14 09:41:49 +02:00
Luboš Luňák
0ba0980b1c PCH for Library_sd 2012-12-13 21:49:58 +01:00
Noel Grandin
584cd8d1c2 Fix: <errno.h> needs to be included under Linux
Change-Id: I00cbeaa3d00b6001b1b9adf00059f27d7affb08f
2012-12-06 13:00:22 +02:00
Stephan Bergmann
ec530530b7 Fix Linux-specific code
Change-Id: I36971b78dcc2fb0ab8570c8b80feb51bf6043e54
2012-12-06 11:38:13 +01:00
Jan Holesovsky
1ec666e2c2 MinGW: Fix BluetoothServer build.
Change-Id: Ie04d3c1703bcf22b746d1ee965f9ff3155a9ffeb
2012-12-06 10:14:02 +01:00
Peter Foley
0743ccea54 define must be overridden on cmdline
Change-Id: If85a60d9db69ab96c8a77b7715fc2a51fcd7ba51
2012-12-05 19:45:36 -05:00
Stephan Bergmann
9f417544f8 warning C4100: 'aDiscoverable' : unreferenced formal parameter
Change-Id: I7bb5e40e8da943926f7fd8b1f76e010d073362c9
2012-12-05 15:06:51 +01:00
Thorsten Behrens
c50fdef7cf cleanup - no need for salhelper::Thread mostly
Change-Id: I27461e094141efd364a2c21da75151da490da2f3
2012-11-24 15:01:44 +01:00
Andrzej J.R. Hunt
cf480d6c37 Move the DBusGObjectPath typedef and formatting changes to Bluetooth includes.
Change-Id: I7c1338ef2dae7831cddda8378a031a58011d7b17
2012-09-20 10:25:47 +02:00