From adaa4da6bb46042c127714a20fde31ff12fa96a2 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 23 Feb 2010 03:27:16 +0000 Subject: 'Fix the huawei e220 at commands' by Jar git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1115 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- plugin_huawei.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'plugin_huawei.c') diff --git a/plugin_huawei.c b/plugin_huawei.c index 69215fa..b94559a 100644 --- a/plugin_huawei.c +++ b/plugin_huawei.c @@ -94,16 +94,16 @@ #define MIN_INTERVAL 100 /* minimum query interval 100 ms */ -#define INIT_STRING "ATE1;^CURC=0;^DSFLOWCLR" /* disable unsolicited report codes and reset DS traffic +#define INIT_STRING "ATE1 ^CURC=0;^DSFLOWCLR" /* disable unsolicited report codes and reset DS traffic * with local echo enabled */ -#define QUALITY "ATE1;+CSQ" /* signal quality query with local echo enabled */ -#define SYSINFO "ATE1;^SYSINFO" /* network access query with local echo enabled */ -#define MANUF "ATE1;+GMI" /* manufacturer query with local echo enabled */ -#define MODEL "ATE1;+GMM" /* model query with local echo enabled */ -#define FWVER "ATE1;+CGMR" /* firmware version query with local echo enabled */ -#define FLOWREPORT "ATE1;^DSFLOWQRY" /* DS traffic query with local echo enabled */ -#define OPERATOR "ATE1;+COPS=3,0;+COPS?" /* gsm/umts operator query (3=set format only, 0=long alphanum. string) +#define QUALITY "ATE1 +CSQ" /* signal quality query with local echo enabled */ +#define SYSINFO "ATE1 ^SYSINFO" /* network access query with local echo enabled */ +#define MANUF "ATE1 +GMI" /* manufacturer query with local echo enabled */ +#define MODEL "ATE1 +GMM" /* model query with local echo enabled */ +#define FWVER "ATE1 +CGMR" /* firmware version query with local echo enabled */ +#define FLOWREPORT "ATE1 ^DSFLOWQRY" /* DS traffic query with local echo enabled */ +#define OPERATOR "ATE1 +COPS=3,0;+COPS?" /* gsm/umts operator query (3=set format only, 0=long alphanum. string) * with local echo enabled */ @@ -738,7 +738,7 @@ static void huawei_read_fwver(const char *cmd) static void huawei_read_operator(const char *cmd) { - int bytes, i, pos, copy; + int bytes, i, pos = 0, copy = 0; char *buf; buf = huawei_send_receive(cmd); @@ -753,9 +753,6 @@ static void huawei_read_operator(const char *cmd) */ /* parse "operator string" */ - pos = 0; - copy = 0; - for (i = 6; i <= bytes; i++) { if (buf[i] == '\"' && copy == 0) { i++; -- cgit v1.2.3