AT Command API for EHSx | Thales IoT Developer Community
March 16, 2015 - 4:00pm, 3609 views
Hi,
I'm currently porting a small Java aplication from a TC65i to a EHS5-E ****.
after modifying a few imports it appears to work, but I'm facing an exception when creating the ATCommand object.
According to the documentation:
5.8.4 AT Command API
Before using a new AT Command instance it should be reset (AT&F). Because of the employed
multi-MIDlet architecture another MIDlet may have used this instance before, but with a differ
ent setup, e.g. echo.
However, when I restart the aplication I'm always getting an IllegalStateException:
java.lang.IllegalStateException: openATCommand: no channel available.
I tried to run "at&f" command as suggested but i keep getting the error until I power off the ****m and restart it from scratch.
Can anybody give me a clue why I'm having this issue?
Thanks in advance.
Edit:
Hi, I got it to work by sending
resp = at.send("AT&F");
at.release();
in the destroyapp() function.
I think at.release() is what did the trick.
Hello,
"no channel available" can be thrown when there is no more AT commands channel available because the number of possible channels is limited.
This may happen when the application or multiple applications create many ATCommand instances without releasing them.
In this case you probably have started one application many ***** without restarting the module or releasing the instance.
Therefore it is a good way to keep the number of instances limited, keep them open until not needed any more and release in destroyApp().
Best regards,
Bartłomiej