private void addMoteObservers(final Mote mote, final MoteEvents moteEvents) {
/* TODO Log: final Log moteLog = mote.getInterfaces().getLog(); */
/* TODO Unknown state event */
/* LEDs */
final LED moteLEDs = mote.getInterfaces().getLED();
if (moteLEDs != null) {
LEDEvent startupEv = new LEDEvent(
simulation.getSimulationTime(),
moteLEDs.isRedOn(),
moteLEDs.isGreenOn(),
moteLEDs.isYellowOn()
);
moteEvents.addLED(startupEv);
Observer observer = new Observer() {
public void update(Observable o, Object arg) {
LEDEvent ev = new LEDEvent(
simulation.getSimulationTime(),
moteLEDs.isRedOn(),
moteLEDs.isGreenOn(),
moteLEDs.isYellowOn()
);
moteEvents.addLED(ev);
}
};
moteLEDs.addObserver(observer);
activeMoteObservers.add(new MoteObservation(mote, moteLEDs, observer));
}
/* Radio HW, RXTX */
final Radio moteRadio = mote.getInterfaces().getRadio();