From 597fd3eddfb7d6884343bf190ff1cbf723d0946a Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Wed, 28 Jan 2026 00:07:10 +0100 Subject: [PATCH] improved sdnpublisher schema --- internal/schema/marte.cue | 39 ++++++++++++++++++++---------------- test/validator_extra_test.go | 4 ++-- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/internal/schema/marte.cue b/internal/schema/marte.cue index 5c2d49e..4a79a68 100644 --- a/internal/schema/marte.cue +++ b/internal/schema/marte.cue @@ -65,8 +65,8 @@ package schema ... } FileDataSource: { - Filename: string - Format?: string + Filename: string + Format?: string #meta: multithreaded: bool | *false #meta: direction: "INOUT" ... @@ -77,7 +77,7 @@ package schema ... } DANStream: { - Timeout?: int + Timeout?: int #meta: multithreaded: bool | *false #meta: direction: "OUT" ... @@ -103,38 +103,43 @@ package schema ... } SDNSubscriber: { - Address: string - Port: int - Interface?: string + ExecutionMode?: *"IndependentThread" | "RealTimeThread" + Topic!: string + Address?: string + Interface!: string + CPUs?: uint32 + InternalTimeout?: uint32 + Timeout?: uint32 + IgnoreTimeoutError?: 0 | 1 #meta: multithreaded: bool | *false #meta: direction: "IN" ... } SDNPublisher: { - Address: string - Port: int - Interface?: string + Address: string + Port: int + Interface?: string #meta: multithreaded: bool | *false #meta: direction: "OUT" ... } UDPReceiver: { - Port: int - Address?: string + Port: int + Address?: string #meta: multithreaded: bool | *false #meta: direction: "IN" ... } UDPSender: { - Destination: string + Destination: string #meta: multithreaded: bool | *false #meta: direction: "OUT" ... } FileReader: { - Filename: string - Format?: string - Interpolate?: string + Filename: string + Format?: string + Interpolate?: string #meta: multithreaded: bool | *false #meta: direction: "IN" ... @@ -143,8 +148,8 @@ package schema Filename: string Format?: string StoreOnTrigger?: int - #meta: multithreaded: bool | *false - #meta: direction: "OUT" + #meta: multithreaded: bool | *false + #meta: direction: "OUT" ... } OrderedClass: { diff --git a/test/validator_extra_test.go b/test/validator_extra_test.go index 5d8d719..64ec6c8 100644 --- a/test/validator_extra_test.go +++ b/test/validator_extra_test.go @@ -15,7 +15,7 @@ func TestSDNSubscriberValidation(t *testing.T) { +MySDN = { Class = SDNSubscriber Address = "239.0.0.1" - // Missing Port + // Missing Interface } ` p := parser.NewParser(content) @@ -32,7 +32,7 @@ func TestSDNSubscriberValidation(t *testing.T) { found := false for _, d := range v.Diagnostics { - if strings.Contains(d.Message, "Port: incomplete value") { + if strings.Contains(d.Message, "Interface: field is required but not present") { found = true break }