PamController
Class NetworkController
java.lang.Object
PamController.NetworkController
public class NetworkController
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pamController
private PamController pamController
listenerThread
private NetworkController.ListenerThread listenerThread
receiveSocket
private java.net.DatagramSocket receiveSocket
udpPacket
private java.net.DatagramPacket udpPacket
initialisationComplete
private boolean initialisationComplete
MAX_COMMAND_LENGTH
private static final int MAX_COMMAND_LENGTH
- See Also:
- Constant Field Values
byteBuffer
private byte[] byteBuffer
recorderTriggers
private NetworkController.NetworkRecorderTrigger[] recorderTriggers
NetworkController
public NetworkController(PamController pamController)
openUDPPort
public boolean openUDPPort()
- Open the UDP port.
- Returns:
- true if opened OK
closeUDPPort
public void closeUDPPort()
- Close the UDP port.
sitInLoop
public void sitInLoop()
- Infinite loop. The program sits here waiting for
commands and interpreting them as needs.
It will exit when InterpretCommand returns
false, which it should only do when the exit
program command has been sent.
interpretCommand
private boolean interpretCommand(java.lang.String command)
- Interpret and act on a udp command string.
- Parameters:
command - command string
- Returns:
- false if the command was to exit
the program (in which case this thread will
exit and close the port). True otherwise.
sendData
private boolean sendData(java.lang.String dataString)
getCommand
private java.lang.String getCommand()
- Blocking function to wait for a command string to be sent
over UDP
- Returns:
- command string or null if should exit.
notifyModelChanged
public void notifyModelChanged(int changeType)
createRecorderTriggers
private void createRecorderTriggers()
triggerRecording
private boolean triggerRecording(java.lang.String name,
int seconds)
findTrigger
private NetworkController.NetworkRecorderTrigger findTrigger(java.lang.String name)