Implemented DebugService with TCPLogger injection

This commit is contained in:
Martino Ferrari
2026-04-09 22:22:39 +02:00
parent b86ede99b9
commit 96d98dfc3d
9 changed files with 894 additions and 245 deletions
+23 -9
View File
@@ -26,6 +26,16 @@
}
}
}
+CGAM = {
Class = ConstantGAM
OutputSignals = {
Test = {
DataSource = DDB2
Type = float32
Default = 0.123
}
}
}
+GAM2 = {
Class = IOGAM
InputSignals = {
@@ -36,6 +46,10 @@
Time = {
DataSource = TimerSlow
}
Test = {
DataSource = DDB2
Type = float32
}
}
OutputSignals = {
Counter = {
@@ -46,6 +60,10 @@
Type = uint32
DataSource = Logger
}
ConstOut = {
DataSource = Logger
Type = float32
}
}
}
+GAM3 = {
@@ -122,6 +140,10 @@
}
}
}
+DDB2 = {
AllowNoProducer = 1
Class = GAMDataSource
}
+DDB3 = {
AllowNoProducer = 1
Class = GAMDataSource
@@ -142,7 +164,7 @@
}
+Thread2 = {
Class = RealTimeThread
Functions = {GAM2}
Functions = {GAM2 CGAM}
}
+Thread3 = {
Class = RealTimeThread
@@ -165,11 +187,3 @@
StreamIP = "127.0.0.1"
}
+LoggerService = {
Class = LoggerService
CPUs = 0x1
+DebugConsumer = {
Class = TcpLogger
Port = 8082
}
}
+10 -12
View File
@@ -27,16 +27,18 @@ const char8 * const config_command_text =
" CustomGAMField = \"GAMValue\" "
" InputSignals = {"
" Counter = { DataSource = Timer Type = uint32 Frequency = 1000 PVName = \"PROC:VAR:1\" }"
" Time = { DataSource = Timer Type = uint32 }"
" }"
" OutputSignals = {"
" Counter = { DataSource = DDB Type = uint32 }"
" Time = { DataSource = DDB Type = uint32 }"
" }"
" }"
" }"
" +Data = {"
" Class = ReferenceContainer "
" +Timer = { Class = LinuxTimer SleepTime = 1000 Signals = { Counter = { Type = uint32 } } }"
" +DDB = { Class = GAMDataSource Signals = { Counter = { Type = uint32 } } }"
" +Timer = { Class = LinuxTimer SleepTime = 1000 Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }"
" +DDB = { Class = GAMDataSource Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }"
" +DAMS = { Class = TimingDataSource }"
" }"
" +States = {"
@@ -97,16 +99,12 @@ void TestConfigCommands() {
// Start the application to trigger broker execution and signal registration
ReferenceT<RealTimeApplication> app = ObjectRegistryDatabase::Instance()->Find("App");
if (app.IsValid()) {
if (app->ConfigureApplication()) {
if (app->PrepareNextState("State1") == ErrorManagement::NoError) {
if (app->StartNextStateExecution() == ErrorManagement::NoError) {
printf("Application started (for signal registration).\n");
Sleep::MSec(500); // Wait for some cycles
}
}
}
}
assert(app.IsValid());
assert(app->ConfigureApplication());
assert(app->PrepareNextState("State1") == ErrorManagement::NoError);
assert(app->StartNextStateExecution() == ErrorManagement::NoError);
printf("Application started (for signal registration).\n");
Sleep::MSec(500); // Wait for some cycles
ReferenceT<DebugService> service = ObjectRegistryDatabase::Instance()->Find("DebugService");
if (service.IsValid()) {
+1 -1
View File
@@ -21,7 +21,7 @@ void timeout_handler(int sig) {
}
void ErrorProcessFunction(const MARTe::ErrorManagement::ErrorInformation &errorInfo, const char8 * const errorDescription) {
// printf("[MARTe Error] %s: %s\n", errorInfo.className, errorDescription);
printf("[MARTe Error] %s: %s\n", errorInfo.className, errorDescription);
}
// Forward declarations of other tests
+4 -2
View File
@@ -39,17 +39,19 @@ void TestTreeCommand() {
" Class = IOGAM "
" InputSignals = {"
" Counter = { DataSource = Timer Type = uint32 Frequency = 1000 }"
" Time = { DataSource = Timer Type = uint32 }"
" }"
" OutputSignals = {"
" Counter = { DataSource = DDB Type = uint32 }"
" Time = { DataSource = DDB Type = uint32 }"
" }"
" }"
" }"
" +Data = {"
" Class = ReferenceContainer "
" DefaultDataSource = DDB "
" +Timer = { Class = LinuxTimer SleepTime = 1000 Signals = { Counter = { Type = uint32 } } }"
" +DDB = { Class = GAMDataSource Signals = { Counter = { Type = uint32 } } }"
" +Timer = { Class = LinuxTimer SleepTime = 1000 Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }"
" +DDB = { Class = GAMDataSource Signals = { Counter = { Type = uint32 } Time = { Type = uint32 } } }"
" +DAMS = { Class = TimingDataSource }"
" }"
" +States = {"