Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: "Daniel Örstadius" <daniel.orstadius@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/3] Maemo6 MCE: listen to adapter mode changes
Date: Tue, 17 Aug 2010 13:30:51 +0300	[thread overview]
Message-ID: <20100817103051.GA29845@jh-x301> (raw)
In-Reply-To: <AANLkTimpogcSN1eKO9A2aWB1aB7YNZSRD7f-vGMvma9q@mail.gmail.com>

Hi Daniel,

> From: Daniel Orstadius <daniel.orstadius@nokia.com>
> Date: Tue, 17 Aug 2010 11:41:33 +0300
> Subject: [PATCH] Maemo6 MCE: listen to adapter powered state
> 
> Registers a callback in 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.
> ---
>  plugins/maemo6.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 46 insertions(+), 2 deletions(-)

A couple of issues I noticed:

> +	DBG("adapter_powered called with %d", (int) powered);

I don't think the int cast is necessary here. Or do you get a warning
otherwise?

> +	dbus_message_append_args(msg, DBUS_TYPE_UINT32, &radio_states,
> +				DBUS_TYPE_UINT32, &radio_mask);

DBUS_TYPE_INVALID is missing from the end of the arguments list.

> +}
> +
> +
>  static int mce_probe(struct btd_adapter *adapter)

Why the two consecutive empty lines? Please remove one.

> @@ -132,6 +173,9 @@ static int mce_probe(struct btd_adapter *adapter)
>  	watch_id = g_dbus_add_signal_watch(conn, NULL, MCE_SIGNAL_PATH,
>  					MCE_SIGNAL_IF, MCE_RADIO_STATES_SIG,
>  					mce_signal_callback, adapter, NULL);
> +
> +	btd_adapter_register_powered_callback(adapter, adapter_powered);
> +
>  	return 0;
>  }
>  

It seems you're missing the corresponding unregister_powered_callback
call in mce_remove().

Johan

  reply	other threads:[~2010-08-17 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13  9:19 [PATCH 2/3] Maemo6 MCE: listen to adapter mode changes Daniel Örstadius
2010-08-17  8:46 ` Daniel Örstadius
2010-08-17 10:30   ` Johan Hedberg [this message]
2010-08-17 12:54     ` Daniel Örstadius
2010-08-17 13:33       ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100817103051.GA29845@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=daniel.orstadius@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox