Commit Graph

6 Commits

Author SHA1 Message Date
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