Skip to content

Commit dc4ed06

Browse files
WIP: Updated cFS template
1 parent 11a03a8 commit dc4ed06

File tree

58 files changed

+4173
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4173
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ./.cabal-sandbox/bin/ogma cfs --app-target-dir output2 \
2+
# --input-file elisa_usecase/expressions.json \
3+
# --input-format elisa_usecase/json-format.cfg \
4+
# --prop-format literal \
5+
# --variable-db elisa_usecase/db.json \
6+
# --template-vars elisa_usecase/extra-vars.json \
7+
# --app-template-dir updated_template
8+
./.cabal-sandbox/bin/ogma cfs \
9+
--app-template-dir updated_template \
10+
--app-target-dir output2 \
11+
--template-vars elisa_usecase/extra-vars.json \
12+
--input-file elisa_usecase/expressions.json \
13+
--input-format elisa_usecase/json-format.cfg \
14+
--prop-format literal \
15+
--variable-db elisa_usecase/db.json
16+
cp elisa_usecase/extra.h output2/sample_app/fsw/src/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{ "inputs":
2+
[ { "name": "input_value"
3+
, "type": "int32_t"
4+
, "connections":
5+
[ { "scope": "cfs"
6+
, "topic": "SAMPLE_MID"
7+
, "field": "payload"
8+
}
9+
]
10+
}
11+
]
12+
, "topics":
13+
[ { "scope": "cfs"
14+
, "topic": "SAMPLE_MID"
15+
, "type": "sample_msg_t"
16+
}
17+
]
18+
, "types": [
19+
{ "fromScope": "cfs"
20+
, "fromType": "sample_msg_t"
21+
, "fromField": "payload"
22+
, "toScope": "C"
23+
, "toType": "int32_t"
24+
}
25+
]
26+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"CFSExample": {
3+
"internal_variables": [],
4+
"external_variables": [
5+
{"name": "input_value", "type": "Int32", "meaning": "InputI32"}
6+
],
7+
"properties": [
8+
{
9+
"id": "TestOgma",
10+
"formula": "input_value <= 0",
11+
"text": "input_value shall always be lower than or equal to zero"
12+
}
13+
]
14+
}
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{ "app_name_lc": "sample_app"
2+
, "app_name_uc": "SAMPLE_APP"
3+
, "app_name_cc": "SampleApp"
4+
, "impl_extra_header": "#include \"extra.h\""
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#define SAMPLE_TOPIC_ID 0x1878
2+
#define SAMPLE_MID CFE_PLATFORM_CMD_TOPICID_TO_MIDV(SAMPLE_TOPIC_ID)
3+
4+
typedef struct sample_msg {
5+
CFE_MSG_CommandHeader_t CmdHeader;
6+
int32_t payload;
7+
} sample_msg_t;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
JSONFormat
2+
{ specInternalVars = Just "..internal_variables[*]"
3+
, specInternalVarId = ".name"
4+
, specInternalVarExpr = ".meaning"
5+
, specInternalVarType = Just ".type"
6+
, specExternalVars = Just "..external_variables[*]"
7+
, specExternalVarId = ".name"
8+
, specExternalVarType = Just ".type"
9+
, specRequirements = "..properties[*]"
10+
, specRequirementId = ".id"
11+
, specRequirementDesc = Just ".text"
12+
, specRequirementExpr = ".formula"
13+
, specRequirementResultType = Nothing
14+
, specRequirementResultExpr = Nothing
15+
}
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Changelog
2+
3+
## Development Build: equuleus-rc1+dev54
4+
- 'Fix #237, update sample app to reflect 582 standard'
5+
- See: <https://github.com/nasa/{{app_name_lc}}/pull/238>
6+
7+
8+
## Development Build: equuleus-rc1+dev50
9+
- Address sanitizer issue
10+
- See <https://github.com/nasa/{{app_name_lc}}/pull/235>
11+
12+
## Development Build: equuleus-rc1+dev46
13+
- Convert remaining int32 CFE status variables to CFE_Status_t
14+
- Convert syslog writes during initialization to events
15+
- See <https://github.com/nasa/{{app_name_lc}}/pull/218> and <https://github.com/nasa/{{app_name_lc}}/pull/216>
16+
17+
## Development Build: equuleus-rc4+dev40
18+
- apply name changes to EDS dispatcher
19+
- See <https://github.com/nasa/{{app_name_lc}}/pull/229>
20+
21+
## Development Build: equuleus-rc1+dev36
22+
- updating {{app_name_lc}} to use new versioning system
23+
- See <https://github.com/nasa/{{app_name_lc}}/pull/226>
24+
25+
## Development Build: v1.3.0-rc4+dev69
26+
- define msgids via topicids
27+
- See <https://github.com/nasa/{{app_name_lc}}/pull/220>
28+
29+
## Development Build: v1.3.0-rc4+dev65
30+
- bring {{app_name_lc}} fully into compliance
31+
- Rename CommandCode variable to FcnCode
32+
- Add check for success of CFE_TBL_Load() during Initialization
33+
- See <https://github.com/nasa/{{app_name_lc}}/pull/212>, <https://github.com/nasa/{{app_name_lc}}/pull/187>, and <https://github.com/nasa/{{app_name_lc}}/pull/190>
34+
35+
## Development Build: v1.3.0-rc4+dev56
36+
- Apply consistent Event ID names to common events
37+
- Remove component-specific cFE header #includes
38+
- Refactor {{app_name_uc}}_Init/Process to remove multiple returns
39+
- Add test for missing branch in {{app_name_uc}}_Process()
40+
- Zero out global data structure during initialization
41+
- Move cmds and utils into separate files
42+
- organize source files according to current patterns
43+
- See <https://github.com/nasa/{{app_name_lc}}/pull/189>, <https://github.com/nasa/{{app_name_lc}}/pull/195>, <https://github.com/nasa/{{app_name_lc}}/pull/198>, <https://github.com/nasa/{{app_name_lc}}/pull/200>, <https://github.com/nasa/{{app_name_lc}}/pull/201>, <https://github.com/nasa/{{app_name_lc}}/pull/205>, and <https://github.com/nasa/{{app_name_lc}}/pull/208>
44+
45+
## Development Build: v1.3.0-rc4+dev39
46+
- update cmake recipe
47+
- See <https://github.com/nasa/{{app_name_lc}}/pull/203>
48+
49+
## Development Build: v1.3.0-rc4+dev35
50+
- Remove redundant comments
51+
- Create CHANGELOG.md
52+
- See <https://github.com/nasa/{{app_name_lc}}/pull/185> and <https://github.com/nasa/{{app_name_lc}}/pull/183>
53+
54+
## Development Build: v1.3.0-rc4+dev27
55+
- Misaligned comments
56+
- Remove unnecessary parentheses around return values.
57+
- Remove 'return;' from last line of void functions.
58+
- See <https://github.com/nasa/{{app_name_lc}}/pull/177>, <https://github.com/nasa/{{app_name_lc}}/pull/179>, and <https://github.com/nasa/{{app_name_lc}}/pull/181>
59+
60+
## Development Build: v1.3.0-rc4+dev21
61+
- Remove registration of empty event filters
62+
- Update codeql workflow for reusable updates
63+
- See <https://github.com/nasa/cFS/pull/505>
64+
65+
## Development Build: v1.3.0-rc4+dev16
66+
- Update copyright headers
67+
- Standardize version information
68+
- See <https://github.com/nasa/{{app_name_lc}}/pull/171> and <https://github.com/nasa/cFS/pull/445>
69+
70+
## Development Build: v1.3.0-rc4+dev9
71+
- Use preferred UT patterns
72+
- Reuse CodeQL, Static Analysis, and Format Check
73+
- See <https://github.com/nasa/cFS/pull/414>
74+
75+
## Development Build: v1.3.0-rc4+dev4
76+
- Use CFE_MSG_PTR conversion macro
77+
- Update baseline for cFS-Caelum-rc4 to v1.3.0-rc4
78+
- See <https://github.com/nasa/{{app_name_lc}}/pull/163> and <https://github.com/nasa/cFS/pull/390>
79+
80+
## Development Build: v1.2.0-rc1+dev73
81+
- Apply CFE_SB_ValueToMsgId where required
82+
- See <https://github.com/nasa/{{app_name_lc}}/pull/155> and <https://github.com/nasa/cFS/pull/359>
83+
84+
## Development Build: v1.2.0-rc1+dev66
85+
- Implement Coding Standard in CodeQL workflow
86+
- See <https://github.com/nasa/{{app_name_lc}}/pull/150> and <https://github.com/nasa/cFS/pull/270>
87+
88+
## Development Build: v1.2.0-rc1+dev62
89+
- Removes app registration call, `CFE_ES_RegisterApp()` since applications do not need to register themselves.
90+
- Apply standard header guard on all header files by removing leading underscore. Convert file-scope block comments to doxygen format.
91+
- See <https://github.com/nasa/{{app_name_lc}}/pull/145>
92+
93+
## Development Build: v1.2.0-rc1+dev56
94+
- Replaces <> with " in local includes
95+
- Adds CONTRIBUTING.md that links to the main cFS contributing guide.
96+
- Adds a description for the requirements of command and telemetry Message IDs to explain why the Msg IDs have those requirements in documentation.
97+
- See <https://github.com/nasa/{{app_name_lc}}/pull/137>
98+
99+
## Development Build: v1.2.0-rc1+dev48
100+
- Simplify build to use wrappers and interface libs
101+
- Add Testing Tools to the Security Policy
102+
- See <https://github.com/nasa/{{app_name_lc}}/pull/130>
103+
104+
## Development Build: v1.2.0-rc1+dev37
105+
- Documentation: Add `Security.md` with instructions on reporting vulnerabilities
106+
- Resolves bug where success code was reported as an error for `CFE_TBL_GetAddress`.
107+
- Rename `UT_ClearForceFail` as `UT_ClearDefaultValue` given change from <https://github.com/nasa/osal/issues/724>
108+
- See <https://github.com/nasa/{{app_name_lc}}/pull/121>
109+
110+
## Development Build: v1.2.0-rc1+dev29
111+
- Aligns messages according to changes in cFE <https://github.com/nasa/cFE/issues/1009>. Uses the "raw" message cmd/tlm types in definition
112+
- See <https://github.com/nasa/{{app_name_lc}}/pull/114>
113+
114+
## Development Build: v1.2.0-rc1+dev25
115+
- Rename `UT_SetForceFail` to `UT_SetDefaultReturnValue` since some functions that retain more than 1 value are not necessarily failing
116+
- See <https://github.com/nasa/{{app_name_lc}}/pull/113>
117+
118+
## Development Build: v1.2.0-rc1+dev22
119+
- Replaces deprecated SB API's with MSG
120+
- No impact, removes undesirable pattern use of `OS_PACK`
121+
- See <https://github.com/nasa/{{app_name_lc}}/pull/108>
122+
123+
## Development Build: v1.2.0-rc1+dev18
124+
- No behavior changes. All identifiers now use the prefix `{{app_name_uc}}_`. Changes the name of the main function from SAMPLE_AppMain to {{app_name_uc}}_Main which affects the CFE startup script.
125+
- Set REVISION to "99" to indicate development version status
126+
- See <https://github.com/nasa/{{app_name_lc}}/pull/102>
127+
128+
## Development Build: v1.2.0-rc1+dev13
129+
- Unit test MID string format now 32bit
130+
- Installs unit test to target directory
131+
- Checks only format string in UT event test
132+
- See <https://github.com/nasa/{{app_name_lc}}/pull/98>
133+
134+
## Development Build: v1.2.0-rc1+dev5
135+
- Applies standard coding style.
136+
- Removes test code call of CFE_SB_InitMsg and sets the API/stub buffers directly.
137+
- See <https://github.com/nasa/{{app_name_lc}}/pull/93>
138+
139+
## Development Build: 1.1.0+dev65
140+
- Add build number and baseline to version report
141+
- Install unit test as part of cmake recipe. Sample app test runner now shows up in expected install directory
142+
- See <https://github.com/nasa/{{app_name_lc}}/pull/86>
143+
144+
## Development Build: 1.1.11
145+
- Move the table to fsw/tables and renames "sample_table" to "{{app_name_lc}}_table
146+
- See <https://github.com/nasa/{{app_name_lc}}/pull/76>
147+
148+
## Development Build: 1.1.10
149+
- Test cases now compare an expected event string with a string derived from the spec string and arguments that were output by the unit under test.
150+
- Replace references to `ccsds.h` types with the `cfe_sb.h`-provided type.
151+
- See <https://github.com/nasa/{{app_name_lc}}/pull/71>
152+
153+
## Development Build: 1.1.9
154+
- Applies the CFE_SB_MsgIdToValue() and CFE_SB_ValueToMsgId() routines where compatibility with an integer MsgId is necessary - syslog prints, events, compile-time MID #define values.
155+
- No more format conversion error in RTEMS build
156+
- See <https://github.com/nasa/{{app_name_lc}}/pull/63>
157+
158+
## Development Build: 1.1.8
159+
- Coverage data from make lcov includes the {{app_name_lc}} code
160+
- See <https://github.com/nasa/{{app_name_lc}}/pull/62>
161+
162+
## Development Build: 1.1.7
163+
- Fix bug where table is not released after being used
164+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/52>)
165+
166+
## Development Build: 1.1.6
167+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/49>)
168+
169+
## Development Build: 1.1.5
170+
- Fix to build on RASPBIAN OS
171+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/47>)
172+
173+
## Development Build: 1.1.4
174+
- Fix for a clean build with OMIT_DEPRECATED
175+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/44>)
176+
177+
## Development Build: 1.1.3
178+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/34>)
179+
180+
## Development Build: 1.1.2
181+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/20>)
182+
183+
## Development Build: 1.1.1
184+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/15>)
185+
186+
## _**OFFICIAL RELEASE: 1.1.0 - Aquila**_
187+
- Minor updates (see <https://github.com/nasa/{{app_name_lc}}/pull/11>)
188+
- Not backwards compatible with OSAL 4.2.1
189+
- Released as part of cFE 6.7.0, Apache 2.0
190+
191+
## _**OFFICIAL RELEASE: 1.0.0a**_
192+
- Released as part of cFE 6.6.0a, Apache 2.0
193+
194+
## Known issues
195+
As a sample application, extensive testing is not performed prior to release and only minimal functionality is included. Note discrepancies likely exist between this application and the example detailed in the application developer guide.
196+
197+
## Getting Help
198+
For best results, submit issues:questions or issues:help wanted requests at <https://github.com/nasa/cFS>.
199+
200+
Official cFS page: <http://cfs.gsfc.nasa.gov>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
project(CFE_{{app_name_uc}} C)
2+
3+
set(APP_SRC_FILES
4+
fsw/src/{{app_name_lc}}.c
5+
fsw/src/{{app_name_lc}}_cmds.c
6+
fsw/src/{{app_name_lc}}_utils.c
7+
fsw/src/copilot.c
8+
fsw/src/copilot.h
9+
fsw/src/copilot_types.h
10+
)
11+
12+
if (CFE_EDS_ENABLED_BUILD)
13+
list(APPEND APP_SRC_FILES
14+
fsw/src/{{app_name_lc}}_eds_dispatch.c
15+
)
16+
else()
17+
list(APPEND APP_SRC_FILES
18+
fsw/src/{{app_name_lc}}_dispatch.c
19+
)
20+
endif()
21+
22+
# Create the app module
23+
add_cfe_app({{app_name_lc}} ${APP_SRC_FILES})
24+
25+
add_custom_command(
26+
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cabal.sandbox.config
27+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/
28+
COMMAND cabal v1-sandbox init
29+
COMMAND cabal update
30+
COMMAND cabal v1-install copilot
31+
COMMENT "Installing Copilot"
32+
)
33+
34+
add_custom_command(
35+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/cabal.sandbox.config
36+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/Properties.hs
37+
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot.c
38+
${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot.h
39+
${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot_types.h
40+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/
41+
COMMAND cabal v1-exec "--" runhaskell Properties.hs
42+
COMMENT "Compiling Copilot code"
43+
)
44+
45+
add_custom_target(HASKELL_COPILOT
46+
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot.c
47+
${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot.h
48+
${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/copilot_types.h
49+
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fsw/src/Properties.hs
50+
)
51+
add_dependencies({{app_name_lc}} HASKELL_COPILOT)
52+
53+
target_include_directories({{app_name_lc}} PUBLIC fsw/inc)
54+
# Include the public API from sample_lib to demonstrate how
55+
# to call library-provided functions
56+
add_cfe_app_dependency({{app_name_lc}} sample_lib)
57+
58+
# Add table
59+
add_cfe_tables({{app_name_lc}} fsw/tables/{{app_name_lc}}_tbl.c)
60+
61+
# If UT is enabled, then add the tests from the subdirectory
62+
# Note that this is an app, and therefore does not provide
63+
# stub functions, as other entities would not typically make
64+
# direct function calls into this application.
65+
if (ENABLE_UNIT_TESTS)
66+
add_subdirectory(unit-test)
67+
endif (ENABLE_UNIT_TESTS)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contributing Guide
2+
3+
Please see our [top-level contributing guide](https://github.com/nasa/cFS/blob/main/CONTRIBUTING.md) for more information on how to contribute.

0 commit comments

Comments
 (0)