From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2 2/2] dun_gw: Add BlueZ 5 version
Date: Thu, 21 Mar 2013 10:21:32 -0500 [thread overview]
Message-ID: <514B257C.8070303@gmail.com> (raw)
In-Reply-To: <1363093290-8723-2-git-send-email-frederic.danis@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]
Hi Fred,
On 03/12/2013 08:01 AM, Frédéric Danis wrote:
> This patch adds initial implementation of the D-Bus Profile1
> interface and methods responsible for handling Bluetooth connections.
>
> The DUN GW profile interface is registered as soon as a GPRS capable
> modem is registered in oFono.
> ---
> Makefile.am | 3 +
> plugins/bluez5.h | 1 +
> plugins/dun_gw_bluez5.c | 235 +++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 239 insertions(+)
> create mode 100644 plugins/dun_gw_bluez5.c
>
I applied this patch, but I had to fix a minor issue afterwards:
> +static DBusMessage *profile_new_connection(DBusConnection *conn,
> + DBusMessage *msg, void *data)
> +{
> + DBusMessageIter entry;
> + const char *device;
> + int fd;
> + struct ofono_emulator *em;
> + struct ofono_modem *modem;
> +
> + DBG("Profile handler NewConnection");
> +
> + if (dbus_message_iter_init(msg,&entry) == FALSE)
> + goto invalid;
> +
> + if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_OBJECT_PATH)
> + goto invalid;
> +
> + dbus_message_iter_get_basic(&entry,&device);
> + dbus_message_iter_next(&entry);
> +
> + if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_UNIX_FD)
> + goto invalid;
> +
> + dbus_message_iter_get_basic(&entry,&fd);
> + dbus_message_iter_next(&entry);
> +
> + if (fd< 0)
> + goto invalid;
> +
> + DBG("%s", device);
> +
> + /* Pick the first powered modem */
> + modem = modems->data;
> + if (modem == NULL) {
We should be checking for modems == NULL, not modems->data
> + close(fd);
> + return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
> + ".Rejected",
> + "No voice call capable modem");
This was changed to read '...GPRS capable modem'.
> + }
> +
> + DBG("Picked modem %p for emulator", modem);
> +
> + em = ofono_emulator_create(modem, OFONO_EMULATOR_TYPE_DUN);
> + if (em == NULL) {
> + close(fd);
> + return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
> + ".Rejected",
> + "Not enough resources");
> + }
> +
> + ofono_emulator_register(em, fd);
> +
> + return dbus_message_new_method_return(msg);
> +
> +invalid:
> + return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE ".Rejected",
> + "Invalid arguments in method call");
> +}
> +
Regards,
-Denis
next prev parent reply other threads:[~2013-03-21 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 13:01 [PATCH v2 1/2] bluetooth: Rename DUN GW plugin =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2013-03-12 13:01 ` [PATCH v2 2/2] dun_gw: Add BlueZ 5 version =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2013-03-21 15:21 ` Denis Kenzior [this message]
2013-03-21 15:19 ` [PATCH v2 1/2] bluetooth: Rename DUN GW plugin Denis Kenzior
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=514B257C.8070303@gmail.com \
--to=denkenz@gmail.com \
--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.