avrora.sim.platform
Class Platform
java.lang.Object
avrora.sim.platform.Platform
- Direct Known Subclasses:
- DefaultPlatform, Mica2, Seres
- public abstract class Platform
- extends java.lang.Object
The Platform
interface represents both a microcontroller instance and the devices connected to
it. These two things together describe a node and its capabilities.
Method Summary |
protected void |
addDevice(java.lang.String name,
java.lang.Object o)
The addDevice() method is used by subclasses of Platform to add external
devices that are connected to the microcontroller. |
java.lang.Object |
getDevice(java.lang.String name)
The getDevice() method looks up a device attached to this platform. |
Microcontroller |
getMicrocontroller()
The getMicrocontroller() method returns a reference to the microcontroller that is driving
this platform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mcu
protected final Microcontroller mcu
devices
protected final java.util.HashMap devices
Platform
protected Platform(Microcontroller m)
getMicrocontroller
public Microcontroller getMicrocontroller()
- The
getMicrocontroller()
method returns a reference to the microcontroller that is driving
this platform.
- Returns:
- a reference to the microcontroller in this platform
addDevice
protected void addDevice(java.lang.String name,
java.lang.Object o)
- The
addDevice()
method is used by subclasses of Platform
to add external
devices that are connected to the microcontroller.
- Parameters:
name
- the name of the device as a stringo
- the object representing the device
getDevice
public java.lang.Object getDevice(java.lang.String name)
- The
getDevice()
method looks up a device attached to this platform. This device might
be a radio, a sensor, etc.
- Parameters:
name
- the name of the device as a string
- Returns:
- an object representing the device if it exists; null otherwise