Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 220 → Rev 221

/branches/ligi_j2me/src/MKWatchDog.java
0,0 → 1,53
/**********************************************************************************************************************************
* Statistics from MK-Connection ( needed for 2. Thread and Readability of Code ) *
* *
* Author: Marcus -LiGi- Bueschleb *
* Project-Start: 9/2007 *
* Version: 0.07 *
* Mailto: ligi@smart4mobile.de *
* Licence: Creative Commons / Non Commercial *
* Big Up: Holger&Ingo *
*********************************************************************************************************************************/
 
public class MKWatchDog
implements Runnable
{
 
MKCommunicator mk=null;
 
int debug_data_count_buff=-123;
 
public MKWatchDog(MKCommunicator _mk)
{
mk=_mk;
new Thread( this ).start(); // fire up main Thread
}
 
public void run()
{
while(true)
{
try { Thread.sleep(1500); }
catch (Exception e) { }
if (mk.connected)
{
if (debug_data_count_buff==mk.debug_data_count)
mk.close_connections(false);
debug_data_count_buff=mk.debug_data_count;
if (mk.version.major==-1)
mk.get_version();
if (mk.lcd_data_count==0)
mk.LCD.trigger_LCD();
}
else
{
}
 
}
}
 
}