ADL api limitations: adl_sim

One of OpenAT’s major advantages is the fact that the ADL api’s obsolete the use of AT commands :smiley:. The adl_sim service is an important and fundamental service, but so limiting that its use is limited to very simple applications. Therefore my big dismay each time I see this api in the ADL manual and still need to use the AT+CPIN command. :open_mouth:

I face the following real world problems:

  1. In most applications where sim cards get removed/replaced the sim card need to be authenticated (using a pre stored ccid) before the sim pin can be entered. I tried subscribing to the sim service (supplying NULL for pin) to receive the ADL_SIM_EVENT_PIN_WAIT or ADL_SIM_EVENT_INSERTED event to know when to query for the CCID (using an AT cmd :frowning: ). Once the card is authenticated (so now I know I have a pin associated with the sim card) I unsubscribe and subscribe again to the sim service to “enter” the pin this way. If I need a new pin the user is queried for the new pin via either LCD/KEYPAD prompt or via uart. I retrieve the pin and enter it the same way, using adl_simSubsribe. After this I discovered my sim handler is never called with the FULL_INIT event. :open_mouth: I also had issues with WIP telling me the sim is not initialised (obviously when it was). I assume this is only a bug, and hopefully only on the OpenAT version I tried this.
  2. If the unit boot without any simcard I never receive a no sim event. :open_mouth:. This may sound like a silly complain, but due to the inherent non-blocking nature of the OpenAT OS proper application design is event driven (WITH THE MINIMUM TIMER EVENTS!) that step state engines. Without this event there is no “final” response from the sim service after reboot without a sim to step any state engine.
  3. No separate PHONE to NETWORK lock or SIM to PHONE lock indications. (Talking about the PH-NET and PH-SIM unsoliciteds) If I am lucky I receive PIN_ERROR events. So I am back subscribing to Unsolicited events. :open_mouth:

This could be such a nice service! Go Wavecom…

Actually, I find that one of OpenAT’s major limitations is that it doesn’t provide a full API that obsoletes the use of AT commands - there’s still loads of stuff that requires you to mess about with AT commands! :angry:

Could you subscribe to the +WIND unsolicited responses - they should tell you when a SIM is inserted, removed, and when there’s no SIM present…

Or, could you use adl_simGetState to check the initial condition…?

Yes you are right, and I did implement “work arounds”

In the OpenAT 3.17 adl_User_Guide I’ve found a useful API: adl_simEnterPIN which updates the adl_simSubscribe pinCode parameter. I’ve tested it and found it very useful. Unfortunatelly it’s not implemented in 4.22a version. Does anybody know if it will be supported by next OpenAT v4.xx? I wouldn’t like to waste time on workarounds if it’s going to be available soon.