EHS8 GPS location using JSR179 API causes mainthread to hang for about one second | Thales IoT Developer Community
May 18, 2018 - 7:00am, 3853 views
Hi,
i've made an application where i use the JSR179 java api to retrieve GPS coordinates.
It is working as expected but when coordinates are received the meanthread stops working for about one second. I can see this because i'm toggeling a status led on the module each cycle in the mainthread.
Can anyone tell me if observed the same, or if there is a workaround?
while (!bBreak)
{
Location loc = locProvider.getLocation(-1);
if (loc.isValid())
{
_longval = loc.getQualifiedCoordinates().getLongitude();
_latval = loc.getQualifiedCoordinates().getLatitude();
Logger.info(this.getClass(), "Current location is: " + _latval + ", " + _longval);
}
}
Here ist the output of ATI1
Cinterion
EHS8
REVISION 03.001
A-REVISION 00.000.14
Best Regards
Andy
Hello,
Is the location acquired in the separate thread then LED blinking or the same? Have you checked when exactly the thread stops for one second - I mean which method call for example? Is there any other activity implemented in the application?
Generally the Java virtual machine is not the real time system and the general system load may influence the performance so you can't guarantee that for example each sleep() method call will cause the thread to sleep for exactly the same time.
Your firmware is not the latest so you could also want to verify this behavior with the latest one.
Best regards,
Bartłomiej
Hello,
yes it is an extra thread. It seems to happen when leaving the function which gets the coordinates. Because the log messages of:
Logger.info(this.getClass(), "Current location is: " + _latval + ", " + _longval);
comes immediately but afterwards the blinking stops for a while and then continues.
I've tryied to get a newer firmware but unfortunately i had no luck with the login for the extranet site of gemalto, is there another way to get the newest firmware?
Best Regards
Andy
Hello,
it looks like getting the coordinates uses such a significant processor time.
I have sent you the latest firmware on your email. Please test if there is any difference.
Regards,
Bartłomiej
Hi,
i've updatet to version:
REVISION 03.001
A-REVISION 00.000.55
^SJAM: "a:/JRC-1.56.58.jad","Java Remote Control MIDlet Suite","Cinterion","1.56.58",1,758905,0
but unfortunately it's the same.
Best Regards,
Andy
Hi, You wrote:
Does it mean that lag is visible not during location update, but after logging it? On any specific line?
Best regards,
Michał