/**
 * Multicast E2E test with 3 multi-size signals.
 * Server: TCP control on 44600, UDP multicast DATA on 239.0.0.1:44610.
 * Client: TCP connect for CONFIG, UDP join for DATA.
 * Client thread is event-driven (no LinuxTimer).
 */
$E2EMulticastTest = {
    Class = RealTimeApplication
    +Functions = {
        Class = ReferenceContainer

        +TimerGAM = {
            Class = IOGAM
            InputSignals = {
                Counter = { DataSource = ReaderTimer Type = uint32 }
                Time = { Frequency = 10 DataSource = ReaderTimer Type = uint32 }
            }
            OutputSignals = {
                Counter = { DataSource = DDB Type = uint32 }
                Time = { DataSource = DDB Type = uint32 }
            }
        }

        +ReaderGAM = {
            Class = IOGAM
            InputSignals = {
                Signal_100 = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { DataSource = FileReaderDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
            OutputSignals = {
                Signal_100 = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { DataSource = Streamer Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
        }

        +ClientGAM = {
            Class = IOGAM
            InputSignals = {
                Signal_100 = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { DataSource = ClientDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
            OutputSignals = {
                Signal_100 = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { DataSource = FileWriterDS Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
        }
    }

    +Data = {
        Class = ReferenceContainer
        DefaultDataSource = DDB
        +DDB = { Class = GAMDataSource }

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

        +FileReaderDS = { Class = FileReader Filename = "/tmp/udpstreamer_test_input.bin" Interpolate = "no" FileFormat = "binary" }

        +Streamer = {
            Class = UDPStreamer
            Port = 44600
            MulticastGroup = "239.0.0.1"
            DataPort = 44610
            MaxPayloadSize = 65507
            PublishingMode = "Strict"
            Signals = {
                Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
        }

        +ClientDS = {
            Class = UDPStreamerClient
            ServerAddress = "127.0.0.1"
            Port = 44600
            MulticastGroup = "239.0.0.1"
            DataPort = 44610
            MaxPayloadSize = 65507
            Signals = {
                Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
        }

        +FileWriterDS = {
            Class = FileWriter
            NumberOfBuffers = 10
            CPUMask = 0x10
            StackSize = 10000000
            Filename = "/tmp/udpstreamer_test_output_multicast.bin"
            Overwrite = "yes"
            StoreOnTrigger = 0
            FileFormat = "binary"
            Signals = {
                Signal_100 = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 100 }
                Signal_1K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
                Signal_5K  = { Type = float32 NumberOfDimensions = 1 NumberOfElements = 5000 }
            }
        }

        +Timings = { Class = TimingDataSource }
    }

    +States = {
        Class = ReferenceContainer
        +Running = {
            Class = RealTimeState
            +Threads = {
                Class = ReferenceContainer
                +ReaderThread = { Class = RealTimeThread CPUs = 0x1 Functions = {TimerGAM ReaderGAM} }
                +ClientThread = { Class = RealTimeThread CPUs = 0x2 Functions = {ClientGAM} }
            }
        }
    }

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