From 95b93ea755bc17db1d65ad0add8b480e26131c89 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 15 Apr 2024 13:22:05 -0400 Subject: [PATCH] Fixup for script merge --- fsw/src/sample_app_cmds.c | 2 +- scripts/handler.lua | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fsw/src/sample_app_cmds.c b/fsw/src/sample_app_cmds.c index d54a2a5..a17b8a2 100644 --- a/fsw/src/sample_app_cmds.c +++ b/fsw/src/sample_app_cmds.c @@ -172,7 +172,7 @@ CFE_Status_t SAMPLE_APP_DoExampleCmd(const SAMPLE_APP_DoExampleCmd_t *Msg) CFE_ES_WriteToSysLog("%s: Command Value=%u", __func__, (unsigned int)Msg->Payload.Value); /* JPHFIX: Lua bindings need update to allow proper "const" objects */ - SCRIPTENGINE_CallFunctionArg("TestFunc2", (void*)&Msg->Payload, + SCRIPTENGINE_CallFunctionArg("TestExampleMessageSend", (void*)&Msg->Payload, EDS_INDEX(SAMPLE_APP), SAMPLE_APP_DoExample_Payload_DATADICTIONARY); return CFE_SUCCESS; diff --git a/scripts/handler.lua b/scripts/handler.lua index 35de6ad..43dcd23 100644 --- a/scripts/handler.lua +++ b/scripts/handler.lua @@ -43,5 +43,19 @@ function TestMessageHandler(inmsg) end end +function TestExampleMessageSend(msg) + print "This is TestFunc2()" -TestMessageSender("NoopCmd") \ No newline at end of file + if (msg) then + print ("Got A Message: " .. tostring(msg)) + + -- Using the "call" syntax returns the actual value + print ("The Input value is: " .. msg.Value()) + end + + testobj = EdsDB.NewMessage(outintf, "NoopCMD") + + print("obj=" .. EdsDB.ToHexString(testobj)) + + CFE.SendMsg(testobj) +end