kaos.robots.playerJavaClient
Class PlayerClient

java.lang.Object
  extended by java.lang.Thread
      extended by kaos.robots.playerJavaClient.PlayerClient
All Implemented Interfaces:
java.lang.Runnable

public class PlayerClient
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.io.BufferedOutputStream buffer
           
protected  int[] deviceCnt
           
protected  PlayerDevice[][] deviceList
           
 java.io.DataInputStream is
          The input stream for the socket connected to the player server
protected static int MAX_DEVICES
           
protected static int N_DEVICES
           
 java.io.DataOutputStream os
          The input stream for the socket connected to the player server It's buffered, so remember to flush()!!
static byte PLAYER_DATAMODE_PULL_ALL
           
static byte PLAYER_DATAMODE_PULL_NEW
           
static byte PLAYER_DATAMODE_PUSH_ALL
           
static byte PLAYER_DATAMODE_PUSH_NEW
           
static short PLAYER_PLAYER_AUTH_REQ
           
static short PLAYER_PLAYER_DATA_REQ
           
static short PLAYER_PLAYER_DATAFREQ_REQ
           
static short PLAYER_PLAYER_DATAMODE_REQ
           
static short PLAYER_PLAYER_DEV_REQ
           
static short PLAYER_PLAYER_DEVLIST_REQ
           
static short PLAYER_PLAYER_DRIVERINFO_REQ
           
 boolean receivedAuthentication
           
protected  java.net.Socket socket
           
protected  int subscribedSensors
           
 boolean succReadF
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PlayerClient(java.lang.String serverName, int portNumber)
          Make a new player client connection for the url "servername" and port "portNumber".
 
Method Summary
 int getI()
           
 kaos.robots.playerJavaClient.PlayerDeviceDriverInfo getPDDI()
           
 kaos.robots.playerJavaClient.PlayerDeviceDevlistT getPDDT()
           
 void handleResponce(int size)
           
 void incI(int increment)
           
 boolean isAuthenticated()
           
 boolean isReadyPDDI()
           
 boolean isReadyPDDT()
           
 void readAll()
           
 void requestAuthentication(byte[] key)
           
 BlobfinderInterface requestBlobfinder(int index, char r)
           
 void requestData()
           
 void requestDataDeliveryFrequency(short frequency)
           
 void requestDataDeliveryMode(byte mode)
           
 void requestDeviceList()
          Add new device code here
 void requestDriverName(short device)
           
 FiducialInterface requestFiducial(int index, char r)
           
 LaserPlayerDevice requestLaser(int index, char r)
           
 PositionPlayerDevice requestPosition(int index, char r)
          Request 'r' acces for device If successful it returns the device.
 PtzPlayerDevice requestPtz(int index, char r)
           
 SonarPlayerDevice requestSonar(int index, char r)
           
 TruthPlayerDevice requestTruth(int index, char r)
           
 void run()
           
 void runThreaded(long millis, int nanos)
           
 void setNotThreaded()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAYER_DATAMODE_PUSH_ALL

public static final byte PLAYER_DATAMODE_PUSH_ALL
See Also:
Constant Field Values

PLAYER_DATAMODE_PULL_ALL

public static final byte PLAYER_DATAMODE_PULL_ALL
See Also:
Constant Field Values

PLAYER_DATAMODE_PUSH_NEW

public static final byte PLAYER_DATAMODE_PUSH_NEW
See Also:
Constant Field Values

PLAYER_DATAMODE_PULL_NEW

public static final byte PLAYER_DATAMODE_PULL_NEW
See Also:
Constant Field Values

PLAYER_PLAYER_DEVLIST_REQ

public static final short PLAYER_PLAYER_DEVLIST_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_DRIVERINFO_REQ

public static final short PLAYER_PLAYER_DRIVERINFO_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_DEV_REQ

public static final short PLAYER_PLAYER_DEV_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_DATA_REQ

public static final short PLAYER_PLAYER_DATA_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_DATAMODE_REQ

public static final short PLAYER_PLAYER_DATAMODE_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_DATAFREQ_REQ

public static final short PLAYER_PLAYER_DATAFREQ_REQ
See Also:
Constant Field Values

PLAYER_PLAYER_AUTH_REQ

public static final short PLAYER_PLAYER_AUTH_REQ
See Also:
Constant Field Values

receivedAuthentication

public boolean receivedAuthentication

socket

protected java.net.Socket socket

is

public java.io.DataInputStream is
The input stream for the socket connected to the player server


buffer

protected java.io.BufferedOutputStream buffer

os

public java.io.DataOutputStream os
The input stream for the socket connected to the player server It's buffered, so remember to flush()!!


N_DEVICES

protected static int N_DEVICES

MAX_DEVICES

protected static int MAX_DEVICES

subscribedSensors

protected int subscribedSensors

deviceCnt

protected int[] deviceCnt

deviceList

protected PlayerDevice[][] deviceList

succReadF

public boolean succReadF
Constructor Detail

PlayerClient

public PlayerClient(java.lang.String serverName,
                    int portNumber)
Make a new player client connection for the url "servername" and port "portNumber".

Method Detail

setNotThreaded

public void setNotThreaded()

runThreaded

public void runThreaded(long millis,
                        int nanos)

getI

public int getI()

incI

public void incI(int increment)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

requestPosition

public PositionPlayerDevice requestPosition(int index,
                                            char r)
Request 'r' acces for device If successful it returns the device. Otherwise it returns null


requestSonar

public SonarPlayerDevice requestSonar(int index,
                                      char r)

requestLaser

public LaserPlayerDevice requestLaser(int index,
                                      char r)

requestBlobfinder

public BlobfinderInterface requestBlobfinder(int index,
                                             char r)

requestPtz

public PtzPlayerDevice requestPtz(int index,
                                  char r)

requestFiducial

public FiducialInterface requestFiducial(int index,
                                         char r)

requestTruth

public TruthPlayerDevice requestTruth(int index,
                                      char r)

requestDeviceList

public void requestDeviceList()
Add new device code here


requestDriverName

public void requestDriverName(short device)

requestData

public void requestData()

requestDataDeliveryMode

public void requestDataDeliveryMode(byte mode)

requestDataDeliveryFrequency

public void requestDataDeliveryFrequency(short frequency)

requestAuthentication

public void requestAuthentication(byte[] key)

readAll

public void readAll()

handleResponce

public void handleResponce(int size)

isReadyPDDT

public boolean isReadyPDDT()

getPDDT

public kaos.robots.playerJavaClient.PlayerDeviceDevlistT getPDDT()

isReadyPDDI

public boolean isReadyPDDI()

getPDDI

public kaos.robots.playerJavaClient.PlayerDeviceDriverInfo getPDDI()

isAuthenticated

public boolean isAuthenticated()