jmri.jmrit.withrottle
Class DeviceServer

Show UML class diagram
java.lang.Object
  extended by jmri.jmrit.withrottle.DeviceServer
All Implemented Interfaces:
Runnable, EventListener, ControllerInterface, ThrottleControllerListener

public class DeviceServer
extends Object
implements Runnable, ThrottleControllerListener, ControllerInterface


Field Summary
(package private)  String deviceName
           
(package private)  String deviceUDID
           
(package private)  BufferedReader in
           
(package private)  boolean isRouteAllowed
           
(package private)  boolean isTrackPowerAllowed
           
(package private)  boolean isTurnoutAllowed
           
(package private)  ArrayList<DeviceListener> listeners
           
(package private) static org.slf4j.Logger log
           
(package private)  Hashtable<Character,MultiThrottle> multiThrottles
           
(package private)  String newLine
           
(package private)  PrintStream out
           
(package private)  List<RosterEntry> rosterList
           
(package private)  ThrottleController secondThrottleController
           
(package private)  ThrottleController throttleController
           
 
Constructor Summary
DeviceServer(Socket socket, DeviceManager manager)
           
 
Method Summary
 void addDeviceListener(DeviceListener l)
          Add a DeviceListener
 void closeSocket()
           
 void closeThrottles()
           
 String getCurrentAddressString()
           
 String getName()
           
 String getUDID()
           
static String getWebServerPort()
           
static String getWiTVersion()
           
 void notifyControllerAddressFound(ThrottleController TC)
           
 void notifyControllerAddressReleased(ThrottleController TC)
           
 void removeDeviceListener(DeviceListener l)
          Remove a DeviceListener
 void run()
           
 void sendPacketToDevice(String message)
          Called by various Controllers to send a string message to a connected device.
 String sendRoster()
          Format a package to be sent to the device for roster list selections.
 void startEKG()
           
 void stopEKG()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newLine

String newLine

in

BufferedReader in

out

PrintStream out

listeners

ArrayList<DeviceListener> listeners

deviceName

String deviceName

deviceUDID

String deviceUDID

throttleController

ThrottleController throttleController

secondThrottleController

ThrottleController secondThrottleController

multiThrottles

Hashtable<Character,MultiThrottle> multiThrottles

isTrackPowerAllowed

final boolean isTrackPowerAllowed

isTurnoutAllowed

final boolean isTurnoutAllowed

isRouteAllowed

final boolean isRouteAllowed

rosterList

List<RosterEntry> rosterList

log

static org.slf4j.Logger log
Constructor Detail

DeviceServer

DeviceServer(Socket socket,
             DeviceManager manager)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

closeThrottles

public void closeThrottles()

closeSocket

public void closeSocket()

startEKG

public void startEKG()

stopEKG

public void stopEKG()

getUDID

public String getUDID()

getName

public String getName()

getCurrentAddressString

public String getCurrentAddressString()

getWiTVersion

public static String getWiTVersion()

getWebServerPort

public static String getWebServerPort()

sendPacketToDevice

public void sendPacketToDevice(String message)
Called by various Controllers to send a string message to a connected device. Appends a newline to the end.

Specified by:
sendPacketToDevice in interface ControllerInterface
Parameters:
message - The string to send.

addDeviceListener

public void addDeviceListener(DeviceListener l)
Add a DeviceListener

Parameters:
l -

removeDeviceListener

public void removeDeviceListener(DeviceListener l)
Remove a DeviceListener

Parameters:
l -

notifyControllerAddressFound

public void notifyControllerAddressFound(ThrottleController TC)
Specified by:
notifyControllerAddressFound in interface ThrottleControllerListener

notifyControllerAddressReleased

public void notifyControllerAddressReleased(ThrottleController TC)
Specified by:
notifyControllerAddressReleased in interface ThrottleControllerListener

sendRoster

public String sendRoster()
Format a package to be sent to the device for roster list selections.

Returns:
String containing a formatted list of some of each RosterEntry's info. Include a header with the length of the string to be received.


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads