URCs are not recived using ATCommand.addListener | Thales IoT Developer Community
November 19, 2014 - 3:57pm, 5396 views
Cinterion Concept Board
EHS6
REVISION 02.000
---
After enabling URCs for rssi events with the following code the attached event listener is not called.
m_Cmd = new ATCommand(false);
m_Cmd.addListener(m_Listener);
...
String response = m_Cmd.send("at^sind=\"rssi\",1\r");
// The response is correct, an OK is given
The main thread is either sleeping or issuing other commands (tried removing all commands except the above one).
Using a terminal directly connected to a COM port seems to work correctly. I can send the same command and URCs are correctly shown in the terminal.
Hello Oblasco,
This should be working. You should get the URC's in the ATEvent() method of your ATCommandListener interface implementation. I assume you have implemented some logging inside.
Are you sure that you get these URC's on the terminal at the same time as you run the MIDlet which is not getting them?
Don't you release the ATCommand instance to which you have added your listener?
Maybe activating some more URC's would be worth trying just to prove that your code can get any URC.
Best regards,
Bartłomiej
Hi thanks for the reply.
Unfortunatelly I haven't found a way to make it work, and in fact it should be quite easy. I'm wondering if there is a system configuration or some java vm restriction.
The ATCommand is not relaesed and I have tried other URCs with no luck.
I can upload the code in case you are willing to check it.
Thanks.
Hi,
Please do that. Maybe there's something we have missed.
Regards,
Bartłomiej
I tried to find you on gemalto internal network but had no luck, how can I send you the complete project (zip file)?
Thanks in advance!
I've just sent you my contact.
For future reference, the userware/autostart config was not active thus the JRC midlet which is required to recive the URCs was not active.
I opnened a terminal and wrote:
at^scfg="Userware/Autostart","","1"
Then added the following property to my module in order to be able to autostart it:
Oracle-MIDlet-Autostart: 2
Thanks for you help Bartłomiej.
You're welcome Oscar.
Just to sum up this thread:
By default the global autostart setting is enabled.
When disabled, none of the installed MIDlet's including the Cinterion JRC MIDlet (which is installed by default on each EHS5/6 module) will start automatically when module reboots.
So everybody who wishes to disable the autostart- please be aware that some of the module's functionalities may not work as expected.
If autostart is enabled, then still no customer MIDlet will be started automatically until the parameter mentioned by Oscar is added to the MIDlet's jad file.
One thing I'd like to add to this is that when you are running your code in the IDE and autostart is enabled in ^SCFG the IDE installed version will autostart at the next module power up and then be stopped by your next run of the JAD/JAR in the IDE which can sometimes cause you difficulties because you only want the the JAD/JAR to start when you want it to not the other way around.
So the easiest way to fix this is to set Oracle-MIDlet-Autostart to a value of 0 in 'User Defined' and this will result in the IDE loaded JAD/JAR not starting at power up but it will still run as required when you start the JAD/JAR from the IDE.
Autostart still works and the JRC starts as required and then URCs work correctly and you have control of when your JAD/JAR starts.
Just remember to set Oracle-MIDlet-Autostart to a value of at least 2 in 'User Defined' before you release your code :-)