|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface KTeamCommDelegate
The KTeamCommDelegate interface defines a set of methods that are used by the KTeamRobot class to open and close connections with a robot and to send messages to a robot. There will be different implementations of this delegate for each different means of communicating with the robot (e.g. bluetooth and serial port). The KTeamRobot constructor will build a delegate based on how it is constructed. Then the methods in the KTeamRobot class and its subclasses (e.g. Hemisson & Khepera2) will simply invoke the methods in the delegate. This allows the KTeamRobot class and its subclasses to be less aware of how the communication is happening.
| Method Summary | |
|---|---|
void |
closeConnection()
This method must do whatever is necessary to close the connection to the robot. |
void |
establishConnection()
This method must do whatever is necessary to establish a connection to the robot. |
String |
sendMessage(String message,
int delay)
Send a message to the robot. |
| Method Detail |
|---|
void establishConnection()
RobotCommunicationException - if unable to establish communication
with the robot.void closeConnection()
RobotCommunicationException - if unable to close the connection to
the robot.
String sendMessage(String message,
int delay)
If this method is unable to communicate with the robot then it must attempt to close the connection to the robot and throw a RobotCommunicationException.
The delay is included to allow the sensors to wait for longer periods of time when necessary (e.g. to wait for longer sonar echos).
message - the message to be sent.delay - the number of milliseconds to wait before checking for a
response. Note that different delegates may choose to check
for responses a different number of times. Thus, the wait time
here may be greater than delay.
RobotCommunicationException - if unable to communicate with the
robot.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||