use of com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeListCommand in project java-bowler by NeuronRobotics.
the class DyIO method getAvailibleChannelModes.
public ArrayList<DyIOChannelMode> getAvailibleChannelModes(int channel) {
ArrayList<DyIOChannelMode> modes = new ArrayList<DyIOChannelMode>();
ByteList m;
if (isLegacyParser()) {
BowlerDatagram dg = send(new GetChannelModeListCommand(channel));
m = dg.getData();
Log.error("Packet " + channel + "\r\n" + dg);
Log.error("Data: " + channel + "\r\n" + m);
} else {
// int l = Log.getMinimumPrintLevel();
// Log.enableInfoPrint();
Object[] args = send("bcs.io.*;0.3;;", BowlerMethod.GET, "gcml", new Object[] { channel });
m = (ByteList) args[0];
// Log.setMinimumPrintLevel(l);
}
String modeString = " Availible modes on " + channel;
for (int i = 0; i < m.size(); i++) {
DyIOChannelMode tmpMode = DyIOChannelMode.get(m.getByte(i));
modeString += "\r\n\t" + tmpMode.toString() + "\r\n\t";
modes.add(tmpMode);
}
Log.info(modeString);
return modes;
}
Aggregations