uk.ac.ed.inf.sdp2012.group7.control
Class SimulatorCommunication
java.lang.Object
uk.ac.ed.inf.sdp2012.group7.control.SimulatorCommunication
- All Implemented Interfaces:
- CommunicationInterface, ConstantsReuse
public class SimulatorCommunication
- extends java.lang.Object
- implements CommunicationInterface
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimulatorCommunication
public SimulatorCommunication(java.lang.String host,
int port)
SimulatorCommunication
public SimulatorCommunication()
recieveFromRobot
public int recieveFromRobot()
- Specified by:
recieveFromRobot
in interface CommunicationInterface
receiveFromRobot
public int receiveFromRobot()
sendToRobot
public ConstantsReuse.OpCodes sendToRobot(byte[] command)
- Description copied from interface:
CommunicationInterface
- Sends a command to the robot
- Specified by:
sendToRobot
in interface CommunicationInterface
- Parameters:
command
- - The command to send (4 bytes)
- Returns:
- OpCodes - The robots response
openConnection
public void openConnection()
throws java.io.IOException
- Specified by:
openConnection
in interface CommunicationInterface
- Throws:
java.io.IOException
closeConnection
public void closeConnection()
- Specified by:
closeConnection
in interface CommunicationInterface