forked from nasa/fprime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
watney
committed
Apr 5, 2024
1 parent
3166546
commit 4982e36
Showing
78 changed files
with
15,915 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set( | ||
SOURCE_FILES | ||
"${CMAKE_CURRENT_LIST_DIR}/FP.fpp" | ||
) | ||
register_fprime_module() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Svc { | ||
|
||
|
||
port FP ( | ||
fault: U32 | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# F prime CMakeLists.txt: | ||
# SOURCE_FILES: combined list of source and autocoding diles | ||
# MOD_DEPS: (optional) module dependencies | ||
# Note: using PROJECT_NAME as EXECUTABLE_NAME | ||
set(SOURCE_FILES | ||
"${CMAKE_CURRENT_LIST_DIR}/FPManager.fpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/TlmDict.fppi" | ||
"${CMAKE_CURRENT_LIST_DIR}/FPManagerImpl.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/Response.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/CommandSerializer.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/FPResponseTable.cpp" | ||
|
||
"${CMAKE_CURRENT_LIST_DIR}/RESP_1.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/RESP_2.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/SAFING.cpp" | ||
|
||
) | ||
|
||
register_fprime_module() | ||
# | ||
set(UT_SOURCE_FILES | ||
"${CMAKE_CURRENT_LIST_DIR}/FPManager.fpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/test/ut/TestMain.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/test/ut/ResponseExecutionRules.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/test/ut/TestRules.cpp" | ||
) | ||
set (UT_MOD_DEPS STest) | ||
register_fprime_ut() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#### | ||
# F prime CMakeLists.txt: | ||
# | ||
# SOURCE_FILES: combined list of source and autocoding diles | ||
# MOD_DEPS: (optional) module dependencies | ||
# | ||
# Note: using PROJECT_NAME as EXECUTABLE_NAME | ||
#### | ||
set(SOURCE_FILES | ||
"\${CMAKE_CURRENT_LIST_DIR}/FPManager.fpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/TlmDict.fppi" | ||
"\${CMAKE_CURRENT_LIST_DIR}/FPManagerImpl.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/Response.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/CommandSerializer.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/FPResponseTable.cpp" | ||
|
||
#for $response in $responses: | ||
"\${CMAKE_CURRENT_LIST_DIR}/$(response).cpp" | ||
#end for | ||
|
||
) | ||
|
||
register_fprime_module() | ||
# ### UTs ### | ||
set(UT_SOURCE_FILES | ||
"\${CMAKE_CURRENT_LIST_DIR}/FPManager.fpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/test/ut/Tester.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/test/ut/TestMain.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/test/ut/ResponseExecutionRules.cpp" | ||
"\${CMAKE_CURRENT_LIST_DIR}/test/ut/TestRules.cpp" | ||
) | ||
set (UT_MOD_DEPS STest) | ||
register_fprime_ut() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* \file CommandOpcodes.hpp | ||
* \author Auto-coded | ||
* \brief Enumeration list containing command opcodes | ||
* This is generated by running the testcmd.sh script. | ||
* | ||
* | ||
* \copyright | ||
* Copyright 2009-2015, by the California Institute of Technology. | ||
* ALL RIGHTS RESERVED. United States Government Sponsorship | ||
* acknowledged. Any commercial use must be negotiated with the Office | ||
* of Technology Transfer at the California Institute of Technology. | ||
* <br /><br /> | ||
* This software may be subject to U.S. export control laws and | ||
* regulations. By accepting this document, the user agrees to comply | ||
* with all U.S. export laws and regulations. User has the | ||
* responsibility to obtain export licenses, or other export authority | ||
* as may be required before exporting such information to foreign | ||
* countries or providing access to foreign persons. | ||
*/ | ||
|
||
#ifndef __COMMAND_OPCODES_HPP_ | ||
#define __COMMAND_OPCODES_HPP_ | ||
|
||
namespace Svc { | ||
|
||
namespace OPCODES { | ||
|
||
enum Opcodes { | ||
CMD_CLEAR_TRACKING = 0x503, | ||
CMD_NO_OP = 0x500, | ||
CMD_TEST_CMD_1 = 0x502, | ||
}; | ||
|
||
} | ||
|
||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* \file CommandOpcodes.hpp | ||
* \author Auto-coded | ||
* \brief Enumeration list containing command opcodes | ||
* This is generated by running the testcmd.sh script. | ||
* | ||
* | ||
* \copyright | ||
* Copyright 2009-2015, by the California Institute of Technology. | ||
* ALL RIGHTS RESERVED. United States Government Sponsorship | ||
* acknowledged. Any commercial use must be negotiated with the Office | ||
* of Technology Transfer at the California Institute of Technology. | ||
* <br /><br /> | ||
* This software may be subject to U.S. export control laws and | ||
* regulations. By accepting this document, the user agrees to comply | ||
* with all U.S. export laws and regulations. User has the | ||
* responsibility to obtain export licenses, or other export authority | ||
* as may be required before exporting such information to foreign | ||
* countries or providing access to foreign persons. | ||
*/ | ||
|
||
#ifndef __COMMAND_OPCODES_HPP_ | ||
#define __COMMAND_OPCODES_HPP_ | ||
|
||
namespace Svc { | ||
|
||
namespace OPCODES { | ||
|
||
enum Opcodes { | ||
#for $cmd in $cmds: | ||
$cmd.command = $cmd.opcode, | ||
#end for | ||
}; | ||
|
||
} | ||
|
||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/** | ||
* \file CommandSerializer.cpp | ||
* \author Auto-coded | ||
* \brief Command Serializer implementation | ||
* This is generated by running the testcmd.sh script. | ||
* | ||
* | ||
* \copyright | ||
* Copyright 2009-2015, by the California Institute of Technology. | ||
* ALL RIGHTS RESERVED. United States Government Sponsorship | ||
* acknowledged. Any commercial use must be negotiated with the Office | ||
* of Technology Transfer at the California Institute of Technology. | ||
* <br /><br /> | ||
* This software may be subject to U.S. export control laws and | ||
* regulations. By accepting this document, the user agrees to comply | ||
* with all U.S. export laws and regulations. User has the | ||
* responsibility to obtain export licenses, or other export authority | ||
* as may be required before exporting such information to foreign | ||
* countries or providing access to foreign persons. | ||
*/ | ||
|
||
#include "CommandSerializer.hpp" | ||
#include "CommandOpcodes.hpp" | ||
#include "Fw/Com/ComPacket.hpp" | ||
|
||
namespace Svc { | ||
|
||
namespace CommandSerializer { | ||
|
||
|
||
Fw::SerializeStatus | ||
CMD_CLEAR_TRACKING( | ||
Fw::ComBuffer& comBuffer | ||
) | ||
{ | ||
Fw::SerializeStatus status; | ||
// Reset the buffer | ||
comBuffer.resetSer(); | ||
// Serialize the command packet type | ||
FwPacketDescriptorType descriptor = Fw::ComPacket::FW_PACKET_COMMAND; | ||
status = comBuffer.serialize(descriptor); | ||
// Serialize the opcode | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
FwOpcodeType opcode = OPCODES::CMD_CLEAR_TRACKING; | ||
status = comBuffer.serialize(opcode); | ||
} | ||
// Serialize arguments | ||
return status; | ||
} | ||
|
||
|
||
Fw::SerializeStatus | ||
CMD_NO_OP( | ||
Fw::ComBuffer& comBuffer | ||
) | ||
{ | ||
Fw::SerializeStatus status; | ||
// Reset the buffer | ||
comBuffer.resetSer(); | ||
// Serialize the command packet type | ||
FwPacketDescriptorType descriptor = Fw::ComPacket::FW_PACKET_COMMAND; | ||
status = comBuffer.serialize(descriptor); | ||
// Serialize the opcode | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
FwOpcodeType opcode = OPCODES::CMD_NO_OP; | ||
status = comBuffer.serialize(opcode); | ||
} | ||
// Serialize arguments | ||
return status; | ||
} | ||
|
||
|
||
Fw::SerializeStatus | ||
CMD_TEST_CMD_1( | ||
I32 arg1, | ||
F32 arg2, | ||
U8 arg3, | ||
Fw::ComBuffer& comBuffer | ||
) | ||
{ | ||
Fw::SerializeStatus status; | ||
// Reset the buffer | ||
comBuffer.resetSer(); | ||
// Serialize the command packet type | ||
FwPacketDescriptorType descriptor = Fw::ComPacket::FW_PACKET_COMMAND; | ||
status = comBuffer.serialize(descriptor); | ||
// Serialize the opcode | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
FwOpcodeType opcode = OPCODES::CMD_TEST_CMD_1; | ||
status = comBuffer.serialize(opcode); | ||
} | ||
// Serialize arguments | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
status = comBuffer.serialize(arg1); | ||
} | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
status = comBuffer.serialize(arg2); | ||
} | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
status = comBuffer.serialize(arg3); | ||
} | ||
return status; | ||
} | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* \file CommandSerializer.cpp | ||
* \author Auto-coded | ||
* \brief Command Serializer implementation | ||
* This is generated by running the testcmd.sh script. | ||
* | ||
* | ||
* \copyright | ||
* Copyright 2009-2015, by the California Institute of Technology. | ||
* ALL RIGHTS RESERVED. United States Government Sponsorship | ||
* acknowledged. Any commercial use must be negotiated with the Office | ||
* of Technology Transfer at the California Institute of Technology. | ||
* <br /><br /> | ||
* This software may be subject to U.S. export control laws and | ||
* regulations. By accepting this document, the user agrees to comply | ||
* with all U.S. export laws and regulations. User has the | ||
* responsibility to obtain export licenses, or other export authority | ||
* as may be required before exporting such information to foreign | ||
* countries or providing access to foreign persons. | ||
*/ | ||
|
||
\#include "CommandSerializer.hpp" | ||
\#include "CommandOpcodes.hpp" | ||
\#include "Fw/Com/ComPacket.hpp" | ||
|
||
namespace Svc { | ||
|
||
namespace CommandSerializer { | ||
|
||
#for $cmd in $cmds: | ||
|
||
Fw::SerializeStatus | ||
$(cmd.command)( | ||
#for $arg in $cmd.argList: | ||
$arg[1] $arg[0], | ||
#end for | ||
Fw::ComBuffer& comBuffer | ||
) | ||
{ | ||
Fw::SerializeStatus status; | ||
// Reset the buffer | ||
comBuffer.resetSer(); | ||
// Serialize the command packet type | ||
FwPacketDescriptorType descriptor = Fw::ComPacket::FW_PACKET_COMMAND; | ||
status = comBuffer.serialize(descriptor); | ||
// Serialize the opcode | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
FwOpcodeType opcode = OPCODES::$cmd.command; | ||
status = comBuffer.serialize(opcode); | ||
} | ||
// Serialize arguments | ||
#for $arg in $cmd.argList: | ||
if (status == Fw::FW_SERIALIZE_OK) { | ||
status = comBuffer.serialize($arg[0]); | ||
} | ||
#end for | ||
return status; | ||
} | ||
|
||
#end for | ||
} | ||
} | ||
|
Oops, something went wrong.