Search in sources :

Example 1 with GetDyIOChannelCountCommand

use of com.neuronrobotics.sdk.commands.bcs.io.GetDyIOChannelCountCommand in project java-bowler by NeuronRobotics.

the class DyIO method getDyIOChannelCount.

public Integer getDyIOChannelCount() {
    if (dyioChanCount == null) {
        if (isLegacyParser()) {
            try {
                BowlerDatagram dg = send(new GetDyIOChannelCountCommand());
                dyioChanCount = ByteList.convertToInt(dg.getData().getBytes(0, 4));
            } catch (InvalidResponseException ex) {
                ex.printStackTrace();
            }
        } else {
            Object[] args = send("bcs.io.*;0.3;;", BowlerMethod.GET, "gchc", new Object[] {});
            dyioChanCount = (Integer) args[0];
        }
    }
    return dyioChanCount;
}
Also used : BowlerDatagram(com.neuronrobotics.sdk.common.BowlerDatagram) GetDyIOChannelCountCommand(com.neuronrobotics.sdk.commands.bcs.io.GetDyIOChannelCountCommand) InvalidResponseException(com.neuronrobotics.sdk.common.InvalidResponseException)

Aggregations

GetDyIOChannelCountCommand (com.neuronrobotics.sdk.commands.bcs.io.GetDyIOChannelCountCommand)1 BowlerDatagram (com.neuronrobotics.sdk.common.BowlerDatagram)1 InvalidResponseException (com.neuronrobotics.sdk.common.InvalidResponseException)1