evt_timer_service

Time-event service generating periodic and timeout events.

Inherited Component

Inherited Requirements

Relationship Diagram

UML class diagram for evt_timer_service

SW Unit Relations

Incoming Relations

Relation

UML Type

Visibility

Source Unit

Description

SWR-002

composition

private

ao_runtime_supervisor

Runtime supervisor owns timer event service.

Data Types

evt_timer_service_contextstruct

Internal runtime context for evt_timer_service.

Struct Members

Name

Type

Description

tick_period_ms

uint32_t

Scheduler tick period.

tick_counter

uint32_t

Tick counter.

timer_running

bool

Timer active state.

missed_tick_flag

bool

Missed tick indicator.

evt_timer_service_eventstruct

Event payload handled by evt_timer_service.

Struct Members

Name

Type

Description

signal_id

uint16_t

Timer event id.

tick_index

uint32_t

Tick sequence number.

source_timer_id

uint8_t

Source timer identifier.

timeout_flag

bool

Timeout indicator.

evt_timer_service_resultenum

Result code for evt_timer_service operations.

Enum Members

Name

Value

Description

OK

0

Tick processed.

TIMER_FAULT

1

Underlying timer fault.

MISSED_TICK

2

Tick deadline missed.

Attributes

Attribute

Type

Visibility

Description

ctx

evt_timer_service_context

private

Runtime context for evt_timer_service state timing and error tracking.

Methods

dispatch

  • Return Type: evt_timer_service_result

  • Visibility: public

  • Description: Process one evt_timer_service event and update runtime outputs.

Parameters

Name

Type

Direction

Description

event

evt_timer_service_event

in

Process one evt_timer_service event and update runtime outputs.

init

  • Return Type: evt_timer_service_result

  • Visibility: public

  • Description: Initialize evt_timer_service runtime state and dependencies.

Dynamic Behaviour

Activity Diagrams

evt_timer_service_activity

@startuml
start
:Register periodic and one-shot timers;
:Advance tick counter;
if (timer expired?) then (yes)
  :Create timer event;
  :Enqueue event to dispatcher;
  if (periodic?) then (yes)
    :Reload timer deadline;
  else (no)
    :Remove one-shot timer;
  endif
endif
stop
@enduml

This activity diagram specifies timer management behavior for periodic and one shot timers including tick advancement expiry detection event emission and periodic reload policy.

Timing Diagrams

evt_timer_service_timing

@startuml
robust "evt_timer_service" as TIMER
scale max 1200 width
concise "tick" as T

@0
T is 0ms
TIMER is counting

@500
T is 500ms
TIMER is emit_sampling_event

@1000
T is 1000ms
TIMER is emit_protection_deadline_event

@1500
TIMER is emit_housekeeping_event

@enduml

This timing diagram captures expected timer event emission points for sampling protection and housekeeping deadlines and supports validation of temporal orchestration across runtime services.

Sequence Diagrams

SEQ-001_Runtime_Event_Orchestration

@startuml

hide footbox
title Runtime Event Orchestration

participant ao_runtime_supervisor
participant evt_timer_service
participant evt_dispatcher
participant ao_monitoring
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_timer_service : init periodic tick
ao_runtime_supervisor -> evt_dispatcher : init event loop
loop each scheduler tick
  evt_timer_service -> ao_runtime_supervisor : tick event
  ao_runtime_supervisor -> evt_dispatcher : dispatch cycle
  evt_dispatcher -> ao_monitoring : monitor_event
  evt_dispatcher -> ao_control : control_event
  evt_dispatcher -> ao_safety : safety_event
  evt_dispatcher -> ao_diagnostics : diagnostics_event
  evt_dispatcher -> ao_modbus_server : comms_event
end

@enduml

Primary runtime interoperability sequence showing scheduler tick propagation through dispatcher fan-out and deterministic active-object processing order across monitoring control safety diagnostics and communication units.

SEQ-005_Startup_To_Ready

@startuml
hide footbox
participant ao_runtime_supervisor
participant evt_timer_service
participant evt_dispatcher
participant ao_monitoring
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_timer_service : init()
ao_runtime_supervisor -> evt_dispatcher : init()
ao_runtime_supervisor -> ao_monitoring : init()
ao_runtime_supervisor -> ao_control : init()
ao_runtime_supervisor -> ao_safety : init()
ao_runtime_supervisor -> ao_diagnostics : init()
ao_runtime_supervisor -> ao_modbus_server : init()

group readiness gates
  evt_timer_service --> ao_runtime_supervisor : EVT_TIMER_READY
  evt_dispatcher --> ao_runtime_supervisor : EVT_DISPATCH_READY
  ao_monitoring --> ao_runtime_supervisor : EVT_AO_READY
  ao_control --> ao_runtime_supervisor : EVT_AO_READY
  ao_safety --> ao_runtime_supervisor : EVT_AO_READY
  ao_diagnostics --> ao_runtime_supervisor : EVT_AO_READY
  ao_modbus_server --> ao_runtime_supervisor : EVT_AO_READY
end

ao_runtime_supervisor -> evt_dispatcher : EVT_INIT_OK / start Run
@enduml

Startup lifecycle sequence with explicit readiness gates before entering Run state.