コード例 #1
0
 @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();
 }
コード例 #2
0
 @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;
 }