# ADL api limitations: adl\_sim

**URL:** <https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806>\
**Category:** Open AT\
**Created:** [January 6, 2008, 4:03pm UTC](https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806 "2008-01-06T16:03:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![truhann.vanderpoel](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@truhann.vanderpoel](https://forum.sierrawireless.com/u/truhann.vanderpoel)\
**Post date:** [January 6, 2008, 4:03pm UTC](https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806/1 "2008-01-06T16:03:38Z")

</div>

One of OpenAT’s major advantages is the fact that the ADL api’s obsolete the use of AT commands 😃. 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. 😮

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 ☹ ). 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. 😮 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. 😮. 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. 😮

This could be such a nice service! Go Wavecom…

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 7, 2008, 7:30am UTC](https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806/2 "2008-01-07T07:30:46Z")

</div>

> [@truhann](#):
>
> One of OpenAT’s major advantages is the fact that the ADL api’s obsolete the use of AT commands 😃.

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! 😠

> [@](#):
>
> 1. If the unit boot without any simcard I never receive a no sim event. 😮.

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…?

---

<div class="post-metadata">

**Author:** ![truhann.vanderpoel](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@truhann.vanderpoel](https://forum.sierrawireless.com/u/truhann.vanderpoel)\
**Post date:** [January 7, 2008, 3:50pm UTC](https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806/3 "2008-01-07T15:50:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jacfry](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jacfry](https://forum.sierrawireless.com/u/jacfry)\
**Post date:** [January 23, 2008, 6:37am UTC](https://forum.sierrawireless.com/t/adl-api-limitations-adl-sim/1806/4 "2008-01-23T06:37:37Z")

</div>

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.
