> -----Original Message----- > From: Andreas Fink [mailto:[EMAIL PROTECTED]] > > >as > >the modem does not send an OK, wait_modem_command() will return a > >timeout, which init_device() will parse as an error and > therby fail the > >initialization. > > Why did it always work before then?
because a timeout returned a -10, which init_device didnot parse as an error. > >I assert that both solutions are wrong and we need to come up with a > >third one. how about calling wait_modem_command() once after > recieving > >+CPIN:READY if the modem is of a type that sends an OK after that > >message ? (or just call it anyway and discard the return > value ? at most > >it will slow some modems' initialization by the call timeout). > > no, the best way is to wait for +CPIN: READY and then wait for OK or > timeout in 1-2 seconds and dont deal this missing ok as a error. ok, so wait_modem_commands end with a timeout, you'll check the pin_ready flag and return 0 if it's set ? then you'll have to make sure either to reset the pin_ready flag to 0 at the start of the function, or make sure that who ever reads pin_ready will reset it after use. doesn't sound too bad, I can live with it :-) -- Oded Arbel m-Wise Inc. [EMAIL PROTECTED] If you don't go to other men's funerals they won't go to yours. -- Clarence Day