Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jcontrol.system
Class RTC

    java.lang.Object
      jcontrol.system.RTC

    public class RTC

extends Object

Controls JControls real time clock (RTC).

If the RTC is available as hardware on a battery powered device there are special options:

- the clock is running in power off mode and no preset is required
- the clock alarm is able to power on the device if it occurs during power off. In this case the application that set the alarm is started by selecting the according `flash` bank. If the alarm occurs during power on the currently running application has to poll the `isAlarm` method to find out (this works on all devices).

Author:
  Andreas Wesseler
Available on JControl Devices:

  Sticker, PLUI (hardware), Stamp, SmartDisplay (software emulation)

Field Summary
`static int` | `DAILY` Alarm mode.
`static int` | `DATED` Alarm mode.
`static int` | `OFF` Alarm mode.

Method Summary
`static int` | `getAlarm(Time time)` Gets the alarm time and mode.
`static void` | `getTime(Time time)` Gets the current time.
`static boolean` | `isAlarm()` Checks if an alarm is pending.
`static void` | `resetAlarm()` Resets a pending alarm.
`static void` | `setAlarm(Time time, int mode)` Sets the alarm time and mode.
`static void` | `setTime(Time time)` Sets the current time.

Methods inherited from class java.lang.Object
`clone, equals, notifyAll, wait`

Field Detail

### DAILY

    public static final int DAILY

  Alarm mode. Turn the alarm on for daily events (`day`, `month` and `year` are ignored).

  See Also:
    `setAlarm(Time, int)`, Constant Field Values

### DATED

    public static final int DATED

  Alarm mode. Turn the alarm on for single events.

  See Also:
    `setAlarm(Time, int)`, Constant Field Values

### OFF

    public static final int OFF

  Alarm mode. Turn the alarm off.

  See Also:
    `setAlarm(Time, int)`, Constant Field Values

Method Detail

### getAlarm

    public static int getAlarm(Time time)

  Gets the alarm time and mode.

  Parameters:
    `time` - this object is filled with the values of the point of time the RTC triggers alarm,
  Returns:
    mode the alarmmode currently set, one of `OFF`, `DAILY` or `DATED`.

### getTime

    public static void getTime(Time time)

  Gets the current time.

  Parameters:
    `time` - this object is filled with the values of now (takes a snapshot).

### isAlarm

    public static boolean isAlarm()

  Checks if an alarm is pending.

  Returns:
    `true` if somewhere in the past the RTC passed the alarm time, this flag remains `true` until `resetAlarm()` was invoked.

### resetAlarm

    public static void resetAlarm()

  Resets a pending alarm. The RTC will be ready for the next alarm trigger.

### setAlarm

    public static void setAlarm(Time time,
                                int mode)

  Sets the alarm time and mode.

  Parameters:
    `time` - contains the specification of the point of time the RTC should trigger alarm, `time` may be `null`, then the previous value won't be touched. Note: seconds are ignored for alarm settings by the hardware RTC.
    `mode` - the alarmmode to use, one of `OFF`, `DAILY` or `DATED`.

### setTime

    public static void setTime(Time time)

  Sets the current time. From the point of setting the value, the RTC is counting seconds. This doesn't affect the `Time` object in the parameter.

  Parameters:
    `time` - contains the specification of the point of time the RTC should run from.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD