summaryrefslogtreecommitdiffstats
path: root/plugins/zte.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-08-05 02:14:08 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-08-05 17:59:55 +0200
commit79e1638b40075a5c00871b3e7766ea43bbfde79a (patch)
tree13e9d3feaf02b636f9fad749051bc83189ad54a8 /plugins/zte.c
parentdd1eca3eebde1792a4f3aef98f7971962dcca4f3 (diff)
downloadofono-79e1638b40075a5c00871b3e7766ea43bbfde79a.tar.bz2
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.
Diffstat (limited to 'plugins/zte.c')
-rw-r--r--plugins/zte.c19
1 files changed, 18 insertions, 1 deletions
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;