uk.ac.ed.inf.sdp2012.group7.control
Class BluetoothCommunication

java.lang.Object
  extended by uk.ac.ed.inf.sdp2012.group7.control.BluetoothCommunication
All Implemented Interfaces:
CommunicationInterface, ConstantsReuse

public class BluetoothCommunication
extends java.lang.Object
implements CommunicationInterface


Nested Class Summary
 
Nested classes/interfaces inherited from interface uk.ac.ed.inf.sdp2012.group7.control.ConstantsReuse
ConstantsReuse.OpCodes
 
Field Summary
 
Fields inherited from interface uk.ac.ed.inf.sdp2012.group7.control.ConstantsReuse
ROBOT_MAC, ROBOT_NAME
 
Constructor Summary
BluetoothCommunication(NXTComm nxtComm, NXTInfo info)
           
 
Method Summary
 void closeConnection()
           
 void openConnection()
           
 int recieveFromRobot()
           
 ConstantsReuse.OpCodes sendToRobot(byte[] command)
          Sends a command to the robot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BluetoothCommunication

public BluetoothCommunication(NXTComm nxtComm,
                              NXTInfo info)
Method Detail

recieveFromRobot

public int recieveFromRobot()
Specified by:
recieveFromRobot in interface CommunicationInterface

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