All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo F. Padovan <gustavo@padovan.org>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] Add dun_enable() function
Date: Tue, 03 Aug 2010 19:58:29 -0300	[thread overview]
Message-ID: <20100803225829.GA28060@vigoh> (raw)
In-Reply-To: <33AB447FBD802F4E932063B962385B3528D48149@shsmsx501.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2697 bytes --]

Hi Zhenhua,

* Zhang, Zhenhua <zhenhua.zhang@intel.com> [2010-08-02 22:28:47 +0800]:

> Hi Padovan,
> 
> Gustavo F. Padovan wrote:
> > dun_enable() is called by setting the Powered property to true.
> > It creates a rfcomm link throught the BlueZ Serial API.
> > ---
> >  drivers/dunmodem/dunmodem.h |    1 +
> >  plugins/bluetooth.h         |    1 +
> >  plugins/dun.c               |   61
> >  +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 61
> > insertions(+), 2 deletions(-) 
> > 
> > diff --git a/drivers/dunmodem/dunmodem.h b/drivers/dunmodem/dunmodem.h
> > index 6bbf7b9..16eb9e7 100644
> > --- a/drivers/dunmodem/dunmodem.h
> > +++ b/drivers/dunmodem/dunmodem.h
> > @@ -23,6 +23,7 @@
> > 
> >  struct dun_data {
> >  	char *dun_path;
> > +	const char *rfcomm;
> >  };
> > 
> >  #endif
> > diff --git a/plugins/bluetooth.h b/plugins/bluetooth.h
> > index 09e6efa..c20b36d 100644
> > --- a/plugins/bluetooth.h
> > +++ b/plugins/bluetooth.h
> > @@ -22,6 +22,7 @@
> >  #define	BLUEZ_MANAGER_INTERFACE		BLUEZ_SERVICE ".Manager"
> >  #define	BLUEZ_ADAPTER_INTERFACE		BLUEZ_SERVICE ".Adapter"
> >  #define	BLUEZ_DEVICE_INTERFACE		BLUEZ_SERVICE ".Device"
> > +#define	BLUEZ_SERIAL_INTERFACE		BLUEZ_SERVICE ".Serial"
> > 
> >  #define HFP_AG_UUID	"0000111F-0000-1000-8000-00805F9B34FB"
> >  #define DUN_GW_UUID	"00001103-0000-1000-8000-00805F9B34FB"
> > diff --git a/plugins/dun.c b/plugins/dun.c
> > index 9b4288e..7dc8422 100644
> > --- a/plugins/dun.c
> > +++ b/plugins/dun.c
> > @@ -25,6 +25,7 @@
> >  #include <stdio.h>
> >  #include <string.h>
> >  #include <errno.h>
> > +#include <gdbus.h>
> >  #include <glib.h>
> >  #include <ofono.h>
> > 
> > @@ -138,10 +139,66 @@ static void dun_remove(struct ofono_modem
> >  	*modem) ofono_modem_set_data(modem, NULL);
> >  }
> > 
> > +static void dun_connect_reply(DBusPendingCall *call, gpointer
> > user_data) +{
> > +	struct ofono_modem *modem = user_data;
> > +	struct dun_data *data = ofono_modem_get_data(modem);
> > +	const char *dev;
> > +	DBusError derr;
> > +	DBusMessage *reply, *msg;
> > +
> > +	reply = dbus_pending_call_steal_reply(call);
> > +
> > +	if (ofono_modem_get_powered(modem))
> > +		goto done;
> > +
> > +	if (!dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &dev,
> > +				DBUS_TYPE_INVALID))
> > +		goto done;
> > +
> > +	data->rfcomm = dev;
> 
> One more comment here, I'd suggest to use g_strdup(dev). Because the device
> String is from dbus reply and later we will unref the reply. What do you think?
> 

Thanks for all the comments, I fix the patches and resend them. ;)

-- 
Gustavo F. Padovan
http://padovan.org

  reply	other threads:[~2010-08-03 22:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30  2:09 [PATCH 1/3] Bluetooth DUN modem prototype Gustavo F. Padovan
2010-07-30  2:09 ` [PATCH 2/3] Add dun_enable() function Gustavo F. Padovan
2010-07-30  2:09   ` [PATCH 3/3] Add dun_disable() to power down the modem Gustavo F. Padovan
2010-08-02 14:24   ` [PATCH 2/3] Add dun_enable() function Zhang, Zhenhua
2010-08-02 14:28   ` Zhang, Zhenhua
2010-08-03 22:58     ` Gustavo F. Padovan [this message]
2010-08-02 14:33 ` [PATCH 1/3] Bluetooth DUN modem prototype Zhang, Zhenhua

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=20100803225829.GA28060@vigoh \
    --to=gustavo@padovan.org \
    --cc=ofono@ofono.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.