Software Detailed Design

Introduction

The Light Controller is responsible for managing the behavior of the LED based on the system’s power state.

Design Considerations

Specification: State Management SWDD_LC-100 ../../../_images/arrow-right-circle.svg
is implemented by: SWIMPL_LC-006
is tested by: TS_LC-006, TS_LC-001

The light can be in one of two states: ON or OFF. The state transitions are triggered by changes in the system’s power state.

Specification: Color Management SWDD_LC-102 ../../../_images/arrow-right-circle.svg
is implemented by: SWIMPL_LC-002, SWIMPL_LC-003
is tested by: TS_LC-001

The color of the light is specified as an RGB value.

Specification: Configurable Color SWDD_LC-103 ../../../_images/arrow-right-circle.svg

The color of the light shall be fixed but configurable. Note: The color is configurable in the sense that it is specified as a configuration parameter. The color is not configurable at runtime.

Interfaces

Specification: Runnable SWDD_LC-200 ../../../_images/arrow-right-circle.svg

The Light Controller is be called by its runnable lightController().

Specification: Power State Input SWDD_LC-201 ../../../_images/arrow-right-circle.svg

The Light Controller uses the RTE interface RteGetPowerState() to get the current power state.

Specification: Light Color Output SWDD_LC-202 ../../../_images/arrow-right-circle.svg

The Light Controller uses the RTE interface RteSetLightValue() to set the light color.

Internal Behavior

Specification: State Machine SWDD_LC-300 ../../../_images/arrow-right-circle.svg
is tested by: TS_LC-006, TS_LC-001

The Light Controller is implemented as a state machine. The state machine is shown below.

stateDiagram-v2 [*] --> LIGHT_OFF: Initial State LIGHT_OFF --> LIGHT_ON : Power State != OFF LIGHT_ON --> LIGHT_OFF : Power State == OFF