|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorbotix.robot.base.RobotProvider
public class RobotProvider
Class to maintain the available and connected robot devices. Uses the BluetoothAdapter to discover and get Orbotix devices.
Field Summary | |
---|---|
static java.lang.String |
ACTION_ROBOT_CONNECT_FAILED
Action for broadcasting when a connection failed or disconnected. |
static java.lang.String |
ACTION_ROBOT_CONNECT_SUCCESS
Action for broadcasting when a connection to an Orbotix device is successful. |
static java.lang.String |
ACTION_ROBOT_CONNECTING
Action for broadcasting when the provider has started an attempt to connect to a Orbotix device |
static java.lang.String |
ACTION_ROBOT_DISCONNECTED
Broadcast message action for when the robot disconnects |
static java.lang.String |
ACTION_ROBOT_FOUND
Action for broadcasting when a Orbotix device is found. |
static java.lang.String |
ACTION_ROBOT_MAIN_APP_CORRUPT
Broadcast message when a corrupt main application is reported. |
static java.lang.String |
ACTION_ROBOT_MULTIPLE_FOUND
Action for broadcasting when multiple Orbotix devices were found in during discovery |
static java.lang.String |
ACTION_ROBOT_NONE_FOUND
Action for broadcasting when Orbotix devices weren't found during discovery |
static java.lang.String |
ACTION_ROBOT_NONE_PAIRED
Action for broadcasting when no Orbotix devices have been paired with the device |
static java.lang.String |
EXTRA_ROBOT_ID
Key for a Robot id to send a robot to which you want to immediately connect. |
Method Summary | |
---|---|
java.lang.Boolean |
connectControlledRobots()
Attempts to connect to any Robots who have been set up to be controlled. |
void |
control(Robot robot)
Adds the robot to the controlled robot array. |
void |
disconnectControlledRobots()
Disconnects all robots that are under control without removing them from control. |
void |
endDiscovery()
Stops discovery for bluetooth Orbotix devices. |
Robot |
findRobot(java.lang.String robotId)
Finds a robot in the robot list by it's bluetooth address. |
void |
findRobots()
|
android.content.Intent |
getAdapterIntent()
Provides an Intent object that can be used to start an activity to enable the adapter. |
android.content.Context |
getBroadcastContext()
Accessor to the broadcast context used for action messages. |
java.util.ArrayList |
getControlledRobots()
Gets an array of Robot objects that are being controlled. |
static RobotProvider |
getDefaultProvider()
Get a handle on the default provider object. |
RobotControl |
getRobotControl(Robot robot)
Gets the RobotControl object for a Robot object. |
java.util.ArrayList |
getRobotControls()
Accessor to the RobotControl objects. |
java.util.ArrayList |
getRobots()
Accessor to available robots. |
boolean |
hasAdapter()
This allows a check for a communication adapter that can be used to connect to a robot. |
boolean |
hasRobotControl()
Method for testing that there is at least one robot to control. |
void |
initiateConnection(java.lang.String robotId)
Method to initiate a connection. |
boolean |
isAdapterEnabled()
Checks to see if the communication adapter is turned on. |
void |
removeAllControls()
Removes all robots under control. |
void |
removeControl(Robot robot)
Release the robot from control. |
void |
removeControl(RobotControl control)
Removes a Robot control the controlled robot array. |
void |
setBroadcastContext(android.content.Context context)
Method to set a context to broadcast action messages with. |
void |
startDiscovery()
Starts discovery for bluetooth Orbotix devices. |
void |
update(java.util.Observable observable,
java.lang.Object data)
DO NOT USE. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACTION_ROBOT_FOUND
public static final java.lang.String ACTION_ROBOT_MULTIPLE_FOUND
public static final java.lang.String ACTION_ROBOT_NONE_FOUND
public static final java.lang.String ACTION_ROBOT_NONE_PAIRED
public static final java.lang.String ACTION_ROBOT_CONNECTING
public static final java.lang.String ACTION_ROBOT_CONNECT_SUCCESS
public static final java.lang.String ACTION_ROBOT_CONNECT_FAILED
public static final java.lang.String ACTION_ROBOT_DISCONNECTED
public static final java.lang.String ACTION_ROBOT_MAIN_APP_CORRUPT
public static final java.lang.String EXTRA_ROBOT_ID
Method Detail |
---|
public static RobotProvider getDefaultProvider()
public void initiateConnection(java.lang.String robotId)
robotId
- The unique id of the preferred Orbotix device when multiple devices are present.public boolean hasAdapter()
public boolean isAdapterEnabled()
public android.content.Intent getAdapterIntent()
public void setBroadcastContext(android.content.Context context)
context
- The context to broadcast action messages.public android.content.Context getBroadcastContext()
public void startDiscovery()
public void findRobots()
public void endDiscovery()
public java.util.ArrayList getControlledRobots()
public java.util.ArrayList getRobots()
public void control(Robot robot)
robot
- The robot to control. |public void removeControl(Robot robot)
robot
- The robot to release.public void removeControl(RobotControl control)
control
- The RobotControl object to remove.public void removeAllControls()
public java.lang.Boolean connectControlledRobots()
RobotProvider.control(Robot)
public void disconnectControlledRobots()
public boolean hasRobotControl()
public java.util.ArrayList getRobotControls()
public RobotControl getRobotControl(Robot robot)
robot
- The robot.
public Robot findRobot(java.lang.String robotId)
robotId
- String id that for the robot.
public void update(java.util.Observable observable, java.lang.Object data)
update
in interface java.util.Observer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |