I minor error found in gw/smsc_at2.c
"Nektarios K. Papadopoulos" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
I am using smsc_at with a NOKIA Premicell. Thoughth to give a try on smsc_at2. What I was getting was something like: 2002-02-20 01:20:24 [6] DEBUG: AT2[/dev/ttyS1]: <-- +CSMS: (0) 2002-02-20 01:20:24 [6] DEBUG: AT2[/dev/ttyS1]: <-- OK 2002-02-20 01:20:24 [6] INFO: AT2[/dev/ttyS1]: Phase 2+ is supported 2002-02-20 01:20:24 [6] DEBUG: AT2[/dev/ttyS1]: --> AT+CSMS=1^M 2002-02-20 01:20:24 [6] DEBUG: AT2[/dev/ttyS1]: <-- ERROR I looke my AT command reference and the code and think that I should not get Phase 2+ is supported I think that passing octstr_case_compare to list_search, makes it to search for at least one non matching list element, insteat for one matching. So I suggest changing it to octstr_item_match, since we care only for digits. the diff with todays cvs is attached, in case I am not wrong. By the way with the proposed changes my Premicell works fine.
smsc_at2.c.diff
(application/octet-stream, 913 B)
Index: gw/smsc_at2.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc_at2.c,v
retrieving revision 1.21
diff -u -r1.21 smsc_at2.c
--- gw/smsc_at2.c 2002/02/08 17:30:18 1.21
+++ gw/smsc_at2.c 2002/02/19 18:33:38
@@ -592,7 +592,7 @@
}
vals = octstr_split(ts, octstr_imm(","));
octstr_destroy(ts);
- ts = list_search(vals, octstr_imm("1"),(void *) octstr_case_compare);
+ ts = list_search(vals, octstr_imm("1"),(void *) octstr_item_match);
if(ts)
privdata->phase2plus = 1;
list_destroy(vals,(void *) at2_octstr_destroy);
@@ -1802,7 +1802,7 @@
}
vals = octstr_split(ts, octstr_imm(","));
octstr_destroy(ts);
- ts = list_search(vals, octstr_imm("1"),(void *) octstr_case_compare);
+ ts = list_search(vals, octstr_imm("1"),(void *) octstr_item_match);
if(ts)
privdata->phase2plus = 1;
list_destroy(vals,(void *) at2_octstr_destroy);