diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-08-05 02:14:08 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-08-05 17:59:55 +0200 |
commit | 79e1638b40075a5c00871b3e7766ea43bbfde79a (patch) | |
tree | 13e9d3feaf02b636f9fad749051bc83189ad54a8 | |
parent | dd1eca3eebde1792a4f3aef98f7971962dcca4f3 (diff) | |
download | ofono-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.
-rw-r--r-- | plugins/zte.c | 19 |
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; |