[PATCH] +CPIN: READY response parsed as time out

"Oded Arbel" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
> -----Original Message-----
> From: kannel [mailto:[email protected]]
> Subject: Daily patch: gateway
> 
> +2002-02-25  Bruno Rodrigues  <[email protected]>
> +    * gw/smsc_at2.c: Changed a possible bug. On timeout, 
> at2_wait_modem_command
> +      returned -10, and every other line shows that it should be -1;

after that patch, kannel stopped working for me (with wavecom modem).
apparently after it recieved the +CPIN:READY response it concluded that
the device cannot be opened and shut the module down. 

tracking it down :
this code in init_device()
        ret = at2_send_modem_command(privdata, "AT+CPIN?", 0, 0);
        if(ret == -1)
	    return -1;
breaks out if timeout occured after the CPIN command.
this code in wait_modem_command :
           if (-1 != octstr_search(line, octstr_imm("+CPIN: READY"), 0))
           {
           	privdata->pin_ready = 1;
		continue;
	   }
will cause Kannel to return with a time out for a +CPIN: READY response
(no OK sent after that), and return -10 before the patch, which is ok
with init_device. after the patch it will return -1 and so it will break
init_device.

attacehd it a patch that fixed the problem for me (I am going to attach
it, this time :-)

Cheers

Oded Arbel
m-Wise Inc.
[email protected]

--
A committee takes root and grows, it flowers, wilts and dies, scattering
the seed from which other committees will bloom. 
	-- Parkinson
smsc_at2.patch (application/octet-stream, 353 B)
--- gw/smsc_at2.c	Tue Feb 26 10:32:28 2002
+++ gw/smsc_at2.c	Tue Feb 26 13:25:07 2002
@@ -700,7 +766,8 @@
            if (-1 != octstr_search(line, octstr_imm("+CPIN: READY"), 0))
            {
            	privdata->pin_ready = 1;
-		continue;
+           	ret = 4;
+		goto end;
 	   }
 
 	   if (-1 != octstr_search(line, octstr_imm("+CMS ERROR"),0))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.