From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v4 3/6] mbmmodem: add location-reporting driver implementation
Date: Wed, 23 Feb 2011 18:57:23 -0600 [thread overview]
Message-ID: <4D65ACF3.9040508@gmail.com> (raw)
In-Reply-To: <1298399715-9617-4-git-send-email-lucas.demarchi@profusion.mobi>
[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]
Hi Lucas,
> +static int mbm_create_data_chat(struct ofono_location_reporting *lr)
> +{
> + struct gps_data *gd = ofono_location_reporting_get_data(lr);
> + struct ofono_modem *modem;
> + const char *gps_dev;
> + GAtSyntax *syntax;
> + GIOChannel *channel;
> + int fd;
> +
> + modem = ofono_location_reporting_get_modem(lr);
> + gps_dev = ofono_modem_get_string(modem, "GPSDevice");
> +
> + channel = g_at_tty_open(gps_dev, NULL);
> + if (channel == NULL)
> + return -1;
> +
> + syntax = g_at_syntax_new_gsm_permissive();
> + gd->data_chat = g_at_chat_new(channel, syntax);
> + fd = g_io_channel_unix_get_fd(channel);
> +
> + g_at_syntax_unref(syntax);
> + g_io_channel_unref(channel);
> +
> + if (gd->data_chat == NULL)
> + return -1;
> +
> + return fd;
> +}
> +
Why do you bother creating a GAtChat for the NMEA port? It seems that a
GIOChannel or a simple fd would be enough.
Also, what happens if the channel is hupped by the modem? Shouldn't we
have a watch in the core for that and set Enabled accordingly?
Regards,
-Denis
next prev parent reply other threads:[~2011-02-24 0:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 18:35 [PATCH v4 0/6] Add location-reporting atom Lucas De Marchi
2011-02-22 18:35 ` [PATCH v4 1/6] location-reporting: add public header Lucas De Marchi
2011-02-22 18:35 ` [PATCH v4 2/6] location-reporting: add atom implementation Lucas De Marchi
2011-02-22 18:35 ` [PATCH v4 3/6] mbmmodem: add location-reporting driver implementation Lucas De Marchi
2011-02-24 0:57 ` Denis Kenzior [this message]
2011-02-24 2:26 ` Lucas De Marchi
2011-02-24 4:21 ` Denis Kenzior
2011-02-22 18:35 ` [PATCH v4 4/6] mbm: add location-reporting atom Lucas De Marchi
2011-02-22 18:35 ` [PATCH v4 5/6] udev: add location-reporting device to mbm Lucas De Marchi
2011-02-22 18:35 ` [PATCH v4 6/6] location-reporting: add documentation Lucas De Marchi
2011-02-24 0:55 ` [PATCH v4 0/6] Add location-reporting atom 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=4D65ACF3.9040508@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