gps.mvc
Class MtkController

java.lang.Object
  extended by gps.mvc.MtkController
Direct Known Subclasses:
HoluxController, SkytraqController, WPController

public class MtkController
extends java.lang.Object

Controller for MTK based device (Transystem Type logger currently included). Refactoring ongoing.

Author:
Mario De Weerd

Field Summary
static int CMD_AUTOLOG_OFF
           
static int CMD_AUTOLOG_ON
           
static int CMD_CANCEL_GETLOG
          Cancel downloading the log.
static int CMD_COLDSTART
          To perform a cold start on the device.
static int CMD_EPO_CLEAR
          Clear the EPO data.
static int CMD_ERASE_LOG
          Erase the log.
static int CMD_FACTORYRESET
          To perform a full cold start on the device.
static int CMD_HOTSTART
          To perform a hot start on the device.
static int CMD_SET_DEVICE_NAME
          Takes String value for the device name.
static int CMD_SET_GPS_FIX_INTERVAL
          Set the GPS fix interval (1Hz fix/5Hz fix/...).
static int CMD_SET_LOG_DISTANCE_INTERVAL
          Takes int value in 1 meters.
static int CMD_SET_LOG_OVERWRITE
          Sets overwrite or stop mode for the log.
static int CMD_SET_LOG_SPEED_INTERVAL
          Takes int value in 0.1 km/h.
static int CMD_SET_LOG_TIME_INTERVAL
          Takes int value in 0.1 seconds.
static int CMD_SET_POWERSAVE_ENABLED
          Enables internal power saving mode.
static int CMD_SET_SBAS_ENABLED
          Enables the use of the SBAS sats.
static int CMD_SET_SBAS_TEST_ENABLED
          Enables the use of the test SBAS sats.
static int CMD_STARTLOG
          Start logging on the device.
static int CMD_STOP_WAITING_FOR_ERASE
          Stop waiting for the erase to finish.
static int CMD_STOPLOG
          Stop logging on the device.
static int CMD_WARMSTART
          To perform a warm start on the device.
 
Method Summary
 boolean cmd(int cmd)
          Perform a command.
 boolean cmd(int cmd, CmdParam param)
          Perform a command.
 void getLog(BT747Path log)
           
 void getLogInit(int startAddr, int endAddr, int requestStep, BT747Path fileName, boolean isSmart, boolean disableLogging)
           
 MtkModel getMtkModel()
           
 boolean isSupportedCmd(int cmd)
          Check if a command is supported.
 void logImmediate(int value)
           
 void notifyDisconnected()
          The environment indicates a disconnect happened.
 void notifyRun()
          Called regularly so that the controller can notify the log download handler for instance.
 void recoveryEraseLog()
          A 'recovery Erase' attempts to recover memory that was previously identified as 'bad'.
 void replyToOkToOverwrite(boolean isOkToOverwrite)
          The GpsModel is waiting for a reply to the question if the currently existing log with different data can be overwritten.
 boolean reqData(int dataType)
          Request specific data from the device.
 void sendMtkBin(MtkBinTransportMessageModel msg)
           
 void setAgpsData(byte[] agpsData)
           
 void setBinMode()
          Sets the device to binary mode.
 void setBtMacAddr(java.lang.String btMacAddr)
          Sets the current mac address for bluetooth (Holux 241 devices).
 void setDatumMode(int mode)
           
 void setDGPSMode(int mode)
           
 void setFlashUserOption(boolean lock, int updateRate, int baudRate, int GLL_Period, int RMC_Period, int VTG_Period, int GSA_Period, int GSV_Period, int GGA_Period, int ZDA_Period, int MCHN_Period)
           
 void setLogFormat(int newLogFormat)
          Set the logging format of the device.
 void setLogRequestAhead(int logRequestAhead)
           
 void setNMEADefaultPeriods()
           
 void setNmeaMode()
          Set the device to Nmea mode.
 void setNMEAPeriods(int[] periods)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_HOTSTART

public static final int CMD_HOTSTART
To perform a hot start on the device.

See Also:
Constant Field Values

CMD_WARMSTART

public static final int CMD_WARMSTART
To perform a warm start on the device.

See Also:
Constant Field Values

CMD_COLDSTART

public static final int CMD_COLDSTART
To perform a cold start on the device.

See Also:
Constant Field Values

CMD_FACTORYRESET

public static final int CMD_FACTORYRESET
To perform a full cold start on the device.

See Also:
Constant Field Values

CMD_STARTLOG

public static final int CMD_STARTLOG
Start logging on the device.

See Also:
Constant Field Values

CMD_STOPLOG

public static final int CMD_STOPLOG
Stop logging on the device.

See Also:
Constant Field Values

CMD_AUTOLOG_OFF

public static final int CMD_AUTOLOG_OFF
See Also:
Constant Field Values

CMD_AUTOLOG_ON

public static final int CMD_AUTOLOG_ON
See Also:
Constant Field Values

CMD_SET_LOG_TIME_INTERVAL

public static final int CMD_SET_LOG_TIME_INTERVAL
Takes int value in 0.1 seconds.

See Also:
Constant Field Values

CMD_SET_LOG_DISTANCE_INTERVAL

public static final int CMD_SET_LOG_DISTANCE_INTERVAL
Takes int value in 1 meters.

See Also:
Constant Field Values

CMD_SET_LOG_SPEED_INTERVAL

public static final int CMD_SET_LOG_SPEED_INTERVAL
Takes int value in 0.1 km/h.

See Also:
Constant Field Values

CMD_SET_DEVICE_NAME

public static final int CMD_SET_DEVICE_NAME
Takes String value for the device name.

See Also:
Constant Field Values

CMD_STOP_WAITING_FOR_ERASE

public static final int CMD_STOP_WAITING_FOR_ERASE
Stop waiting for the erase to finish.

See Also:
Constant Field Values

CMD_ERASE_LOG

public static final int CMD_ERASE_LOG
Erase the log.

See Also:
Constant Field Values

CMD_SET_GPS_FIX_INTERVAL

public static final int CMD_SET_GPS_FIX_INTERVAL
Set the GPS fix interval (1Hz fix/5Hz fix/...). Requires integer argument expressed in ms.

See Also:
Constant Field Values

CMD_SET_LOG_OVERWRITE

public static final int CMD_SET_LOG_OVERWRITE
Sets overwrite or stop mode for the log. Requires boolean argument indicating overwrite.

See Also:
Constant Field Values

CMD_SET_SBAS_TEST_ENABLED

public static final int CMD_SET_SBAS_TEST_ENABLED
Enables the use of the test SBAS sats. Requires boolean argument indicating enable.

See Also:
Constant Field Values

CMD_SET_SBAS_ENABLED

public static final int CMD_SET_SBAS_ENABLED
Enables the use of the SBAS sats. Requires boolean argument indicating enable.

See Also:
Constant Field Values

CMD_SET_POWERSAVE_ENABLED

public static final int CMD_SET_POWERSAVE_ENABLED
Enables internal power saving mode. Requires boolean argument indicating enable.

See Also:
Constant Field Values

CMD_CANCEL_GETLOG

public static final int CMD_CANCEL_GETLOG
Cancel downloading the log.

See Also:
Constant Field Values

CMD_EPO_CLEAR

public static final int CMD_EPO_CLEAR
Clear the EPO data.

See Also:
Constant Field Values
Method Detail

getMtkModel

public final MtkModel getMtkModel()

sendMtkBin

public final void sendMtkBin(MtkBinTransportMessageModel msg)

setBinMode

public final void setBinMode()
Sets the device to binary mode.


setNmeaMode

public final void setNmeaMode()
Set the device to Nmea mode.


setLogFormat

public final void setLogFormat(int newLogFormat)
Set the logging format of the device.
Best followed by eraseLog.

Parameters:
newLogFormat - The format to set.

cmd

public boolean cmd(int cmd)
Perform a command.

Parameters:
cmd - Command identification.
Returns:
true is command is supported.

reqData

public boolean reqData(int dataType)
Request specific data from the device.

Returns:
true if supported.

setAgpsData

public void setAgpsData(byte[] agpsData)

isSupportedCmd

public boolean isSupportedCmd(int cmd)
Check if a command is supported.

Parameters:
cmd - Command identification.
Returns:
true is command is supported.

cmd

public boolean cmd(int cmd,
                   CmdParam param)
Perform a command.

Parameters:
cmd - Command identification.
Returns:
true is command is supported.

setDGPSMode

public final void setDGPSMode(int mode)

setDatumMode

public final void setDatumMode(int mode)

setBtMacAddr

public final void setBtMacAddr(java.lang.String btMacAddr)
Sets the current mac address for bluetooth (Holux 241 devices).

Parameters:
btMacAddr - The Mac address to set in the following format:
00:1F:14:15:12:13.

setNMEAPeriods

public final void setNMEAPeriods(int[] periods)

setNMEADefaultPeriods

public final void setNMEADefaultPeriods()

setFlashUserOption

public final void setFlashUserOption(boolean lock,
                                     int updateRate,
                                     int baudRate,
                                     int GLL_Period,
                                     int RMC_Period,
                                     int VTG_Period,
                                     int GSA_Period,
                                     int GSV_Period,
                                     int GGA_Period,
                                     int ZDA_Period,
                                     int MCHN_Period)

logImmediate

public final void logImmediate(int value)

setLogRequestAhead

public final void setLogRequestAhead(int logRequestAhead)

recoveryEraseLog

public final void recoveryEraseLog()
A 'recovery Erase' attempts to recover memory that was previously identified as 'bad'.


replyToOkToOverwrite

public final void replyToOkToOverwrite(boolean isOkToOverwrite)
                                throws BT747Exception
The GpsModel is waiting for a reply to the question if the currently existing log with different data can be overwritten. This method must be called to replay to this question which is in principle the result of a user reply to a message box.

Parameters:
isOkToOverwrite - If true, the existing log can be overwritten
Throws:
BT747Exception

getLogInit

public final void getLogInit(int startAddr,
                             int endAddr,
                             int requestStep,
                             BT747Path fileName,
                             boolean isSmart,
                             boolean disableLogging)

notifyRun

public void notifyRun()
               throws BT747Exception
Called regularly so that the controller can notify the log download handler for instance.

Throws:
BT747Exception

notifyDisconnected

public void notifyDisconnected()
The environment indicates a disconnect happened.


getLog

public void getLog(BT747Path log)