Commit Graph

10 Commits

Author SHA1 Message Date
Claudio Takahasi
0ddc54ca5f Set auto connect from maemo6 plugin
Inform the adapter that the system has been unlocked when the MCE
sends the tklock_mode_ind signal. This signal will trigger the
automatic re-connections for the devices selected by the profiles.
Profiles register ATTIO callbacks to indicate that ATT connection
is required.
2011-10-05 18:01:48 +03:00
Anderson Briglia
cd907d8c84 Add display lock watcher on maemo6 plugin
Implements display status signal watcher in maemo6 plugin.
2011-10-05 18:01:43 +03:00
Claudio Takahasi
11ddc90c92 Serialize powering up/down in maemo6 plugin
This patch fixes wrong adapter state when using Management interface.
When bluetoothd starts, the adapter should be switched to the state
informed by Maemo6 MCE. In the current implementation, Maemo6 plugin
sends set powered command when the adapter is still powering up, the
last command sent fails(kernel returns EALREADY).
2011-09-12 15:17:22 +03:00
Daniel Orstadius
1b80034b89 Maemo6 MCE: skip first adapter_powered callback
The maemo6 MCE plugin should be used with the flag InitiallyPowered
in main.conf set to 'true' so that BlueZ powers on the adapter
and leaves it in that state when the daemon is started. The plugin
will read the radio state from the MCE and set the state
accordingly. The maemo6 plugin is a btd_adapter_driver and those
drivers are loaded after BlueZ has read the BD address etc from the
adapter.

This patch adds a boolean flag in the callback to ignore the initial
powering on of the adapter by BlueZ, since it shouldn't be
propagated to the MCE. With InitiallyPowered set to 'false' the
adapter_powered callback is not called when the adapter is turned
on at BlueZ startup, which is why this wasn't implemented before.
2011-02-24 16:17:38 -03:00
Daniel Orstadius
f47205ab9b Fix Maemo6 MCE: set state variable directly
If the state variable is not updated until mce_signal_callback and
SetProperty(Powered) is called two times quickly, then the second
call will not generate a request to change the radio state of the
MCE if its corresponding call to adapter_powered occurs before the
first triggering of mce_signal_callback.

With this patch two calls to the MCE are executed, although there
might still be an unnecessary power cycle in that
mce_signal_callback is also triggered twice.
2010-11-04 14:39:43 +00:00
Rafal Michalski
4ebe698e22 Adjust mce_bt_set flag to gboolean type values
This patch makes assignment to mce_bt_set flag more readable and makes
sure that it takes only TRUE or FALSE value from gboolean type.
2010-10-13 17:23:21 +03:00
Rafal Michalski
ce5207cdc2 Fix handlig for gboolean mce_bt_set field
(sigvalue & MCE_RADIO_STATE_BLUETOOTH) evaluates to 8 instead of 1
(TRUE). A double negation makes sure that it's either 1 or 0.
2010-09-30 13:48:10 +03:00
Daniel Orstadius
5ac50f2903 Maemo6 MCE: handle race condition at startup
Since bluetoothd power cycles the adapter at startup, it is possible
that the plugin gets a reply from reading the state of the MCE and
tries to power the adapter before it is down. The patch checks for
that situation and if it occurs postpones powering the adapter to
the powered state callback.
2010-08-18 16:30:50 +03:00
Daniel Orstadius
f2591f09af Maemo6 MCE: listen to adapter powered state
Registers a callback to btd_adapter to get notified when the
powered state of the adapter is changed. This is needed to update
the state stored in the MCE if the adapter is powered on or off
using for example SetProperty(Powered). The current setting of
the MCE is saved in a variable and if the notification to the
plugin does not match this value the MCE is updated accordingly
using its DBus method for setting radio states.
2010-08-17 16:31:41 +03:00
Luiz Augusto von Dentz
c194337f35 Introduce maemo6 plugin for following the radio state signal
Adds a plugin for listening to the MCE (Mode Control Entity)
radio state signal. Implemented in a new source file,
configuration flag for enabling it added to the build files.

The plugin registers an adapter driver containing a DBus signal
watch for receiving MCE_RADIO_STATES_SIG messages. On receiving
the signal, it sets the powered state of the adapter according
to the Bluetooth field.
2010-07-09 12:05:56 +03:00