org.opengts.servers.tk10x
Class TrackClientPacketHandler

java.lang.Object
  extended by org.opengts.util.AbstractClientPacketHandler
      extended by org.opengts.servers.tk10x.TrackClientPacketHandler
All Implemented Interfaces:
ClientPacketHandler

public class TrackClientPacketHandler
extends AbstractClientPacketHandler


Nested Class Summary
static class TrackClientPacketHandler.TKDeviceType
          Enumerated type: TK device type
 
Field Summary
static boolean DEBUG_MODE
           
static boolean ESTIMATE_ODOMETER
           
static double KILOMETERS_PER_KNOT
           
static double MINIMUM_MOVED_METERS
           
static double MINIMUM_SPEED_KPH
           
static boolean PACKET_LEN_END_OF_STREAM
           
static long SIMEVENT_DIGITAL_INPUTS
           
static boolean SIMEVENT_GEOZONES
           
static long TKNANO_GPIO_ACC
           
static long TKNANO_GPIO_ENGINE
           
static long TKNANO_GPIO_ON_BATTERY
           
static long TKNANO_GPIO_SENSOR_1
           
static long TKNANO_GPIO_SENSOR_2
           
static java.lang.String[] UNIQUEID_PREFIX
           
static boolean USE_LAST_VALID_GPS
           
static boolean XLATE_LOCATON_INMOTION
           
 
Fields inherited from class org.opengts.util.AbstractClientPacketHandler
GMT_Timezone, PACKET_LEN_LINE_TERMINATOR
 
Constructor Summary
TrackClientPacketHandler()
          Packet handler constructor
 
Method Summary
static void configInit()
          Startup configuration initialization
 int getActualPacketLength(byte[] packet, int packetLen)
          Returns the size of the packet in the queue.
 byte[] getHandlePacket(byte[] pktBytes)
          Workhorse of the packet handler.
static void main(java.lang.String[] argv)
          Debug/Testing entry point (Debug purposes only, not used for production)
 void sessionStarted(java.net.InetAddress inetAddr, boolean isTCP, boolean isText)
          Callback when session is starting
 void sessionTerminated(java.lang.Throwable err, long readCount, long writeCount)
          Callback when session is terminating
 
Methods inherited from class org.opengts.util.AbstractClientPacketHandler
clearSavedEventCount, clearTerminateSession, equals, equalsSessionID, forceCloseTCPSession, GetDebugMode, getFinalPacket, getHostAddress, getInetAddress, getInitialPacket, getIPAddress, getLocalPort, getMaximumPacketLength, getMinimumPacketLength, getName, getPromptEnabled, getRemotePort, getResponsePort, getSavedEventCount, getSequenceID, getSessionID, getSessionInfo, getSessionStartTime, getSessionStartTimeMS, getSessionType, getTerminateSession, getThreadName, hasHostAddress, hasIPAddress, hasSavedEvents, idleTimeoutInterrupt, incrementSavedEventCount, IsDebugMode, isDuplex, isInputStream, isTCP, isTextPackets, isUDP, printSessionStart, printSessionTerminated, SetDebugMode, setPromptEnabled, setSavedEventCount, setSessionInfo, setTerminateSession, setTerminateSession, tcpWrite, terminateSession
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_MODE

public static boolean DEBUG_MODE

UNIQUEID_PREFIX

public static java.lang.String[] UNIQUEID_PREFIX

MINIMUM_SPEED_KPH

public static double MINIMUM_SPEED_KPH

ESTIMATE_ODOMETER

public static boolean ESTIMATE_ODOMETER

SIMEVENT_GEOZONES

public static boolean SIMEVENT_GEOZONES

SIMEVENT_DIGITAL_INPUTS

public static long SIMEVENT_DIGITAL_INPUTS

XLATE_LOCATON_INMOTION

public static boolean XLATE_LOCATON_INMOTION

USE_LAST_VALID_GPS

public static boolean USE_LAST_VALID_GPS

MINIMUM_MOVED_METERS

public static double MINIMUM_MOVED_METERS

PACKET_LEN_END_OF_STREAM

public static boolean PACKET_LEN_END_OF_STREAM

KILOMETERS_PER_KNOT

public static final double KILOMETERS_PER_KNOT
See Also:
Constant Field Values

TKNANO_GPIO_ACC

public static long TKNANO_GPIO_ACC

TKNANO_GPIO_ENGINE

public static long TKNANO_GPIO_ENGINE

TKNANO_GPIO_ON_BATTERY

public static long TKNANO_GPIO_ON_BATTERY

TKNANO_GPIO_SENSOR_1

public static long TKNANO_GPIO_SENSOR_1

TKNANO_GPIO_SENSOR_2

public static long TKNANO_GPIO_SENSOR_2
Constructor Detail

TrackClientPacketHandler

public TrackClientPacketHandler()
Packet handler constructor

Method Detail

sessionStarted

public void sessionStarted(java.net.InetAddress inetAddr,
                           boolean isTCP,
                           boolean isText)
Callback when session is starting

Specified by:
sessionStarted in interface ClientPacketHandler
Overrides:
sessionStarted in class AbstractClientPacketHandler
Parameters:
inetAddr - The host IP address
isTCP - True if the connection is TCP
isText - True if the connection is text

sessionTerminated

public void sessionTerminated(java.lang.Throwable err,
                              long readCount,
                              long writeCount)
Callback when session is terminating

Specified by:
sessionTerminated in interface ClientPacketHandler
Overrides:
sessionTerminated in class AbstractClientPacketHandler

getActualPacketLength

public int getActualPacketLength(byte[] packet,
                                 int packetLen)
Returns the size of the packet in the queue.

Specified by:
getActualPacketLength in interface ClientPacketHandler
Overrides:
getActualPacketLength in class AbstractClientPacketHandler

getHandlePacket

public byte[] getHandlePacket(byte[] pktBytes)
Workhorse of the packet handler. Parse/insert event data.

Specified by:
getHandlePacket in interface ClientPacketHandler
Specified by:
getHandlePacket in class AbstractClientPacketHandler
Parameters:
pktBytes - The packet
Returns:
The response

configInit

public static void configInit()
Startup configuration initialization


main

public static void main(java.lang.String[] argv)
Debug/Testing entry point (Debug purposes only, not used for production)