Gemalto is now part of the Thales Group, find out more.

You are here

Abnormal exit from middlet | Thales IoT Developer Community

February 13, 2018 - 2:00pm, 2800 views

Hi!

I am using an EHS6 module. ATI response command:

Cinterion

EHS6

REVISION 03.001

My middlet checks if there is a SIM card in the slot. If SIM card is not found, the middlet should stop without restarting the module, so the user can access the file system or enter AT commands via serial port.

However, after exiting from the midlet using "notifyDestroyed()", the middlet exits, but the serial port is blocked (as if the middlet was still running), until the watchdog restarts the module . The code:

String response = ata.send("AT+CCID" + "\r"); // getting card id

messWrite(response);

if (response.indexOf("ERROR") > 0) // checking response

{

messWrite("No SIM card present! Exiting application");

runthreads=false;

exitMIDlet();

}

else

{

.. rest of the program

}

public void exitMIDlet() {

messWrite("From exitMIDlet! Exiting application!");

notifyDestroyed();

}

Also, when I try to use a brute-force solution with:

System.exit(0);

I get an exception: java.lang.SecurityException: 118

Thank you in advance for your help.

Endre