/**
 * Trimmed single-thread configuration for the "debug"/"tcplogger" E2E
 * scenario kinds: exercises DebugService FORCE/TRACE/BREAK over TCP 8080 /
 * UDP 8081 and TCPLogger delivery over TCP 9090, with no UDPStreamer path.
 */

$App = {
    Class = RealTimeApplication

    +Functions = {
        Class = ReferenceContainer

        +TimerGAM = {
            Class = IOGAM
            InputSignals = {
                Counter = {
                    DataSource = Timer
                    Type = uint32
                    Frequency = 1000
                }
                Time = {
                    DataSource = Timer
                    Type = uint32
                }
            }
            OutputSignals = {
                Counter = { DataSource = DDB1  Type = uint32 }
                Time    = { DataSource = DDB1  Type = uint32 }
            }
        }
    }

    +Data = {
        Class = ReferenceContainer
        DefaultDataSource = DDB1

        +DDB1 = { Class = GAMDataSource }

        +Timer = {
            Class = LinuxTimer
            SleepNature = "Default"
            Signals = {
                Counter = { Type = uint32 }
                Time    = { Type = uint32 }
            }
        }

        +Timings = { Class = TimingDataSource }
    }

    +States = {
        Class = ReferenceContainer
        +Running = {
            Class = RealTimeState
            +Threads = {
                Class = ReferenceContainer

                +Thread1 = {
                    Class = RealTimeThread
                    CPUs = 0x1
                    Functions = {TimerGAM}
                }
            }
        }
    }

    +Scheduler = {
        Class = GAMScheduler
        TimingDataSource = Timings
    }
}

// ── DebugService ──────────────────────────────────────────────────────────────
// Patches the broker registry at startup so every signal is traceable.
// TcpLogger is auto-injected on LogPort (9090) — no explicit DataSource needed.
+DebugService = {
    Class = DebugService
    ControlPort = 8080
    StreamPort  = 8081
    LogPort     = 9090
    StreamIP    = "127.0.0.1"
}
