Class MotionSensorProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.motionsensor.MotionSensorProperties
All Implemented Interfaces:
JposBaseInterface, MotionSensorInterface

public class MotionSensorProperties extends JposCommonProperties implements MotionSensorInterface
Class containing the motion sensor specific properties, their default values and default implementations of MotionSensorInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Motion Sensor.
  • Field Details

    • Motion

      public boolean Motion
      UPOS property Motion. Must be overwritten by derived objects within the initOnEnable method.
    • Timeout

      public int Timeout
      UPOS property Timeout.
    • BufferedAbsent

      public MotionSensorStatusUpdateEvent BufferedAbsent
      StatusUpdateEvent to be delivered Timeout milliseconds after it has been fired.
    • TimeoutWaiter

      public SyncObject TimeoutWaiter
      Synchronization object used by MotionSensor to wait until Timeout milliseconds have passed.
  • Constructor Details

    • MotionSensorProperties

      public MotionSensorProperties(int dev)
      Constructor. Sets ExclusiveUse to ExclusiveNo to match the MotionSensor device model.
      Parameters:
      dev - Device index
  • Method Details

    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • timeout

      public void timeout(int timeout) throws jpos.JposException
      Description copied from interface: MotionSensorInterface
      Final part of setTimeout method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • timeout is > 0.
      Specified by:
      timeout in interface MotionSensorInterface
      Parameters:
      timeout - Time delay for motion
      Throws:
      jpos.JposException - If an error occurs.
    • waitForMotion

      public void waitForMotion(int timeout) throws jpos.JposException
      Description copied from interface: MotionSensorInterface
      Final part of WaitForMotion method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • timeout is a positive value or FOREVER.
      Specified by:
      waitForMotion in interface MotionSensorInterface
      Parameters:
      timeout - Number of milliseconds to wait before firing an exception with JPOS_E_TIMEOUT.
      Throws:
      jpos.JposException - If an error or a timeout occurs.