return "Show serial port on " + mote;
}
@Override
public void doAction(Visualizer visualizer, Mote mote) {
Simulation simulation = mote.getSimulation();
SerialPort serialPort = null;
for (MoteInterface intf : mote.getInterfaces().getInterfaces()) {
if (intf instanceof SerialPort) {
serialPort = (SerialPort) intf;
break;
}
}
if (serialPort == null) {
return;
}
/* Extract description (input to plugin) */
String desc = Cooja.getDescriptionOf(serialPort);
MoteInterfaceViewer viewer
= (MoteInterfaceViewer) simulation.getCooja().tryStartPlugin(
MoteInterfaceViewer.class,
simulation.getCooja(),
simulation,
mote);
if (viewer == null) {
return;
}