AT cmd from real response handler - fail. SIM events stop


#1

Hi

My scenario:
I am filtering WIND responses to determine SIM state since the SIM events in ADL do not work after you enter the PIN when you receive a SIM_INSERTED event. For some reason the events do not continue to occur (if you swap the SIM for instance or full init is reached). So I check for “+WIND: 1” and then try to call “AT+CPIN?” to check if a PIN is needed. This command is never executed.
The WIND handler is, of course, a subscribed handler to unsolicited response “+WIND”.

Past solution:
I have had this problem before and “solved” it by starting a 18ms timer, exiting the response handler, and in the timer I do adl_atCmdCreate()… This means there are several one-line timer functions all over the place.

Question:
Is there a proper way to ensure that you call an AT command, or at least get the benefit of its function? I have come to realise that too much functionality is only available via AT commands and this forces you to have some function bouncing just to get, for instance, the module’s serial number.

Regards
Francois


#2

Absolutely!
See: viewtopic.php?t=1171&hilit=mess+about

Also: viewtopic.php?f=11&t=2031&p=7587&hilit=MESSING+ABOUT#p7587


#3

Sorry, I have just noticed that for the current project I was not filtering any commands. Maybe I’ll go look at previous code later on to see why that was different…might be because the new code is all on Q2686-663b, but nevertheless, it DOES work when you do adl_atCmdCreate from within the WIND handler, which is again what the manual said should happen in one place. In another place the manual states that the command is not executed, but mostly in other places it seems the command is stacked for later execution.

As for your reference to a bigger API, the last post was over a year ago, so I suppose it’ll be another 3 years before we see that happening? :slight_smile:

As for RTC, I’ve spent some time on making some general date-time C code which I now use on my 16bit MCUs and also on wavecom. The only new command is to convert unixtime seconds to an at+cclk command. Note that this does not get around the milliseconds issue, but at least my date-time code looks and works the same every where.