sendToSimulator("{\"response\":\"write\",\"data\":1}");
} else if ("remove".equals(event)) {
// TODO remove nodes
} else if ("serial".equals(event)) {
int data = json.getAsInt("data", -1);
JSONArray nodes;
String node;
if (data < 0) {
// No data - ignore serial event
} else if ((nodes = json.getJSONArray("node")) != null) {
for(int i = 0, n = nodes.size(); i < n; i++) {
node = nodes.getAsString(i);
if (node != null) {
sendSerialToNode(node, data);
}
}
} else if ((node = json.getAsString("node")) != null) {