Hi,
while trying to setup at2, I had to fix 2 more bugs. The first one is that 
at2_init_device uses octstr_case_compare as comparison function in 
list_search, which behaves like strcmp in that it return 0 if the strings 
match, which is exactly the opposite of what list_search expects. So it 
just returns the first thing it finds that doesn't match.

I also had to change the init string for ericssons, since the default 
+CNMI=3,2,0,0 didn't work neither for R320m nor for R520m.
It looks like they both don't support setting <mt> to 2.
Diff attached.
Index: 
smsc_at2.c===================================================================RCS file: 
/home/cvs/gateway/gw/smsc_at2.c,vretrieving revision 1.15diff -B -u -r1.15 
smsc_at2.c--- smsc_at2.c       2001/12/07 10:51:54     1.15+++ smsc_at2.c      
2001/12/07 12:23:56@@ -72,7 +72,7 @@     { "siemens",   "AT\\Q3"        , 19200 , 
"AT+CNMI=1,2,0,0,0",  "SIEMENS",      "M20",  0, 1, 1, 1, 1   },     { "nokiaphone",  
"AT+IFC=2,2"    , 9600  , "AT+CNMI=1,2,0,0,0",  "NokiaPhone" ,  NULL,   0, 1, 1, 1, 1  
 },     { "falcom",              "AT+IFC=2,2"    , 9600  , "AT+CNMI=1,2,0,0,0",  
"Falcom",       NULL,   0, 0, 1, 0, 0   },-    { "ericsson",    "AT+IFC=2,2"    , 9600 
 , "AT+CNMI=3,2,0,0",    "R520m",        NULL,   0, 0, 1, 1, 1   }+    { "ericsson",   
  "AT+IFC=2,2"    , 9600  , "AT+CNMI=3,3,0,0",    "R520m",        NULL,   0, 0, 1, 1, 
1   } };  /* maximum data to attempt to read in one go */@@ -489,6 +489,13 @@ }  +/* 
like octstr_case_compare, but return 1 when the strings match, 0 otherwise+ * Used 
later in list_search */+int at2_octstr_case_compare(Octstr *os1, Octstr *os2)+{+    
return !(octstr_case_compare(os1, os2));+}+ 
/****************************************************************************** ** 
at2_init_device ** initializes the device after being opened@@ -591,7 +597,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 *) at2_octstr_case_compare);       if(ts)      
privdata->phase2plus = 1;   list_destroy(vals,(void *) at2_octstr_destroy);

Reply via email to