RE: [RFI+Patch] AT2 Modems.conf
"Oded Arbel" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
This indeed works for me too - and is much nicer then what I have been working on :-) it does though make wavecom init (when PIN number must be entered) very slow. While playing with the wavecom, I noticed that (at least) the modems I'm using are very peculiar about PIN entering : after entering the PIN number, and receiving OK, any command immidietly entered will behave as if the PIN hasn't been entered (that is - return an error unless it's AT or ATZ). only after a short delay (10 seconds usually works, but not always) it will accept commands. did anyone else encounter this behaviour ? -- Oded Arbel m-Wise Inc. [email protected] In answer to the question of why it happened, I offer the modest proposal that our Universe is simply one of those things which happen from time to time. -- Edward P. Tryon > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Wednesday, March 13, 2002 1:15 PM > To: '[email protected] ' > Subject: RE: [RFI+Patch] AT2 Modems.conf > > > I just commited the following patch: > > diff -u -r1.31 smsc_at2.c > --- gw/smsc_at2.c 13 Mar 2002 00:28:31 -0000 1.31 > +++ gw/smsc_at2.c 13 Mar 2002 11:09:59 -0000 > @@ -544,26 +544,34 @@ > if(ModemTypes[privdata->modemid].pin_support) > { > ret = at2_send_modem_command(privdata, "AT+CPIN?", 10, 0); > - if(ret == -1) > - return -1; > - if(ret == 2) > - { > - if(privdata->pin == NULL) > - return -1; > - setpin = octstr_format("AT+CPIN=%s", > octstr_get_cstr(privdata->pin)); > - ret = at2_send_modem_command(privdata, > octstr_get_cstr(setpin), > 0, 0); > - octstr_destroy(setpin); > - if(ret !=0 ) > - return -1; > - } > + > + if (!privdata->pin_ready) > + { > + if(ret == 2) > + { > + if(privdata->pin == NULL) > + return -1; > + setpin = octstr_format("AT+CPIN=%s", > octstr_get_cstr(privdata->pin)); > + ret = at2_send_modem_command(privdata, > octstr_get_cstr(setpin), 0, 0); > + octstr_destroy(setpin); > + if(ret !=0 ) > + return -1; > + } else if(ret == -1) > + return -1; > + } > + > > /* we have to wait until +CPIN: READY appears before issuing > the next command. 10 sec should be suficient */ > if(!privdata->pin_ready) > { > - ret = at2_wait_modem_command(privdata,10, 0); > - if(ret == -1) /* timeout */ > - return -1; > + at2_wait_modem_command(privdata,10, 0); > + if(!privdata->pin_ready) { > + at2_send_modem_command(privdata, "AT+CPIN?", 10, 0); > + if(!privdata->pin_ready) { > + return -1; /* give up */ > + } > + } > } > } > // Set the GSM SMS message center address if supplied > > With this patch applied Wavecom works again for me. Please > give it a try. > > Regards > Jörg > > -----Original Message----- > From: Oded Arbel > To: Andreas Fink; Abd Rahman Johari > Cc: [email protected] > Sent: 3/13/02 10:12 AM > Subject: RE: [RFI+Patch] AT2 Modems.conf > > > -----Original Message----- > > From: Andreas Fink [mailto:[email protected]] > > Sent: Wednesday, March 13, 2002 10:12 AM > > To: Abd Rahman Johari > > Cc: [email protected] > > Subject: Re: [RFI+Patch] AT2 Modems.conf > > > > > > > I think what we see here is > > > > --> AT+CPIN? > > <--- +CPIN: SIM PIN > > <--- OK > > > > --> AT+CPIN=1234 > > <--- waiting for +CPIN READY not appearing. > > > > Oded what's your view of this? > > No, I don't think so - a proper wavecom session will looks like this > (given propert timeout everywhere) : > > --> AT+CPIN? > <-- +CPIN: SIM PIN > > --> AT+CPIN="1234" > <-- OK > > --> AT+CPIN? > <-- +CPIN: READY > > notice that wavecom does not send OK after +CPIN replys. > > -- > Oded Arbel > m-Wise Inc. > [email protected] > > What on earth would a man do with himself if something did > not stand in > his way? > -- H.G. Wells > > >