Clock Interface Specification

Identity:          Clock Interface

Description:       The clock interface allows the user to

set the time of day. This interface

processes data that results from the

handling of key events in clock set

mode.

Requires:          This interface requires processed

keycode data from the Key Interface

implementation.

Provides:          This interface provides input to the

Microwave Oven Controller.

Operations:

-----------------------------------------------------------

Method Syntax:

int getHour();

Parameter

In / Out

Description

return

out

Integer representing the hour value for the current time of day.

Method Semantics:

Execution Step

Result

Controller invokes getHour to retrieve the hour value entered by the user.

Hour value is returned to the controller which then sends the necessary output data to the output processing system to use in producing the correct LCD signals.

Usage Constraints: Consecutive time-of-day hour getter

calls must be separated by at least 500

milliseconds in order to be processed.

-----------------------------------------------------------

Method Syntax:

int getMinute();

Parameter

In / Out

Description

return

out

Integer representing the minute value for the current time of day.

Method Semantics:

Execution Step

Result

Controller invokes getMinute to retrieve the minute value entered by the user.

Minute value is returned to the controller which then sends the necessary output data to the output processing system to use in producing the correct LCD signals.

Usage Constraints: Consecutive time-of-day minute getter

calls must be separated by at least 500

milliseconds in order to be processed.

-----------------------------------------------------------

Method Syntax:

int getAmPm();

Parameter

In / Out

Description

return

out

Integer representing the AM/PM value for the current time of day.

Method Semantics:

Execution Step

Result

Controller invokes getAmPm to retrieve the AM/PM value entered by the user.

AM/PM value is returned to the controller which then sends the necessary output data to the output processing system to use in producing the correct LCD signals.

Usage Constraints: Consecutive time-of-day AM/PM getter

calls must be separated by at least 500

milliseconds in order to be processed.

-----------------------------------------------------------

Method Syntax:

byte[] getClockBytes();

Parameter

In / Out

Description

return

out

Byte array containing the byte sequence for setting the clock device.

Method Semantics:

Execution Step

Result

Controller invokes getClockBytes to get the byte sequence derived from the data input by the user.

The set-clock byte sequence is returned to the controller which then sets the clock device (via the clock driver) using the byte sequence.

Usage Constraints: Consecutive clock bytes getter

calls must be separated by at least 500

milliseconds in order to be processed.

-----------------------------------------------------------

Method Syntax:

String getTimeOfDay();

Parameter

In / Out

Description

return

out

String containing the current time of day value in the following format: “HH:MM”.

Method Semantics:

Execution Step

Result

Controller invokes getAmPm to retrieve the AM/PM value entered by the user.

AM/PM value is returned to the controller which then sends the necessary output data to the output processing system to use in producing the correct LCD signals.

Usage Constraints: Consecutive time-of-day getter

calls must be separated by at least 500

milliseconds in order to be processed.

User-defined Types:None.

Exceptions:

Exception

Description

Stagnant

If the data in the Clock object being fetched has not changed since the last fetch, this exception will be thrown.

Stale

If the fetch call does not complete within 500 milliseconds, this exception will be thrown from this interface.

Corrupt

If the data in the Clock object being fetched has never been set or has an invalid value, this exception will be thrown.

Quality Attributes: Upon receiving invocation, this

interface is expected to retrieve data

within 1 millisecond.

Usage:              The clock can be set by pressing the

“CLOCK” button and then pressing four

numeric keys where the first two

numeric keys set the hour values and

the second two numeric keys set the

minute values.

Incorrect usage sequences would be the following:

Pressing the “START” button to begin cooking / defrosting and then before the cooking / defrosting operation has completed pressing the “CLOCK” button to set the clock.

Pressing the “START” button to activate the timer and then before the timer operation has completed pressing the “CLOCK” button to set the clock.

Nominal usage of this interface is shown in the following

state-chart and activity diagram:

Requirements Trace:

F4.1.3, F4.1.5