From 79e1638b40075a5c00871b3e7766ea43bbfde79a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2011 02:14:08 +0200 Subject: zte: Set options for TTY port configuration Seems like the ZTE modems are a bit more picky than others, so set proper default options here. At least of the ZTE modems work a lot more reliable this way. --- plugins/zte.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'plugins/zte.c') diff --git a/plugins/zte.c b/plugins/zte.c index cc14949f..74b878fa 100644 --- a/plugins/zte.c +++ b/plugins/zte.c @@ -102,6 +102,7 @@ static GAtChat *open_device(struct ofono_modem *modem, GIOChannel *channel; GAtSyntax *syntax; GAtChat *chat; + GHashTable *options; device = ofono_modem_get_string(modem, key); if (device == NULL) @@ -109,7 +110,23 @@ static GAtChat *open_device(struct ofono_modem *modem, DBG("%s %s", key, device); - channel = g_at_tty_open(device, NULL); + options = g_hash_table_new(g_str_hash, g_str_equal); + if (options == NULL) + return NULL; + + g_hash_table_insert(options, "Baud", "115200"); + g_hash_table_insert(options, "Parity", "none"); + g_hash_table_insert(options, "StopBits", "1"); + g_hash_table_insert(options, "DataBits", "8"); + g_hash_table_insert(options, "XonXoff", "off"); + g_hash_table_insert(options, "RtsCts", "on"); + g_hash_table_insert(options, "Local", "on"); + g_hash_table_insert(options, "Read", "on"); + + channel = g_at_tty_open(device, options); + + g_hash_table_destroy(options); + if (channel == NULL) return NULL; -- cgit v1.2.3