Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC] HFP support into oFono and BlueZ
Date: Tue, 12 Jan 2010 18:54:59 -0600	[thread overview]
Message-ID: <201001121854.59479.denkenz@gmail.com> (raw)
In-Reply-To: <fbf08281001110908s2c3412m456b3aa980b8ca10@mail.gmail.com>

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

Hi Padovan,

Initial impressions:

+static DBusConnection *connection;
+static char *ofono_handsfree_path;
+
+
+static int timeout;
+

These globals seem to belong in per-modem user data unless you only want 1 HFP 
device per system?

+
+GIOChannel *g_at_get_channel_from_fd(int fd)
+{
+	GIOChannel *channel;
+	struct termios ti;
+
+	/* Switch TTY to raw mode */
+	memset(&ti, 0, sizeof(ti));
+	cfmakeraw(&ti);
+	tcflush(fd, TCIOFLUSH);
+	tcsetattr(fd, TCSANOW, &ti);
+
+	channel = g_io_channel_unix_new(fd);
+
+	if (channel == NULL) {
+		close(fd);
+		return NULL;
+	}
+
+	g_io_channel_set_close_on_unref(channel, TRUE);
+
+	return channel;
+}

Seriously, what are you trying to do here?  If you want a GIOChannel simply 
use g_io_channel_unix_new(fd) and pass it to gatchat.  See plugins/phonesim.c 
phonesim_enable() for details.  That operates on a TCP socket.

+struct ofono_modem *ofono_modem_get_by_path(const char *path);
+

You don't need this, see below.

+	g_dbus_register_interface(conn, obj_path, HFP_AGENT_INTERFACE,
+			agent_methods, NULL, NULL, data, NULL);
+

You can pass the modem object as userdata for the agent when registering the 
interface.  The modem will thus be available as 'data' in 
hfp_agent_new_connection, etc.

Regards,
-Denis

  parent reply	other threads:[~2010-01-13  0:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 17:08 [RFC] HFP support into oFono and BlueZ Gustavo F. Padovan
2010-01-11 19:05 ` Gustavo F. Padovan
2010-01-13 23:39   ` Gustavo F. Padovan
2010-01-18 11:38     ` Luiz Augusto von Dentz
2010-01-17 22:37       ` Denis Kenzior
2010-01-19  8:02         ` Johan Hedberg
2010-01-19  9:30         ` Luiz Augusto von Dentz
2010-01-19 10:33           ` Johan Hedberg
2010-01-19 12:26             ` Luiz Augusto von Dentz
2010-01-20 19:58     ` Gustavo F. Padovan
2010-01-21  6:28       ` Zhang, Zhenhua
2010-01-21  7:54       ` Zhao Forrest
2012-08-21 22:46         ` Lucas De Marchi
2010-01-21 19:22       ` Johan Hedberg
2010-01-21 19:27         ` Johan Hedberg
2010-01-27 19:12       ` HFP support into BlueZ and oFono Gustavo F. Padovan
2010-01-27 19:12         ` [PATCH 1/2] clean up audio/gateway.c Gustavo F. Padovan
2010-01-27 19:12           ` [PATCH 2/2] Implement HandsfreeGateway Interface Gustavo F. Padovan
2010-01-27 19:12             ` [PATCH] Add HFP support through BlueZ Gustavo F. Padovan
2010-01-27 20:17               ` Marcel Holtmann
2010-02-01  3:15           ` [PATCH 1/2] clean up audio/gateway.c Zhenhua Zhang
2010-01-27 19:17         ` HFP support into BlueZ and oFono Gustavo F. Padovan
2010-01-13  0:54 ` Denis Kenzior [this message]
2010-01-13  1:44   ` [RFC] HFP support into oFono and BlueZ Marcel Holtmann

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=201001121854.59479.denkenz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox