/** * Return 'true' if motion is currently detected * based on the GPIO digital input pin state. * * @return motion detected status */ @Override public boolean isMotionDetected() { return pin.isState(motionDetectedState); } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
/** * Return 'true' if motion is currently detected * based on the GPIO digital input pin state. * * @return motion detected status */ @Override public boolean isMotionDetected() { return pin.isState(motionDetectedState); } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
/** * Return the current sensor state based on the * GPIO digital output pin state. * * @return PowerState */ @Override public SensorState getState() { if(pin.isState(openState)) return SensorState.OPEN; else return SensorState.CLOSED; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return ButtonState */ @Override public ButtonState getState() { if(pin.isState(pressedState)) return ButtonState.PRESSED; else return ButtonState.RELEASED; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
/** * Return the current sensor state based on the * GPIO digital output pin state. * * @return PowerState */ @Override public SensorState getState() { if(pin.isState(openState)) return SensorState.OPEN; else return SensorState.CLOSED; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return ButtonState */ @Override public ButtonState getState() { if(pin.isState(pressedState)) return ButtonState.PRESSED; else return ButtonState.RELEASED; } }
/** * Return the current switch state based on the * GPIO digital output pin state. * * @return SwitchState */ @Override public SwitchState getState() { if(pin.isState(onState)) return SwitchState.ON; else return SwitchState.OFF; } }
@Override public void run() { // if the current pin state is not the same as the original pin state, // then we need to raise a new pin event to notify the user that the pin // state has changed during the debounce delay period if(!pin.isState(originalPinState)){ // add a new pin event notification to the thread pool for *immediate* execution executor.execute(new GpioEventDispatchTaskImpl(pin, new PinDigitalStateChangeEvent(this, pin.getPin(), pin.getState()))); } } }
@Override public void run() { // if the current pin state is not the same as the original pin state, // then we need to raise a new pin event to notify the user that the pin // state has changed during the debounce delay period if(!pin.isState(originalPinState)){ // add a new pin event notification to the thread pool for *immediate* execution executor.execute(new GpioEventDispatchTaskImpl(pin, new PinDigitalStateChangeEvent(this, pin.getPin(), pin.getState()))); } } }