@Override public PinState getState(GpioPinDigital pin) { // ensure the requested pin has been provisioned if (!pins.contains(pin)) { throw new GpioPinNotProvisionedException(pin.getPin()); } // return pin state return pin.getState(); }
@Override public boolean isState(PinState state, GpioPinDigital... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } for (GpioPinDigital p : pin) { if (!p.isState(state)) { return false; } } return true; }