Hi Daniel,
On 12/13/2011 09:00 AM, Daniel Wagner wrote:
> From: Daniel Wagner <[email protected]>
>
> ---
> Makefile.am | 2 +-
> elect/dial.c | 125
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 125 insertions(+), 2 deletions(-)
>
<snip>
> +static int open_serial(struct elect_dial *dial)
> +{
> + GAtSyntax *syntax;
> + GIOChannel *channel;
> +
> + channel = g_at_tty_open(dial->path, NULL);
> + if (channel == NULL)
> + return -EIO;
> +
> + syntax = g_at_syntax_new_gsm_permissive();
> + dial->chat = g_at_chat_new(channel, syntax);
> + g_io_channel_unref(channel);
> + g_at_syntax_unref(syntax);
> +
> + if (dial->chat == NULL)
> + return -EIO;
> +
> + g_at_chat_set_debug(dial->chat, dial_debug, "Control");
> +
> + return 0;
> +}
> +
This is another case where the setup of the transport is really breaking
your abstractions. While this might work for RFCOMM ttys which are just
fake ttys (e.g. no serial options, etc) this won't work for real ttys.
You really need to abstract this part and let the plugins setup the
transports. Ideally the core should receive a fully set-up file
descriptor and take it from there.
See src/emulator.c inside oFono for some ideas.
Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono