orbotix.robot.base
Class SleepCommand
java.lang.Object
orbotix.robot.base.DeviceMessage
orbotix.robot.base.DeviceCommand
orbotix.robot.base.SleepCommand
- All Implemented Interfaces:
- android.os.Parcelable
public class SleepCommand
- extends DeviceCommand
Class that encapsulates a command to put the robot to sleep. Includes the ability to
have it wake up after a length of time, plus run a wake up macro.
Nested classes/interfaces inherited from interface android.os.Parcelable |
android.os.Parcelable.Creator |
Field Summary |
static android.os.Parcelable.Creator |
CREATOR
|
Fields inherited from interface android.os.Parcelable |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE |
Constructor Summary |
SleepCommand(int time,
int identifier)
Constructor for creating the sleep command with an optional wake up time and macro. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CREATOR
public static final android.os.Parcelable.Creator CREATOR
SleepCommand
public SleepCommand(int time,
int identifier)
- Constructor for creating the sleep command with an optional wake up time and macro.
- Parameters:
time
- The time in seconds to wake the robot up. 0 seconds indicates that
the robot will never wake up.identifier
- An identifier for a system macro, 1 to 8, to run when the robot wakes up. Setting this to 0
indicates that no macro should be run.
sendCommand
public static void sendCommand(Robot robot,
int time,
int identifier)
- Convenience method for sending a sleep command to a robot.
- Parameters:
robot
- The robot that will receive the command.time
- The time in seconds to wake the robot up. 0 seconds indicates that
the robot will never wake up.identifier
- An identifier for a system macro to run when the robot wakes up. Setting this to 0
indicates that no macro should be run.
getWakeUpTime
public int getWakeUpTime()
- Accessor to the wake up time out.
- Returns:
- The time out in seconds.
getWakeUpMacroId
public int getWakeUpMacroId()
- Accessor to the macro identifier that is ran on wake up.
- Returns:
- The identifier for the wake up macro.
describeContents
public int describeContents()
writeToParcel
public void writeToParcel(android.os.Parcel dest,
int flags)
- Specified by:
writeToParcel
in interface android.os.Parcelable
- Overrides:
writeToParcel
in class DeviceMessage