@@ -1,273 +1,273 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Jun 17 0 |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue Jun 17 09:36:20 2014 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=10 -DPRINT_MESSAGES_ON_CONSOLE |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=10 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/LFR_basic-parameters |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/LFR_basic-parameters | |
17 | LINK = sparc-rtems-g++ |
|
17 | LINK = sparc-rtems-g++ | |
18 | LFLAGS = |
|
18 | LFLAGS = | |
19 | LIBS = $(SUBLIBS) |
|
19 | LIBS = $(SUBLIBS) | |
20 | AR = sparc-rtems-ar rcs |
|
20 | AR = sparc-rtems-ar rcs | |
21 | RANLIB = |
|
21 | RANLIB = | |
22 | QMAKE = /usr/bin/qmake-qt4 |
|
22 | QMAKE = /usr/bin/qmake-qt4 | |
23 | TAR = tar -cf |
|
23 | TAR = tar -cf | |
24 | COMPRESS = gzip -9f |
|
24 | COMPRESS = gzip -9f | |
25 | COPY = cp -f |
|
25 | COPY = cp -f | |
26 | SED = sed |
|
26 | SED = sed | |
27 | COPY_FILE = $(COPY) |
|
27 | COPY_FILE = $(COPY) | |
28 | COPY_DIR = $(COPY) -r |
|
28 | COPY_DIR = $(COPY) -r | |
29 | STRIP = sparc-rtems-strip |
|
29 | STRIP = sparc-rtems-strip | |
30 | INSTALL_FILE = install -m 644 -p |
|
30 | INSTALL_FILE = install -m 644 -p | |
31 | INSTALL_DIR = $(COPY_DIR) |
|
31 | INSTALL_DIR = $(COPY_DIR) | |
32 | INSTALL_PROGRAM = install -m 755 -p |
|
32 | INSTALL_PROGRAM = install -m 755 -p | |
33 | DEL_FILE = rm -f |
|
33 | DEL_FILE = rm -f | |
34 | SYMLINK = ln -f -s |
|
34 | SYMLINK = ln -f -s | |
35 | DEL_DIR = rmdir |
|
35 | DEL_DIR = rmdir | |
36 | MOVE = mv -f |
|
36 | MOVE = mv -f | |
37 | CHK_DIR_EXISTS= test -d |
|
37 | CHK_DIR_EXISTS= test -d | |
38 | MKDIR = mkdir -p |
|
38 | MKDIR = mkdir -p | |
39 |
|
39 | |||
40 | ####### Output directory |
|
40 | ####### Output directory | |
41 |
|
41 | |||
42 | OBJECTS_DIR = obj/ |
|
42 | OBJECTS_DIR = obj/ | |
43 |
|
43 | |||
44 | ####### Files |
|
44 | ####### Files | |
45 |
|
45 | |||
46 | SOURCES = ../src/wf_handler.c \ |
|
46 | SOURCES = ../src/wf_handler.c \ | |
47 | ../src/tc_handler.c \ |
|
47 | ../src/tc_handler.c \ | |
48 | ../src/fsw_misc.c \ |
|
48 | ../src/fsw_misc.c \ | |
49 | ../src/fsw_init.c \ |
|
49 | ../src/fsw_init.c \ | |
50 | ../src/fsw_globals.c \ |
|
50 | ../src/fsw_globals.c \ | |
51 | ../src/fsw_spacewire.c \ |
|
51 | ../src/fsw_spacewire.c \ | |
52 | ../src/tc_load_dump_parameters.c \ |
|
52 | ../src/tc_load_dump_parameters.c \ | |
53 | ../src/tm_lfr_tc_exe.c \ |
|
53 | ../src/tm_lfr_tc_exe.c \ | |
54 | ../src/tc_acceptance.c \ |
|
54 | ../src/tc_acceptance.c \ | |
55 | ../src/processing/fsw_processing.c \ |
|
55 | ../src/processing/fsw_processing.c \ | |
56 | ../src/processing/avf0_prc0.c \ |
|
56 | ../src/processing/avf0_prc0.c \ | |
57 | ../src/processing/avf1_prc1.c \ |
|
57 | ../src/processing/avf1_prc1.c \ | |
58 | ../src/processing/avf2_prc2.c \ |
|
58 | ../src/processing/avf2_prc2.c \ | |
59 | ../src/lfr_cpu_usage_report.c \ |
|
59 | ../src/lfr_cpu_usage_report.c \ | |
60 | ../src/LFR_basic-parameters/basic_parameters.c |
|
60 | ../src/LFR_basic-parameters/basic_parameters.c | |
61 | OBJECTS = obj/wf_handler.o \ |
|
61 | OBJECTS = obj/wf_handler.o \ | |
62 | obj/tc_handler.o \ |
|
62 | obj/tc_handler.o \ | |
63 | obj/fsw_misc.o \ |
|
63 | obj/fsw_misc.o \ | |
64 | obj/fsw_init.o \ |
|
64 | obj/fsw_init.o \ | |
65 | obj/fsw_globals.o \ |
|
65 | obj/fsw_globals.o \ | |
66 | obj/fsw_spacewire.o \ |
|
66 | obj/fsw_spacewire.o \ | |
67 | obj/tc_load_dump_parameters.o \ |
|
67 | obj/tc_load_dump_parameters.o \ | |
68 | obj/tm_lfr_tc_exe.o \ |
|
68 | obj/tm_lfr_tc_exe.o \ | |
69 | obj/tc_acceptance.o \ |
|
69 | obj/tc_acceptance.o \ | |
70 | obj/fsw_processing.o \ |
|
70 | obj/fsw_processing.o \ | |
71 | obj/avf0_prc0.o \ |
|
71 | obj/avf0_prc0.o \ | |
72 | obj/avf1_prc1.o \ |
|
72 | obj/avf1_prc1.o \ | |
73 | obj/avf2_prc2.o \ |
|
73 | obj/avf2_prc2.o \ | |
74 | obj/lfr_cpu_usage_report.o \ |
|
74 | obj/lfr_cpu_usage_report.o \ | |
75 | obj/basic_parameters.o |
|
75 | obj/basic_parameters.o | |
76 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
76 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
77 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
77 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
78 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
78 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
79 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
79 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
80 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
80 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
81 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
81 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
82 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
82 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
83 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
83 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
84 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
84 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
85 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
85 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
86 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
86 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
87 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
87 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
88 | sparc.pri \ |
|
88 | sparc.pri \ | |
89 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
89 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
90 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
90 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
91 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
91 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
92 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
92 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
93 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
93 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
94 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
94 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
95 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
95 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
96 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
96 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
97 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
97 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
98 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
98 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
99 | fsw-qt.pro |
|
99 | fsw-qt.pro | |
100 | QMAKE_TARGET = fsw |
|
100 | QMAKE_TARGET = fsw | |
101 | DESTDIR = bin/ |
|
101 | DESTDIR = bin/ | |
102 | TARGET = bin/fsw |
|
102 | TARGET = bin/fsw | |
103 |
|
103 | |||
104 | first: all |
|
104 | first: all | |
105 | ####### Implicit rules |
|
105 | ####### Implicit rules | |
106 |
|
106 | |||
107 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
107 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
108 |
|
108 | |||
109 | .cpp.o: |
|
109 | .cpp.o: | |
110 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
110 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
111 |
|
111 | |||
112 | .cc.o: |
|
112 | .cc.o: | |
113 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
113 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
114 |
|
114 | |||
115 | .cxx.o: |
|
115 | .cxx.o: | |
116 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
116 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
117 |
|
117 | |||
118 | .C.o: |
|
118 | .C.o: | |
119 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
119 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
120 |
|
120 | |||
121 | .c.o: |
|
121 | .c.o: | |
122 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
122 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
123 |
|
123 | |||
124 | ####### Build rules |
|
124 | ####### Build rules | |
125 |
|
125 | |||
126 | all: Makefile $(TARGET) |
|
126 | all: Makefile $(TARGET) | |
127 |
|
127 | |||
128 | $(TARGET): $(OBJECTS) |
|
128 | $(TARGET): $(OBJECTS) | |
129 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
129 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ | |
130 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
|
130 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
131 |
|
131 | |||
132 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
132 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
133 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
133 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
134 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
134 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
135 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
135 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
136 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
136 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
137 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
137 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
138 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
138 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
139 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
139 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
140 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
140 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
141 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
141 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
142 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
142 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
143 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
143 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
144 | sparc.pri \ |
|
144 | sparc.pri \ | |
145 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
145 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
146 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
146 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
147 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
147 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
148 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
148 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
149 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
149 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
150 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
150 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
151 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
151 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
152 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
152 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
153 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
153 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
154 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
154 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf | |
155 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
155 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
156 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
156 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
157 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
157 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
158 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
158 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
159 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
159 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: | |
160 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
160 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: | |
161 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
161 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: | |
162 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
162 | /usr/lib64/qt4/mkspecs/qconfig.pri: | |
163 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: |
|
163 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: | |
164 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
164 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: | |
165 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
165 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: | |
166 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
166 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: | |
167 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
167 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
168 | sparc.pri: |
|
168 | sparc.pri: | |
169 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
169 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
170 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
170 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
171 | /usr/lib64/qt4/mkspecs/features/shared.prf: |
|
171 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |
172 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
172 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
173 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
173 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
174 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
174 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
175 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
175 | /usr/lib64/qt4/mkspecs/features/uic.prf: | |
176 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
176 | /usr/lib64/qt4/mkspecs/features/yacc.prf: | |
177 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
177 | /usr/lib64/qt4/mkspecs/features/lex.prf: | |
178 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
178 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: | |
179 | qmake: FORCE |
|
179 | qmake: FORCE | |
180 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
180 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
181 |
|
181 | |||
182 | dist: |
|
182 | dist: | |
183 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
183 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
184 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0 |
|
184 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0 | |
185 |
|
185 | |||
186 |
|
186 | |||
187 | clean:compiler_clean |
|
187 | clean:compiler_clean | |
188 | -$(DEL_FILE) $(OBJECTS) |
|
188 | -$(DEL_FILE) $(OBJECTS) | |
189 | -$(DEL_FILE) *~ core *.core |
|
189 | -$(DEL_FILE) *~ core *.core | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | ####### Sub-libraries |
|
192 | ####### Sub-libraries | |
193 |
|
193 | |||
194 | distclean: clean |
|
194 | distclean: clean | |
195 | -$(DEL_FILE) $(TARGET) |
|
195 | -$(DEL_FILE) $(TARGET) | |
196 | -$(DEL_FILE) Makefile |
|
196 | -$(DEL_FILE) Makefile | |
197 |
|
197 | |||
198 |
|
198 | |||
199 | grmon: |
|
199 | grmon: | |
200 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
200 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u | |
201 |
|
201 | |||
202 | check: first |
|
202 | check: first | |
203 |
|
203 | |||
204 | compiler_rcc_make_all: |
|
204 | compiler_rcc_make_all: | |
205 | compiler_rcc_clean: |
|
205 | compiler_rcc_clean: | |
206 | compiler_uic_make_all: |
|
206 | compiler_uic_make_all: | |
207 | compiler_uic_clean: |
|
207 | compiler_uic_clean: | |
208 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
208 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
209 | compiler_image_collection_clean: |
|
209 | compiler_image_collection_clean: | |
210 | -$(DEL_FILE) qmake_image_collection.cpp |
|
210 | -$(DEL_FILE) qmake_image_collection.cpp | |
211 | compiler_yacc_decl_make_all: |
|
211 | compiler_yacc_decl_make_all: | |
212 | compiler_yacc_decl_clean: |
|
212 | compiler_yacc_decl_clean: | |
213 | compiler_yacc_impl_make_all: |
|
213 | compiler_yacc_impl_make_all: | |
214 | compiler_yacc_impl_clean: |
|
214 | compiler_yacc_impl_clean: | |
215 | compiler_lex_make_all: |
|
215 | compiler_lex_make_all: | |
216 | compiler_lex_clean: |
|
216 | compiler_lex_clean: | |
217 | compiler_clean: |
|
217 | compiler_clean: | |
218 |
|
218 | |||
219 | ####### Compile |
|
219 | ####### Compile | |
220 |
|
220 | |||
221 | obj/wf_handler.o: ../src/wf_handler.c |
|
221 | obj/wf_handler.o: ../src/wf_handler.c | |
222 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
222 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c | |
223 |
|
223 | |||
224 | obj/tc_handler.o: ../src/tc_handler.c |
|
224 | obj/tc_handler.o: ../src/tc_handler.c | |
225 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
225 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c | |
226 |
|
226 | |||
227 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
227 | obj/fsw_misc.o: ../src/fsw_misc.c | |
228 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
228 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c | |
229 |
|
229 | |||
230 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c |
|
230 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c | |
231 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
231 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c | |
232 |
|
232 | |||
233 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
233 | obj/fsw_globals.o: ../src/fsw_globals.c | |
234 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
234 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
235 |
|
235 | |||
236 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c |
|
236 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c | |
237 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c |
|
237 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c | |
238 |
|
238 | |||
239 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c |
|
239 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c | |
240 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c |
|
240 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c | |
241 |
|
241 | |||
242 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c |
|
242 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c | |
243 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c |
|
243 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c | |
244 |
|
244 | |||
245 | obj/tc_acceptance.o: ../src/tc_acceptance.c |
|
245 | obj/tc_acceptance.o: ../src/tc_acceptance.c | |
246 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c |
|
246 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c | |
247 |
|
247 | |||
248 | obj/fsw_processing.o: ../src/processing/fsw_processing.c |
|
248 | obj/fsw_processing.o: ../src/processing/fsw_processing.c | |
249 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c |
|
249 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c | |
250 |
|
250 | |||
251 | obj/avf0_prc0.o: ../src/processing/avf0_prc0.c |
|
251 | obj/avf0_prc0.o: ../src/processing/avf0_prc0.c | |
252 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c |
|
252 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c | |
253 |
|
253 | |||
254 | obj/avf1_prc1.o: ../src/processing/avf1_prc1.c |
|
254 | obj/avf1_prc1.o: ../src/processing/avf1_prc1.c | |
255 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c |
|
255 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c | |
256 |
|
256 | |||
257 | obj/avf2_prc2.o: ../src/processing/avf2_prc2.c |
|
257 | obj/avf2_prc2.o: ../src/processing/avf2_prc2.c | |
258 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c |
|
258 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c | |
259 |
|
259 | |||
260 | obj/lfr_cpu_usage_report.o: ../src/lfr_cpu_usage_report.c |
|
260 | obj/lfr_cpu_usage_report.o: ../src/lfr_cpu_usage_report.c | |
261 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/lfr_cpu_usage_report.o ../src/lfr_cpu_usage_report.c |
|
261 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/lfr_cpu_usage_report.o ../src/lfr_cpu_usage_report.c | |
262 |
|
262 | |||
263 | obj/basic_parameters.o: ../src/LFR_basic-parameters/basic_parameters.c |
|
263 | obj/basic_parameters.o: ../src/LFR_basic-parameters/basic_parameters.c | |
264 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/LFR_basic-parameters/basic_parameters.c |
|
264 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/LFR_basic-parameters/basic_parameters.c | |
265 |
|
265 | |||
266 | ####### Install |
|
266 | ####### Install | |
267 |
|
267 | |||
268 | install: FORCE |
|
268 | install: FORCE | |
269 |
|
269 | |||
270 | uninstall: FORCE |
|
270 | uninstall: FORCE | |
271 |
|
271 | |||
272 | FORCE: |
|
272 | FORCE: | |
273 |
|
273 |
@@ -1,48 +1,49 | |||||
1 | #ifndef TC_LOAD_DUMP_PARAMETERS_H |
|
1 | #ifndef TC_LOAD_DUMP_PARAMETERS_H | |
2 | #define TC_LOAD_DUMP_PARAMETERS_H |
|
2 | #define TC_LOAD_DUMP_PARAMETERS_H | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <stdio.h> |
|
5 | #include <stdio.h> | |
6 |
|
6 | |||
7 | #include "fsw_params.h" |
|
7 | #include "fsw_params.h" | |
8 | #include "wf_handler.h" |
|
8 | #include "wf_handler.h" | |
9 | #include "tm_lfr_tc_exe.h" |
|
9 | #include "tm_lfr_tc_exe.h" | |
10 | #include "fsw_misc.h" |
|
10 | #include "fsw_misc.h" | |
11 |
|
11 | |||
12 | extern unsigned short sequenceCounterParameterDump; |
|
12 | extern unsigned short sequenceCounterParameterDump; | |
13 |
|
13 | |||
14 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); |
|
14 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); | |
15 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
15 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
16 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
16 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
17 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
17 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
18 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
18 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
19 | int action_dump_par(rtems_id queue_id ); |
|
19 | int action_dump_par(rtems_id queue_id ); | |
20 |
|
20 | |||
21 | // NORMAL |
|
21 | // NORMAL | |
22 |
int |
|
22 | int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
23 |
int set_sy_lfr_n_swf_ |
|
23 | int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC ); | |
24 |
int set_sy_lfr_n_ |
|
24 | int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC ); | |
25 |
int set_sy_lfr_n_ |
|
25 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC ); | |
26 |
int set_sy_lfr_n_bp_p |
|
26 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC ); | |
27 |
int set_sy_lfr_n_ |
|
27 | int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC ); | |
|
28 | int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC ); | |||
28 |
|
29 | |||
29 | // BURST |
|
30 | // BURST | |
30 |
int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC |
|
31 | int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC ); | |
31 |
int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC |
|
32 | int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC ); | |
32 |
|
33 | |||
33 | // SBM1 |
|
34 | // SBM1 | |
34 |
int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC |
|
35 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC ); | |
35 |
int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC |
|
36 | int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC ); | |
36 |
|
37 | |||
37 | // SBM2 |
|
38 | // SBM2 | |
38 |
int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC |
|
39 | int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC ); | |
39 |
int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC |
|
40 | int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC ); | |
40 |
|
41 | |||
41 | // TC_LFR_UPDATE_INFO |
|
42 | // TC_LFR_UPDATE_INFO | |
42 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ); |
|
43 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ); | |
43 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ); |
|
44 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ); | |
44 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); |
|
45 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); | |
45 |
|
46 | |||
46 | void init_parameter_dump( void ); |
|
47 | void init_parameter_dump( void ); | |
47 |
|
48 | |||
48 | #endif // TC_LOAD_DUMP_PARAMETERS_H |
|
49 | #endif // TC_LOAD_DUMP_PARAMETERS_H |
This diff has been collapsed as it changes many lines, (544 lines changed) Show them Hide them | |||||
@@ -1,881 +1,775 | |||||
1 | /** Functions to load and dump parameters in the LFR registers. |
|
1 | /** Functions to load and dump parameters in the LFR registers. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to handle TC related to parameter loading and dumping.\n |
|
6 | * A group of functions to handle TC related to parameter loading and dumping.\n | |
7 | * TC_LFR_LOAD_COMMON_PAR\n |
|
7 | * TC_LFR_LOAD_COMMON_PAR\n | |
8 | * TC_LFR_LOAD_NORMAL_PAR\n |
|
8 | * TC_LFR_LOAD_NORMAL_PAR\n | |
9 | * TC_LFR_LOAD_BURST_PAR\n |
|
9 | * TC_LFR_LOAD_BURST_PAR\n | |
10 | * TC_LFR_LOAD_SBM1_PAR\n |
|
10 | * TC_LFR_LOAD_SBM1_PAR\n | |
11 | * TC_LFR_LOAD_SBM2_PAR\n |
|
11 | * TC_LFR_LOAD_SBM2_PAR\n | |
12 | * |
|
12 | * | |
13 | */ |
|
13 | */ | |
14 |
|
14 | |||
15 | #include "tc_load_dump_parameters.h" |
|
15 | #include "tc_load_dump_parameters.h" | |
16 |
|
16 | |||
17 | int action_load_common_par(ccsdsTelecommandPacket_t *TC) |
|
17 | int action_load_common_par(ccsdsTelecommandPacket_t *TC) | |
18 | { |
|
18 | { | |
19 | /** This function updates the LFR registers with the incoming common parameters. |
|
19 | /** This function updates the LFR registers with the incoming common parameters. | |
20 | * |
|
20 | * | |
21 | * @param TC points to the TeleCommand packet that is being processed |
|
21 | * @param TC points to the TeleCommand packet that is being processed | |
22 | * |
|
22 | * | |
23 | * |
|
23 | * | |
24 | */ |
|
24 | */ | |
25 |
|
25 | |||
26 | parameter_dump_packet.unused0 = TC->dataAndCRC[0]; |
|
26 | parameter_dump_packet.unused0 = TC->dataAndCRC[0]; | |
27 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = TC->dataAndCRC[1]; |
|
27 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = TC->dataAndCRC[1]; | |
28 | set_wfp_data_shaping( ); |
|
28 | set_wfp_data_shaping( ); | |
29 | return LFR_SUCCESSFUL; |
|
29 | return LFR_SUCCESSFUL; | |
30 | } |
|
30 | } | |
31 |
|
31 | |||
32 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
32 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
33 | { |
|
33 | { | |
34 | /** This function updates the LFR registers with the incoming normal parameters. |
|
34 | /** This function updates the LFR registers with the incoming normal parameters. | |
35 | * |
|
35 | * | |
36 | * @param TC points to the TeleCommand packet that is being processed |
|
36 | * @param TC points to the TeleCommand packet that is being processed | |
37 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
37 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
38 | * |
|
38 | * | |
39 | */ |
|
39 | */ | |
40 |
|
40 | |||
41 | int result; |
|
41 | int result; | |
42 | int flag; |
|
42 | int flag; | |
43 | rtems_status_code status; |
|
43 | rtems_status_code status; | |
44 | unsigned char sy_lfr_n_bp_p0; |
|
|||
45 | unsigned char sy_lfr_n_bp_p1; |
|
|||
46 | unsigned int sy_lfr_n_asm_p; |
|
|||
47 | float aux; |
|
|||
48 |
|
44 | |||
49 | flag = LFR_SUCCESSFUL; |
|
45 | flag = LFR_SUCCESSFUL; | |
50 |
|
46 | |||
51 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) || |
|
47 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) || | |
52 | (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) { |
|
48 | (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) { | |
53 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
49 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
54 | flag = LFR_DEFAULT; |
|
50 | flag = LFR_DEFAULT; | |
55 | } |
|
51 | } | |
56 |
|
52 | |||
57 | //*************** |
|
53 | // CHECK THE PARAMETERS SET CONSISTENCY | |
58 | // sy_lfr_n_swf_l |
|
|||
59 | if (flag == LFR_SUCCESSFUL) |
|
|||
60 | { |
|
|||
61 | result = set_sy_lfr_n_swf_l( TC, queue_id, time ); |
|
|||
62 | if (result != LFR_SUCCESSFUL) |
|
|||
63 | { |
|
|||
64 | flag = LFR_DEFAULT; |
|
|||
65 | } |
|
|||
66 | } |
|
|||
67 |
|
||||
68 | //*************** |
|
|||
69 | // sy_lfr_n_swf_p |
|
|||
70 | if (flag == LFR_SUCCESSFUL) |
|
|||
71 | { |
|
|||
72 | result = set_sy_lfr_n_swf_p( TC, queue_id, time ); |
|
|||
73 | if (result != LFR_SUCCESSFUL) |
|
|||
74 | { |
|
|||
75 | flag = LFR_DEFAULT; |
|
|||
76 | } |
|
|||
77 | } |
|
|||
78 |
|
||||
79 | //**************************************************************** |
|
|||
80 | // check the consistency between sy_lfr_n_bp_p0 and sy_lfr_n_bp_p1 |
|
|||
81 | if (flag == LFR_SUCCESSFUL) |
|
|||
82 | { |
|
|||
83 | sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ]; |
|
|||
84 | sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ]; |
|
|||
85 | aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0); |
|
|||
86 | if (aux != 0) |
|
|||
87 | { |
|
|||
88 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, sy_lfr_n_bp_p0 ); |
|
|||
89 | flag = LFR_DEFAULT; |
|
|||
90 | } |
|
|||
91 | } |
|
|||
92 |
|
||||
93 | //*************** |
|
|||
94 | // sy_lfr_n_bp_p0 |
|
|||
95 | if (flag == LFR_SUCCESSFUL) |
|
|||
96 | { |
|
|||
97 | result = set_sy_lfr_n_bp_p0( TC, queue_id ); |
|
|||
98 | if (result != LFR_SUCCESSFUL) |
|
|||
99 | { |
|
|||
100 | flag = LFR_DEFAULT; |
|
|||
101 | } |
|
|||
102 | } |
|
|||
103 |
|
||||
104 | //**************************************************************** |
|
|||
105 | // check the consistency between sy_lfr_n_bp_p0 and sy_lfr_n_bp_p1 |
|
|||
106 | if (flag == LFR_SUCCESSFUL) |
|
54 | if (flag == LFR_SUCCESSFUL) | |
107 | { |
|
55 | { | |
108 | sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ]; |
|
56 | flag = check_common_par_consistency( TC, queue_id ); | |
109 | sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ]; |
|
|||
110 | aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0); |
|
|||
111 | if (aux != 0) |
|
|||
112 | { |
|
|||
113 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 ); |
|
|||
114 | flag = LFR_DEFAULT; |
|
|||
115 | } |
|
|||
116 | } |
|
57 | } | |
117 |
|
58 | |||
118 | //*************** |
|
59 | // SET THE PARAMETERS IF THEY ARE CONSISTENT | |
119 | // sy_lfr_n_bp_p1 |
|
|||
120 | if (flag == LFR_SUCCESSFUL) |
|
|||
121 | { |
|
|||
122 | result = set_sy_lfr_n_bp_p1( TC, queue_id ); |
|
|||
123 | if (result != LFR_SUCCESSFUL) |
|
|||
124 | { |
|
|||
125 | flag = LFR_DEFAULT; |
|
|||
126 | } |
|
|||
127 | } |
|
|||
128 |
|
||||
129 | //**************************************************************** |
|
|||
130 | // check the consistency between sy_lfr_n_asm_p and sy_lfr_n_bp_p0 |
|
|||
131 | if (flag == LFR_SUCCESSFUL) |
|
60 | if (flag == LFR_SUCCESSFUL) | |
132 | { |
|
61 | { | |
133 | sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ]; |
|
62 | result = set_sy_lfr_n_swf_l( TC ); | |
134 |
|
|
63 | result = set_sy_lfr_n_swf_p( TC ); | |
135 | TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ] * 256 |
|
64 | result = set_sy_lfr_n_bp_p0( TC ); | |
136 | + TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P + 1 ]; |
|
65 | result = set_sy_lfr_n_bp_p1( TC ); | |
137 | aux = ( (float ) sy_lfr_n_asm_p / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_asm_p / sy_lfr_n_bp_p0); |
|
66 | result = set_sy_lfr_n_asm_p( TC ); | |
138 | if (aux != 0) |
|
67 | result = set_sy_lfr_n_cwf_long_f3( TC ); | |
139 | { |
|
|||
140 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p ); |
|
|||
141 | flag = LFR_DEFAULT; |
|
|||
142 | } |
|
|||
143 | } |
|
|||
144 |
|
||||
145 | //*************** |
|
|||
146 | // sy_lfr_n_asm_p |
|
|||
147 | if (flag == LFR_SUCCESSFUL) |
|
|||
148 | { |
|
|||
149 | result = set_sy_lfr_n_asm_p( TC, queue_id ); |
|
|||
150 | if (result != LFR_SUCCESSFUL) |
|
|||
151 | { |
|
|||
152 | flag = LFR_DEFAULT; |
|
|||
153 | } |
|
|||
154 | } |
|
|||
155 |
|
||||
156 | //********************* |
|
|||
157 | // sy_lfr_n_cwf_long_f3 |
|
|||
158 | if (flag == LFR_SUCCESSFUL) |
|
|||
159 | { |
|
|||
160 | result = set_sy_lfr_n_cwf_long_f3( TC, queue_id ); |
|
|||
161 | if (result != LFR_SUCCESSFUL) |
|
|||
162 | { |
|
|||
163 | flag = LFR_DEFAULT; |
|
|||
164 | } |
|
|||
165 | } |
|
68 | } | |
166 |
|
69 | |||
167 | return flag; |
|
70 | return flag; | |
168 | } |
|
71 | } | |
169 |
|
72 | |||
170 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
73 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
171 | { |
|
74 | { | |
172 | /** This function updates the LFR registers with the incoming burst parameters. |
|
75 | /** This function updates the LFR registers with the incoming burst parameters. | |
173 | * |
|
76 | * | |
174 | * @param TC points to the TeleCommand packet that is being processed |
|
77 | * @param TC points to the TeleCommand packet that is being processed | |
175 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
78 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
176 | * |
|
79 | * | |
177 | */ |
|
80 | */ | |
178 |
|
81 | |||
179 | int result; |
|
82 | int result; | |
180 | int flag; |
|
83 | int flag; | |
181 | rtems_status_code status; |
|
84 | rtems_status_code status; | |
182 | unsigned char sy_lfr_b_bp_p0; |
|
85 | unsigned char sy_lfr_b_bp_p0; | |
183 | unsigned char sy_lfr_b_bp_p1; |
|
86 | unsigned char sy_lfr_b_bp_p1; | |
184 | float aux; |
|
87 | float aux; | |
185 |
|
88 | |||
186 | flag = LFR_SUCCESSFUL; |
|
89 | flag = LFR_SUCCESSFUL; | |
187 |
|
90 | |||
188 | if ( lfrCurrentMode == LFR_MODE_BURST ) { |
|
91 | if ( lfrCurrentMode == LFR_MODE_BURST ) { | |
189 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
92 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
190 | result = LFR_DEFAULT; |
|
93 | result = LFR_DEFAULT; | |
191 | } |
|
94 | } | |
192 |
|
95 | |||
|
96 | sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ]; | |||
|
97 | sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ]; | |||
|
98 | ||||
|
99 | // sy_lfr_b_bp_p0 | |||
|
100 | if (flag == LFR_SUCCESSFUL) | |||
|
101 | { | |||
|
102 | if (sy_lfr_b_bp_p0 < DEFAULT_SY_LFR_B_BP_P0 ) | |||
|
103 | { | |||
|
104 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, sy_lfr_b_bp_p0 ); | |||
|
105 | flag = WRONG_APP_DATA; | |||
|
106 | } | |||
|
107 | } | |||
|
108 | // sy_lfr_b_bp_p1 | |||
|
109 | if (flag == LFR_SUCCESSFUL) | |||
|
110 | { | |||
|
111 | if (sy_lfr_b_bp_p1 < DEFAULT_SY_LFR_B_BP_P1 ) | |||
|
112 | { | |||
|
113 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P1+10, sy_lfr_b_bp_p1 ); | |||
|
114 | flag = WRONG_APP_DATA; | |||
|
115 | } | |||
|
116 | } | |||
193 | //**************************************************************** |
|
117 | //**************************************************************** | |
194 | // check the consistency between sy_lfr_b_bp_p0 and sy_lfr_b_bp_p1 |
|
118 | // check the consistency between sy_lfr_b_bp_p0 and sy_lfr_b_bp_p1 | |
195 | if (flag == LFR_SUCCESSFUL) |
|
119 | if (flag == LFR_SUCCESSFUL) | |
196 | { |
|
120 | { | |
197 | sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ]; |
|
121 | sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ]; | |
198 | sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ]; |
|
122 | sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ]; | |
199 | aux = ( (float ) sy_lfr_b_bp_p1 / sy_lfr_b_bp_p0 ) - floor(sy_lfr_b_bp_p1 / sy_lfr_b_bp_p0); |
|
123 | aux = ( (float ) sy_lfr_b_bp_p1 / sy_lfr_b_bp_p0 ) - floor(sy_lfr_b_bp_p1 / sy_lfr_b_bp_p0); | |
200 | if (aux != 0) |
|
124 | if (aux != 0) | |
201 | { |
|
125 | { | |
202 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, sy_lfr_b_bp_p0 ); |
|
126 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, sy_lfr_b_bp_p0 ); | |
203 | flag = LFR_DEFAULT; |
|
127 | flag = LFR_DEFAULT; | |
204 | } |
|
128 | } | |
205 | } |
|
129 | } | |
206 |
|
130 | |||
207 | //*************** |
|
131 | // SET HTE PARAMETERS | |
208 | // sy_lfr_b_bp_p0 |
|
|||
209 | if (flag == LFR_SUCCESSFUL) |
|
132 | if (flag == LFR_SUCCESSFUL) | |
210 | { |
|
133 | { | |
211 |
result = set_sy_lfr_b_bp_p0( TC |
|
134 | result = set_sy_lfr_b_bp_p0( TC ); | |
212 | if (result != LFR_SUCCESSFUL) |
|
135 | result = set_sy_lfr_b_bp_p1( TC ); | |
213 | { |
|
|||
214 | flag = LFR_DEFAULT; |
|
|||
215 | } |
|
|||
216 | } |
|
|||
217 |
|
||||
218 | //*************** |
|
|||
219 | // sy_lfr_b_bp_p1 |
|
|||
220 | if (flag == LFR_SUCCESSFUL) |
|
|||
221 | { |
|
|||
222 | result = set_sy_lfr_b_bp_p1( TC, queue_id ); |
|
|||
223 | if (result != LFR_SUCCESSFUL) |
|
|||
224 | { |
|
|||
225 | flag = LFR_DEFAULT; |
|
|||
226 | } |
|
|||
227 | } |
|
136 | } | |
228 |
|
137 | |||
229 | return flag; |
|
138 | return flag; | |
230 | } |
|
139 | } | |
231 |
|
140 | |||
232 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
141 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
233 | { |
|
142 | { | |
234 | /** This function updates the LFR registers with the incoming sbm1 parameters. |
|
143 | /** This function updates the LFR registers with the incoming sbm1 parameters. | |
235 | * |
|
144 | * | |
236 | * @param TC points to the TeleCommand packet that is being processed |
|
145 | * @param TC points to the TeleCommand packet that is being processed | |
237 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
146 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
238 | * |
|
147 | * | |
239 | */ |
|
148 | */ | |
240 |
|
149 | |||
241 | int result; |
|
150 | int result; | |
242 | int flag; |
|
151 | int flag; | |
243 | rtems_status_code status; |
|
152 | rtems_status_code status; | |
244 | unsigned char sy_lfr_s1_bp_p0; |
|
153 | unsigned char sy_lfr_s1_bp_p0; | |
245 | unsigned char sy_lfr_s1_bp_p1; |
|
154 | unsigned char sy_lfr_s1_bp_p1; | |
246 | float aux; |
|
155 | float aux; | |
247 |
|
156 | |||
248 | flag = LFR_SUCCESSFUL; |
|
157 | flag = LFR_SUCCESSFUL; | |
249 |
|
158 | |||
250 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { |
|
159 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { | |
251 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
160 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
252 | result = LFR_DEFAULT; |
|
161 | result = LFR_DEFAULT; | |
253 | } |
|
162 | } | |
254 |
|
163 | |||
|
164 | sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ]; | |||
|
165 | sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ]; | |||
|
166 | ||||
|
167 | // sy_lfr_s1_bp_p0 | |||
|
168 | if (flag == LFR_SUCCESSFUL) | |||
|
169 | { | |||
|
170 | if (sy_lfr_s1_bp_p0 < DEFAULT_SY_LFR_S1_BP_P0 ) | |||
|
171 | { | |||
|
172 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, sy_lfr_s1_bp_p0 ); | |||
|
173 | flag = WRONG_APP_DATA; | |||
|
174 | } | |||
|
175 | } | |||
|
176 | // sy_lfr_s1_bp_p1 | |||
|
177 | if (flag == LFR_SUCCESSFUL) | |||
|
178 | { | |||
|
179 | if (sy_lfr_s1_bp_p1 < DEFAULT_SY_LFR_S1_BP_P1 ) | |||
|
180 | { | |||
|
181 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P1+10, sy_lfr_s1_bp_p1 ); | |||
|
182 | flag = WRONG_APP_DATA; | |||
|
183 | } | |||
|
184 | } | |||
255 | //****************************************************************** |
|
185 | //****************************************************************** | |
256 | // check the consistency between sy_lfr_s1_bp_p0 and sy_lfr_s1_bp_p1 |
|
186 | // check the consistency between sy_lfr_s1_bp_p0 and sy_lfr_s1_bp_p1 | |
257 | if (flag == LFR_SUCCESSFUL) |
|
187 | if (flag == LFR_SUCCESSFUL) | |
258 | { |
|
188 | { | |
259 | sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ]; |
|
|||
260 | sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ]; |
|
|||
261 | aux = ( (float ) sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25) ) - floor(sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25)); |
|
189 | aux = ( (float ) sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25) ) - floor(sy_lfr_s1_bp_p1 / (sy_lfr_s1_bp_p0*0.25)); | |
262 | if (aux != 0) |
|
190 | if (aux != 0) | |
263 | { |
|
191 | { | |
264 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, sy_lfr_s1_bp_p0 ); |
|
192 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, sy_lfr_s1_bp_p0 ); | |
265 | flag = LFR_DEFAULT; |
|
193 | flag = LFR_DEFAULT; | |
266 | } |
|
194 | } | |
267 | } |
|
195 | } | |
268 |
|
196 | |||
269 | //*************** |
|
197 | // SET THE PARAMETERS | |
270 | // sy_lfr_s1_bp_p0 |
|
|||
271 | if (flag == LFR_SUCCESSFUL) |
|
198 | if (flag == LFR_SUCCESSFUL) | |
272 | { |
|
199 | { | |
273 |
result = set_sy_lfr_s1_bp_p0( TC |
|
200 | result = set_sy_lfr_s1_bp_p0( TC ); | |
274 | if (result != LFR_SUCCESSFUL) |
|
201 | result = set_sy_lfr_s1_bp_p1( TC ); | |
275 | { |
|
|||
276 | flag = LFR_DEFAULT; |
|
|||
277 | } |
|
|||
278 | } |
|
|||
279 |
|
||||
280 | //*************** |
|
|||
281 | // sy_lfr_s1_bp_p1 |
|
|||
282 | if (flag == LFR_SUCCESSFUL) |
|
|||
283 | { |
|
|||
284 | result = set_sy_lfr_s1_bp_p1( TC, queue_id ); |
|
|||
285 | if (result != LFR_SUCCESSFUL) |
|
|||
286 | { |
|
|||
287 | flag = LFR_DEFAULT; |
|
|||
288 | } |
|
|||
289 | } |
|
202 | } | |
290 |
|
203 | |||
291 | return flag; |
|
204 | return flag; | |
292 | } |
|
205 | } | |
293 |
|
206 | |||
294 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
207 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
295 | { |
|
208 | { | |
296 | /** This function updates the LFR registers with the incoming sbm2 parameters. |
|
209 | /** This function updates the LFR registers with the incoming sbm2 parameters. | |
297 | * |
|
210 | * | |
298 | * @param TC points to the TeleCommand packet that is being processed |
|
211 | * @param TC points to the TeleCommand packet that is being processed | |
299 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
212 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
300 | * |
|
213 | * | |
301 | */ |
|
214 | */ | |
302 |
|
215 | |||
303 | int result; |
|
216 | int result; | |
304 | int flag; |
|
217 | int flag; | |
305 | rtems_status_code status; |
|
218 | rtems_status_code status; | |
306 | unsigned char sy_lfr_s2_bp_p0; |
|
219 | unsigned char sy_lfr_s2_bp_p0; | |
307 | unsigned char sy_lfr_s2_bp_p1; |
|
220 | unsigned char sy_lfr_s2_bp_p1; | |
308 | float aux; |
|
221 | float aux; | |
309 |
|
222 | |||
310 | flag = LFR_SUCCESSFUL; |
|
223 | flag = LFR_SUCCESSFUL; | |
311 |
|
224 | |||
312 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { |
|
225 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { | |
313 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
226 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
314 | result = LFR_DEFAULT; |
|
227 | result = LFR_DEFAULT; | |
315 | } |
|
228 | } | |
316 |
|
229 | |||
|
230 | sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ]; | |||
|
231 | sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ]; | |||
|
232 | ||||
|
233 | // sy_lfr_s2_bp_p0 | |||
|
234 | if (flag == LFR_SUCCESSFUL) | |||
|
235 | { | |||
|
236 | if (sy_lfr_s2_bp_p0 < DEFAULT_SY_LFR_S2_BP_P0 ) | |||
|
237 | { | |||
|
238 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, sy_lfr_s2_bp_p0 ); | |||
|
239 | flag = WRONG_APP_DATA; | |||
|
240 | } | |||
|
241 | } | |||
|
242 | // sy_lfr_s2_bp_p1 | |||
|
243 | if (flag == LFR_SUCCESSFUL) | |||
|
244 | { | |||
|
245 | if (sy_lfr_s2_bp_p1 < DEFAULT_SY_LFR_S2_BP_P1 ) | |||
|
246 | { | |||
|
247 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P1+10, sy_lfr_s2_bp_p1 ); | |||
|
248 | flag = WRONG_APP_DATA; | |||
|
249 | } | |||
|
250 | } | |||
317 | //****************************************************************** |
|
251 | //****************************************************************** | |
318 | // check the consistency between sy_lfr_s2_bp_p0 and sy_lfr_s2_bp_p1 |
|
252 | // check the consistency between sy_lfr_s2_bp_p0 and sy_lfr_s2_bp_p1 | |
319 | if (flag == LFR_SUCCESSFUL) |
|
253 | if (flag == LFR_SUCCESSFUL) | |
320 | { |
|
254 | { | |
321 | sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ]; |
|
255 | sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ]; | |
322 | sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ]; |
|
256 | sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ]; | |
323 | aux = ( (float ) sy_lfr_s2_bp_p1 / sy_lfr_s2_bp_p0 ) - floor(sy_lfr_s2_bp_p1 / sy_lfr_s2_bp_p0); |
|
257 | aux = ( (float ) sy_lfr_s2_bp_p1 / sy_lfr_s2_bp_p0 ) - floor(sy_lfr_s2_bp_p1 / sy_lfr_s2_bp_p0); | |
324 | if (aux != 0) |
|
258 | if (aux != 0) | |
325 | { |
|
259 | { | |
326 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, sy_lfr_s2_bp_p0 ); |
|
260 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, sy_lfr_s2_bp_p0 ); | |
327 | flag = LFR_DEFAULT; |
|
261 | flag = LFR_DEFAULT; | |
328 | } |
|
262 | } | |
329 | } |
|
263 | } | |
330 |
|
264 | |||
331 | //*************** |
|
265 | // SET THE PARAMETERS | |
332 | // sy_lfr_s2_bp_p0 |
|
|||
333 | if (flag == LFR_SUCCESSFUL) |
|
266 | if (flag == LFR_SUCCESSFUL) | |
334 | { |
|
267 | { | |
335 |
result = set_sy_lfr_s2_bp_p0( TC |
|
268 | result = set_sy_lfr_s2_bp_p0( TC ); | |
336 | if (result != LFR_SUCCESSFUL) |
|
269 | result = set_sy_lfr_s2_bp_p1( TC ); | |
337 | { |
|
|||
338 | flag = LFR_DEFAULT; |
|
|||
339 | } |
|
|||
340 | } |
|
|||
341 |
|
||||
342 | //*************** |
|
|||
343 | // sy_lfr_s2_bp_p1 |
|
|||
344 | if (flag == LFR_SUCCESSFUL) |
|
|||
345 | { |
|
|||
346 | result = set_sy_lfr_s2_bp_p1( TC, queue_id ); |
|
|||
347 | if (result != LFR_SUCCESSFUL) |
|
|||
348 | { |
|
|||
349 | flag = LFR_DEFAULT; |
|
|||
350 | } |
|
|||
351 | } |
|
270 | } | |
352 |
|
271 | |||
353 | return flag; |
|
272 | return flag; | |
354 | } |
|
273 | } | |
355 |
|
274 | |||
356 | int action_dump_par( rtems_id queue_id ) |
|
275 | int action_dump_par( rtems_id queue_id ) | |
357 | { |
|
276 | { | |
358 | /** This function dumps the LFR parameters by sending the appropriate TM packet to the dedicated RTEMS message queue. |
|
277 | /** This function dumps the LFR parameters by sending the appropriate TM packet to the dedicated RTEMS message queue. | |
359 | * |
|
278 | * | |
360 | * @param queue_id is the id of the queue which handles TM related to this execution step. |
|
279 | * @param queue_id is the id of the queue which handles TM related to this execution step. | |
361 | * |
|
280 | * | |
362 | * @return RTEMS directive status codes: |
|
281 | * @return RTEMS directive status codes: | |
363 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
282 | * - RTEMS_SUCCESSFUL - message sent successfully | |
364 | * - RTEMS_INVALID_ID - invalid queue id |
|
283 | * - RTEMS_INVALID_ID - invalid queue id | |
365 | * - RTEMS_INVALID_SIZE - invalid message size |
|
284 | * - RTEMS_INVALID_SIZE - invalid message size | |
366 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
285 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
367 | * - RTEMS_UNSATISFIED - out of message buffers |
|
286 | * - RTEMS_UNSATISFIED - out of message buffers | |
368 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
287 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
369 | * |
|
288 | * | |
370 | */ |
|
289 | */ | |
371 |
|
290 | |||
372 | int status; |
|
291 | int status; | |
373 |
|
292 | |||
374 | // UPDATE TIME |
|
293 | // UPDATE TIME | |
375 | parameter_dump_packet.packetSequenceControl[0] = (unsigned char) sequenceCounterParameterDump >> 8; |
|
294 | parameter_dump_packet.packetSequenceControl[0] = (unsigned char) sequenceCounterParameterDump >> 8; | |
376 | parameter_dump_packet.packetSequenceControl[1] = (unsigned char) sequenceCounterParameterDump; |
|
295 | parameter_dump_packet.packetSequenceControl[1] = (unsigned char) sequenceCounterParameterDump; | |
377 | increment_seq_counter( &sequenceCounterParameterDump ); |
|
296 | increment_seq_counter( &sequenceCounterParameterDump ); | |
378 |
|
297 | |||
379 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
298 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
380 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
299 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
381 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
300 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
382 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
301 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
383 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
302 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
384 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
303 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); | |
385 | // SEND DATA |
|
304 | // SEND DATA | |
386 | status = rtems_message_queue_send( queue_id, ¶meter_dump_packet, |
|
305 | status = rtems_message_queue_send( queue_id, ¶meter_dump_packet, | |
387 | PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
|
306 | PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); | |
388 | if (status != RTEMS_SUCCESSFUL) { |
|
307 | if (status != RTEMS_SUCCESSFUL) { | |
389 | PRINTF1("in action_dump *** ERR sending packet, code %d", status) |
|
308 | PRINTF1("in action_dump *** ERR sending packet, code %d", status) | |
390 | } |
|
309 | } | |
391 |
|
310 | |||
392 | return status; |
|
311 | return status; | |
393 | } |
|
312 | } | |
394 |
|
313 | |||
395 | //*********************** |
|
314 | //*********************** | |
396 | // NORMAL MODE PARAMETERS |
|
315 | // NORMAL MODE PARAMETERS | |
397 |
|
316 | |||
398 |
int |
|
317 | int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
|
318 | { | |||
|
319 | unsigned char msb; | |||
|
320 | unsigned char lsb; | |||
|
321 | int flag; | |||
|
322 | float aux; | |||
|
323 | rtems_status_code status; | |||
|
324 | ||||
|
325 | unsigned int sy_lfr_n_swf_l; | |||
|
326 | unsigned int sy_lfr_n_swf_p; | |||
|
327 | unsigned int sy_lfr_n_asm_p; | |||
|
328 | unsigned char sy_lfr_n_bp_p0; | |||
|
329 | unsigned char sy_lfr_n_bp_p1; | |||
|
330 | unsigned char sy_lfr_n_cwf_long_f3; | |||
|
331 | ||||
|
332 | flag = LFR_SUCCESSFUL; | |||
|
333 | ||||
|
334 | //*************** | |||
|
335 | // get parameters | |||
|
336 | msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ]; | |||
|
337 | lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ]; | |||
|
338 | sy_lfr_n_swf_l = msb * 256 + lsb; | |||
|
339 | ||||
|
340 | msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ]; | |||
|
341 | lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ]; | |||
|
342 | sy_lfr_n_swf_p = msb * 256 + lsb; | |||
|
343 | ||||
|
344 | msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ]; | |||
|
345 | lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P+1 ]; | |||
|
346 | sy_lfr_n_asm_p = msb * 256 + lsb; | |||
|
347 | ||||
|
348 | sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ]; | |||
|
349 | ||||
|
350 | sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ]; | |||
|
351 | ||||
|
352 | sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 ]; | |||
|
353 | ||||
|
354 | //****************** | |||
|
355 | // check consistency | |||
|
356 | // sy_lfr_n_swf_l | |||
|
357 | if (sy_lfr_n_swf_l != 2048) | |||
|
358 | { | |||
|
359 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_L+10, lsb ); | |||
|
360 | flag = WRONG_APP_DATA; | |||
|
361 | } | |||
|
362 | // sy_lfr_n_swf_p | |||
|
363 | if (flag == LFR_SUCCESSFUL) | |||
|
364 | { | |||
|
365 | if ( sy_lfr_n_swf_p < 16 ) | |||
|
366 | { | |||
|
367 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_P+10, lsb ); | |||
|
368 | flag = WRONG_APP_DATA; | |||
|
369 | } | |||
|
370 | } | |||
|
371 | // sy_lfr_n_bp_p0 | |||
|
372 | if (flag == LFR_SUCCESSFUL) | |||
|
373 | { | |||
|
374 | if (sy_lfr_n_bp_p0 < SY_LFR_N_BP_P0) | |||
|
375 | { | |||
|
376 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, sy_lfr_n_bp_p0 ); | |||
|
377 | flag = WRONG_APP_DATA; | |||
|
378 | } | |||
|
379 | } | |||
|
380 | // sy_lfr_n_asm_p | |||
|
381 | if (flag == LFR_SUCCESSFUL) | |||
|
382 | { | |||
|
383 | if (sy_lfr_n_asm_p == 0) | |||
|
384 | { | |||
|
385 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p ); | |||
|
386 | flag = WRONG_APP_DATA; | |||
|
387 | } | |||
|
388 | } | |||
|
389 | // sy_lfr_n_asm_p shall be a whole multiple of sy_lfr_n_bp_p0 | |||
|
390 | if (flag == LFR_SUCCESSFUL) | |||
|
391 | { | |||
|
392 | aux = ( (float ) sy_lfr_n_asm_p / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_asm_p / sy_lfr_n_bp_p0); | |||
|
393 | if (aux != 0) | |||
|
394 | { | |||
|
395 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_ASM_P+10, sy_lfr_n_asm_p ); | |||
|
396 | flag = WRONG_APP_DATA; | |||
|
397 | } | |||
|
398 | } | |||
|
399 | // sy_lfr_n_bp_p1 | |||
|
400 | if (flag == LFR_SUCCESSFUL) | |||
|
401 | { | |||
|
402 | if (sy_lfr_n_bp_p1 < SY_LFR_N_BP_P1) | |||
|
403 | { | |||
|
404 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 ); | |||
|
405 | flag = WRONG_APP_DATA; | |||
|
406 | } | |||
|
407 | } | |||
|
408 | // sy_lfr_n_bp_p1 shall be a whole multiple of sy_lfr_n_bp_p0 | |||
|
409 | if (flag == LFR_SUCCESSFUL) | |||
|
410 | { | |||
|
411 | aux = ( (float ) sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0 ) - floor(sy_lfr_n_bp_p1 / sy_lfr_n_bp_p0); | |||
|
412 | if (aux != 0) | |||
|
413 | { | |||
|
414 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, sy_lfr_n_bp_p1 ); | |||
|
415 | flag = LFR_DEFAULT; | |||
|
416 | } | |||
|
417 | } | |||
|
418 | // sy_lfr_n_cwf_long_f3 | |||
|
419 | ||||
|
420 | return flag; | |||
|
421 | } | |||
|
422 | ||||
|
423 | int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC ) | |||
399 | { |
|
424 | { | |
400 | /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l). |
|
425 | /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l). | |
401 | * |
|
426 | * | |
402 | * @param TC points to the TeleCommand packet that is being processed |
|
427 | * @param TC points to the TeleCommand packet that is being processed | |
403 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
428 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
404 | * |
|
429 | * | |
405 | */ |
|
430 | */ | |
406 |
|
431 | |||
407 | unsigned int tmp; |
|
|||
408 | int result; |
|
432 | int result; | |
409 | unsigned char msb; |
|
|||
410 | unsigned char lsb; |
|
|||
411 | rtems_status_code status; |
|
|||
412 |
|
||||
413 | msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ]; |
|
|||
414 | lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ]; |
|
|||
415 |
|
||||
416 | tmp = ( unsigned int ) floor( |
|
|||
417 | ( ( msb*256 ) + lsb ) / 16 |
|
|||
418 | ) * 16; |
|
|||
419 |
|
433 | |||
420 | if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16 |
|
434 | result = LFR_SUCCESSFUL; | |
421 | { // 2048 is the maximum limit due to the size of the buffers |
|
435 | ||
422 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_L+10, lsb ); |
|
436 | parameter_dump_packet.sy_lfr_n_swf_l[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L ]; | |
423 | result = WRONG_APP_DATA; |
|
437 | parameter_dump_packet.sy_lfr_n_swf_l[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_L+1 ]; | |
424 | } |
|
|||
425 | else if (tmp != 2048) |
|
|||
426 | { |
|
|||
427 | status = send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
|||
428 | result = FUNCT_NOT_IMPL; |
|
|||
429 | } |
|
|||
430 | else |
|
|||
431 | { |
|
|||
432 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (tmp >> 8); |
|
|||
433 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (tmp ); |
|
|||
434 | result = LFR_SUCCESSFUL; |
|
|||
435 | } |
|
|||
436 |
|
438 | |||
437 | return result; |
|
439 | return result; | |
438 | } |
|
440 | } | |
439 |
|
441 | |||
440 |
int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC |
|
442 | int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC ) | |
441 | { |
|
443 | { | |
442 | /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p). |
|
444 | /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p). | |
443 | * |
|
445 | * | |
444 | * @param TC points to the TeleCommand packet that is being processed |
|
446 | * @param TC points to the TeleCommand packet that is being processed | |
445 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
447 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
446 | * |
|
448 | * | |
447 | */ |
|
449 | */ | |
448 |
|
450 | |||
449 | unsigned int tmp; |
|
|||
450 | int result; |
|
451 | int result; | |
451 | unsigned char msb; |
|
|||
452 | unsigned char lsb; |
|
|||
453 | rtems_status_code status; |
|
|||
454 |
|
||||
455 | msb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ]; |
|
|||
456 | lsb = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ]; |
|
|||
457 |
|
||||
458 | tmp = msb * 256 + lsb; |
|
|||
459 |
|
452 | |||
460 | if ( tmp < 16 ) |
|
453 | result = LFR_SUCCESSFUL; | |
461 | { |
|
454 | ||
462 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_SWF_P+10, lsb ); |
|
455 | parameter_dump_packet.sy_lfr_n_swf_p[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P ]; | |
463 | result = WRONG_APP_DATA; |
|
456 | parameter_dump_packet.sy_lfr_n_swf_p[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_SWF_P+1 ]; | |
464 | } |
|
|||
465 | else |
|
|||
466 | { |
|
|||
467 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (tmp >> 8); |
|
|||
468 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (tmp ); |
|
|||
469 | result = LFR_SUCCESSFUL; |
|
|||
470 | } |
|
|||
471 |
|
457 | |||
472 | return result; |
|
458 | return result; | |
473 | } |
|
459 | } | |
474 |
|
460 | |||
475 |
int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC |
|
461 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC ) | |
476 | { |
|
462 | { | |
477 | /** This function sets the time between two full spectral matrices transmission, in s (SY_LFR_N_ASM_P). |
|
463 | /** This function sets the time between two full spectral matrices transmission, in s (SY_LFR_N_ASM_P). | |
478 | * |
|
464 | * | |
479 | * @param TC points to the TeleCommand packet that is being processed |
|
465 | * @param TC points to the TeleCommand packet that is being processed | |
480 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
466 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
481 | * |
|
467 | * | |
482 | */ |
|
468 | */ | |
483 |
|
469 | |||
484 | int result; |
|
470 | int result; | |
485 | unsigned char msb; |
|
471 | ||
486 | unsigned char lsb; |
|
472 | result = LFR_SUCCESSFUL; | |
487 |
|
473 | |||
488 |
|
|
474 | parameter_dump_packet.sy_lfr_n_asm_p[0] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P ]; | |
489 |
|
|
475 | parameter_dump_packet.sy_lfr_n_asm_p[1] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_ASM_P+1 ]; | |
490 |
|
||||
491 | parameter_dump_packet.sy_lfr_n_asm_p[0] = msb; |
|
|||
492 | parameter_dump_packet.sy_lfr_n_asm_p[1] = lsb; |
|
|||
493 | result = LFR_SUCCESSFUL; |
|
|||
494 |
|
476 | |||
495 | return result; |
|
477 | return result; | |
496 | } |
|
478 | } | |
497 |
|
479 | |||
498 |
int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC |
|
480 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC ) | |
499 | { |
|
481 | { | |
500 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_N_BP_P0). |
|
482 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_N_BP_P0). | |
501 | * |
|
483 | * | |
502 | * @param TC points to the TeleCommand packet that is being processed |
|
484 | * @param TC points to the TeleCommand packet that is being processed | |
503 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
485 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
504 | * |
|
486 | * | |
505 | */ |
|
487 | */ | |
506 |
|
488 | |||
507 | int status; |
|
489 | int status; | |
508 | unsigned char val; |
|
|||
509 |
|
490 | |||
510 | status = LFR_SUCCESSFUL; |
|
491 | status = LFR_SUCCESSFUL; | |
511 |
|
492 | |||
512 |
|
|
493 | parameter_dump_packet.sy_lfr_n_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P0 ]; | |
513 |
|
||||
514 | if (val < SY_LFR_N_BP_P0) |
|
|||
515 | { |
|
|||
516 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P0+10, val ); |
|
|||
517 | status = WRONG_APP_DATA; |
|
|||
518 | } |
|
|||
519 | else |
|
|||
520 | { |
|
|||
521 | parameter_dump_packet.sy_lfr_n_bp_p0 = val; |
|
|||
522 | } |
|
|||
523 |
|
494 | |||
524 | return status; |
|
495 | return status; | |
525 | } |
|
496 | } | |
526 |
|
497 | |||
527 |
int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC |
|
498 | int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC ) | |
528 | { |
|
499 | { | |
529 | /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1). |
|
500 | /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1). | |
530 | * |
|
501 | * | |
531 | * @param TC points to the TeleCommand packet that is being processed |
|
502 | * @param TC points to the TeleCommand packet that is being processed | |
532 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
503 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
533 | * |
|
504 | * | |
534 | */ |
|
505 | */ | |
535 |
|
506 | |||
536 | int status; |
|
507 | int status; | |
537 | unsigned char val; |
|
|||
538 |
|
508 | |||
539 | status = LFR_SUCCESSFUL; |
|
509 | status = LFR_SUCCESSFUL; | |
540 |
|
510 | |||
541 |
|
|
511 | parameter_dump_packet.sy_lfr_n_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_BP_P1 ]; | |
542 |
|
||||
543 | if (val < SY_LFR_N_BP_P1) |
|
|||
544 | { |
|
|||
545 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_N_BP_P1+10, val ); |
|
|||
546 | status = WRONG_APP_DATA; |
|
|||
547 | } |
|
|||
548 | else |
|
|||
549 | { |
|
|||
550 | parameter_dump_packet.sy_lfr_n_bp_p1 = val; |
|
|||
551 | } |
|
|||
552 |
|
512 | |||
553 | return status; |
|
513 | return status; | |
554 | } |
|
514 | } | |
555 |
|
515 | |||
556 |
int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC |
|
516 | int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC ) | |
557 | { |
|
517 | { | |
558 | /** This function allows to switch from CWF_F3 packets to CWF_LONG_F3 packets. |
|
518 | /** This function allows to switch from CWF_F3 packets to CWF_LONG_F3 packets. | |
559 | * |
|
519 | * | |
560 | * @param TC points to the TeleCommand packet that is being processed |
|
520 | * @param TC points to the TeleCommand packet that is being processed | |
561 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
521 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
562 | * |
|
522 | * | |
563 | */ |
|
523 | */ | |
564 |
|
524 | |||
565 | int status; |
|
525 | int status; | |
566 |
|
526 | |||
567 | status = LFR_SUCCESSFUL; |
|
527 | status = LFR_SUCCESSFUL; | |
568 |
|
528 | |||
569 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 ]; |
|
529 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_N_CWF_LONG_F3 ]; | |
570 |
|
530 | |||
571 | return status; |
|
531 | return status; | |
572 | } |
|
532 | } | |
573 |
|
533 | |||
574 | //********************** |
|
534 | //********************** | |
575 | // BURST MODE PARAMETERS |
|
535 | // BURST MODE PARAMETERS | |
576 |
int set_sy_lfr_b_bp_p0( |
|
536 | int set_sy_lfr_b_bp_p0(ccsdsTelecommandPacket_t *TC) | |
577 | { |
|
537 | { | |
578 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P0). |
|
538 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P0). | |
579 | * |
|
539 | * | |
580 | * @param TC points to the TeleCommand packet that is being processed |
|
540 | * @param TC points to the TeleCommand packet that is being processed | |
581 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
541 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
582 | * |
|
542 | * | |
583 | */ |
|
543 | */ | |
584 |
|
544 | |||
585 | int status; |
|
545 | int status; | |
586 | unsigned char val; |
|
|||
587 |
|
546 | |||
588 | status = LFR_SUCCESSFUL; |
|
547 | status = LFR_SUCCESSFUL; | |
589 |
|
548 | |||
590 |
|
|
549 | parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P0 ]; | |
591 |
|
||||
592 | if (val < DEFAULT_SY_LFR_B_BP_P0 ) |
|
|||
593 | { |
|
|||
594 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P0+10, val ); |
|
|||
595 | status = WRONG_APP_DATA; |
|
|||
596 | } |
|
|||
597 | else |
|
|||
598 | { |
|
|||
599 | parameter_dump_packet.sy_lfr_b_bp_p0 = val; |
|
|||
600 | } |
|
|||
601 |
|
550 | |||
602 | return status; |
|
551 | return status; | |
603 | } |
|
552 | } | |
604 |
|
553 | |||
605 |
int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC |
|
554 | int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC ) | |
606 | { |
|
555 | { | |
607 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P1). |
|
556 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_B_BP_P1). | |
608 | * |
|
557 | * | |
609 | * @param TC points to the TeleCommand packet that is being processed |
|
558 | * @param TC points to the TeleCommand packet that is being processed | |
610 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
559 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
611 | * |
|
560 | * | |
612 | */ |
|
561 | */ | |
613 |
|
562 | |||
614 | int status; |
|
563 | int status; | |
615 | unsigned char val; |
|
|||
616 |
|
564 | |||
617 | status = LFR_SUCCESSFUL; |
|
565 | status = LFR_SUCCESSFUL; | |
618 |
|
566 | |||
619 |
|
|
567 | parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_B_BP_P1 ]; | |
620 |
|
||||
621 | if (val < DEFAULT_SY_LFR_B_BP_P1 ) |
|
|||
622 | { |
|
|||
623 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_B_BP_P1+10, val ); |
|
|||
624 | status = WRONG_APP_DATA; |
|
|||
625 | } |
|
|||
626 | else |
|
|||
627 | { |
|
|||
628 | parameter_dump_packet.sy_lfr_b_bp_p1 = val; |
|
|||
629 | } |
|
|||
630 |
|
568 | |||
631 | return status; |
|
569 | return status; | |
632 | } |
|
570 | } | |
633 |
|
571 | |||
634 | //********************* |
|
572 | //********************* | |
635 | // SBM1 MODE PARAMETERS |
|
573 | // SBM1 MODE PARAMETERS | |
636 |
int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC |
|
574 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC ) | |
637 | { |
|
575 | { | |
638 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P0). |
|
576 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P0). | |
639 | * |
|
577 | * | |
640 | * @param TC points to the TeleCommand packet that is being processed |
|
578 | * @param TC points to the TeleCommand packet that is being processed | |
641 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
579 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
642 | * |
|
580 | * | |
643 | */ |
|
581 | */ | |
644 |
|
582 | |||
645 | int status; |
|
583 | int status; | |
646 | unsigned char val; |
|
|||
647 |
|
584 | |||
648 | status = LFR_SUCCESSFUL; |
|
585 | status = LFR_SUCCESSFUL; | |
649 |
|
586 | |||
650 |
|
|
587 | parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P0 ]; | |
651 |
|
||||
652 | if (val < DEFAULT_SY_LFR_S1_BP_P0 ) |
|
|||
653 | { |
|
|||
654 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P0+10, val ); |
|
|||
655 | status = WRONG_APP_DATA; |
|
|||
656 | } |
|
|||
657 | else |
|
|||
658 | { |
|
|||
659 | parameter_dump_packet.sy_lfr_s1_bp_p0 = val; |
|
|||
660 | } |
|
|||
661 |
|
588 | |||
662 | return status; |
|
589 | return status; | |
663 | } |
|
590 | } | |
664 |
|
591 | |||
665 |
int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC |
|
592 | int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC ) | |
666 | { |
|
593 | { | |
667 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P1). |
|
594 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S1_BP_P1). | |
668 | * |
|
595 | * | |
669 | * @param TC points to the TeleCommand packet that is being processed |
|
596 | * @param TC points to the TeleCommand packet that is being processed | |
670 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
597 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
671 | * |
|
598 | * | |
672 | */ |
|
599 | */ | |
673 |
|
600 | |||
674 | int status; |
|
601 | int status; | |
675 | unsigned char val; |
|
|||
676 |
|
602 | |||
677 | status = LFR_SUCCESSFUL; |
|
603 | status = LFR_SUCCESSFUL; | |
678 |
|
604 | |||
679 |
|
|
605 | parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S1_BP_P1 ]; | |
680 |
|
||||
681 | if (val < DEFAULT_SY_LFR_S1_BP_P1 ) |
|
|||
682 | { |
|
|||
683 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S1_BP_P1+10, val ); |
|
|||
684 | status = WRONG_APP_DATA; |
|
|||
685 | } |
|
|||
686 | else |
|
|||
687 | { |
|
|||
688 | parameter_dump_packet.sy_lfr_s1_bp_p1 = val; |
|
|||
689 | } |
|
|||
690 |
|
606 | |||
691 | return status; |
|
607 | return status; | |
692 | } |
|
608 | } | |
693 |
|
609 | |||
694 | //********************* |
|
610 | //********************* | |
695 | // SBM2 MODE PARAMETERS |
|
611 | // SBM2 MODE PARAMETERS | |
696 |
int set_sy_lfr_s2_bp_p0( |
|
612 | int set_sy_lfr_s2_bp_p0(ccsdsTelecommandPacket_t *TC) | |
697 | { |
|
613 | { | |
698 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P0). |
|
614 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P0). | |
699 | * |
|
615 | * | |
700 | * @param TC points to the TeleCommand packet that is being processed |
|
616 | * @param TC points to the TeleCommand packet that is being processed | |
701 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
617 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
702 | * |
|
618 | * | |
703 | */ |
|
619 | */ | |
704 |
|
620 | |||
705 | int status; |
|
621 | int status; | |
706 | unsigned char val; |
|
|||
707 |
|
622 | |||
708 | status = LFR_SUCCESSFUL; |
|
623 | status = LFR_SUCCESSFUL; | |
709 |
|
624 | |||
710 |
|
|
625 | parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P0 ]; | |
711 |
|
||||
712 | if (val < DEFAULT_SY_LFR_S2_BP_P0 ) |
|
|||
713 | { |
|
|||
714 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P0+10, val ); |
|
|||
715 | status = WRONG_APP_DATA; |
|
|||
716 | } |
|
|||
717 | else |
|
|||
718 | { |
|
|||
719 | parameter_dump_packet.sy_lfr_s2_bp_p0 = val; |
|
|||
720 | } |
|
|||
721 |
|
626 | |||
722 | return status; |
|
627 | return status; | |
723 | } |
|
628 | } | |
724 |
|
629 | |||
725 |
int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC |
|
630 | int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC ) | |
726 | { |
|
631 | { | |
727 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P1). |
|
632 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_S2_BP_P1). | |
728 | * |
|
633 | * | |
729 | * @param TC points to the TeleCommand packet that is being processed |
|
634 | * @param TC points to the TeleCommand packet that is being processed | |
730 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
635 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
731 | * |
|
636 | * | |
732 | */ |
|
637 | */ | |
733 |
|
638 | |||
734 | int status; |
|
639 | int status; | |
735 | unsigned char val; |
|
|||
736 |
|
640 | |||
737 | status = LFR_SUCCESSFUL; |
|
641 | status = LFR_SUCCESSFUL; | |
738 |
|
642 | |||
739 |
|
|
643 | parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_S2_BP_P1 ]; | |
740 |
|
||||
741 | if (val < DEFAULT_SY_LFR_S2_BP_P1 ) |
|
|||
742 | { |
|
|||
743 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_S2_BP_P1+10, val ); |
|
|||
744 | status = WRONG_APP_DATA; |
|
|||
745 | } |
|
|||
746 | else |
|
|||
747 | { |
|
|||
748 | parameter_dump_packet.sy_lfr_s2_bp_p1 = val; |
|
|||
749 | } |
|
|||
750 |
|
644 | |||
751 | return status; |
|
645 | return status; | |
752 | } |
|
646 | } | |
753 |
|
647 | |||
754 |
|
648 | |||
755 | //******************* |
|
649 | //******************* | |
756 | // TC_LFR_UPDATE_INFO |
|
650 | // TC_LFR_UPDATE_INFO | |
757 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ) |
|
651 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ) | |
758 | { |
|
652 | { | |
759 | unsigned int status; |
|
653 | unsigned int status; | |
760 |
|
654 | |||
761 | if ( (mode == LFR_MODE_STANDBY) || (mode == LFR_MODE_NORMAL) |
|
655 | if ( (mode == LFR_MODE_STANDBY) || (mode == LFR_MODE_NORMAL) | |
762 | || (mode == LFR_MODE_BURST) |
|
656 | || (mode == LFR_MODE_BURST) | |
763 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2)) |
|
657 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2)) | |
764 | { |
|
658 | { | |
765 | status = LFR_SUCCESSFUL; |
|
659 | status = LFR_SUCCESSFUL; | |
766 | } |
|
660 | } | |
767 | else |
|
661 | else | |
768 | { |
|
662 | { | |
769 | status = LFR_DEFAULT; |
|
663 | status = LFR_DEFAULT; | |
770 | } |
|
664 | } | |
771 |
|
665 | |||
772 | return status; |
|
666 | return status; | |
773 | } |
|
667 | } | |
774 |
|
668 | |||
775 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ) |
|
669 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ) | |
776 | { |
|
670 | { | |
777 | unsigned int status; |
|
671 | unsigned int status; | |
778 |
|
672 | |||
779 | if ( (mode == TDS_MODE_STANDBY) || (mode == TDS_MODE_NORMAL) |
|
673 | if ( (mode == TDS_MODE_STANDBY) || (mode == TDS_MODE_NORMAL) | |
780 | || (mode == TDS_MODE_BURST) |
|
674 | || (mode == TDS_MODE_BURST) | |
781 | || (mode == TDS_MODE_SBM1) || (mode == TDS_MODE_SBM2) |
|
675 | || (mode == TDS_MODE_SBM1) || (mode == TDS_MODE_SBM2) | |
782 | || (mode == TDS_MODE_LFM)) |
|
676 | || (mode == TDS_MODE_LFM)) | |
783 | { |
|
677 | { | |
784 | status = LFR_SUCCESSFUL; |
|
678 | status = LFR_SUCCESSFUL; | |
785 | } |
|
679 | } | |
786 | else |
|
680 | else | |
787 | { |
|
681 | { | |
788 | status = LFR_DEFAULT; |
|
682 | status = LFR_DEFAULT; | |
789 | } |
|
683 | } | |
790 |
|
684 | |||
791 | return status; |
|
685 | return status; | |
792 | } |
|
686 | } | |
793 |
|
687 | |||
794 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ) |
|
688 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ) | |
795 | { |
|
689 | { | |
796 | unsigned int status; |
|
690 | unsigned int status; | |
797 |
|
691 | |||
798 | if ( (mode == THR_MODE_STANDBY) || (mode == THR_MODE_NORMAL) |
|
692 | if ( (mode == THR_MODE_STANDBY) || (mode == THR_MODE_NORMAL) | |
799 | || (mode == THR_MODE_BURST)) |
|
693 | || (mode == THR_MODE_BURST)) | |
800 | { |
|
694 | { | |
801 | status = LFR_SUCCESSFUL; |
|
695 | status = LFR_SUCCESSFUL; | |
802 | } |
|
696 | } | |
803 | else |
|
697 | else | |
804 | { |
|
698 | { | |
805 | status = LFR_DEFAULT; |
|
699 | status = LFR_DEFAULT; | |
806 | } |
|
700 | } | |
807 |
|
701 | |||
808 | return status; |
|
702 | return status; | |
809 | } |
|
703 | } | |
810 |
|
704 | |||
811 | //********** |
|
705 | //********** | |
812 | // init dump |
|
706 | // init dump | |
813 |
|
707 | |||
814 | void init_parameter_dump( void ) |
|
708 | void init_parameter_dump( void ) | |
815 | { |
|
709 | { | |
816 | /** This function initialize the parameter_dump_packet global variable with default values. |
|
710 | /** This function initialize the parameter_dump_packet global variable with default values. | |
817 | * |
|
711 | * | |
818 | */ |
|
712 | */ | |
819 |
|
713 | |||
820 | parameter_dump_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
714 | parameter_dump_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
821 | parameter_dump_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
715 | parameter_dump_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
822 | parameter_dump_packet.reserved = CCSDS_RESERVED; |
|
716 | parameter_dump_packet.reserved = CCSDS_RESERVED; | |
823 | parameter_dump_packet.userApplication = CCSDS_USER_APP; |
|
717 | parameter_dump_packet.userApplication = CCSDS_USER_APP; | |
824 | parameter_dump_packet.packetID[0] = (unsigned char) (APID_TM_PARAMETER_DUMP >> 8); |
|
718 | parameter_dump_packet.packetID[0] = (unsigned char) (APID_TM_PARAMETER_DUMP >> 8); | |
825 | parameter_dump_packet.packetID[1] = (unsigned char) APID_TM_PARAMETER_DUMP; |
|
719 | parameter_dump_packet.packetID[1] = (unsigned char) APID_TM_PARAMETER_DUMP; | |
826 | parameter_dump_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
720 | parameter_dump_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
827 | parameter_dump_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
721 | parameter_dump_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
828 | parameter_dump_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_PARAMETER_DUMP >> 8); |
|
722 | parameter_dump_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_PARAMETER_DUMP >> 8); | |
829 | parameter_dump_packet.packetLength[1] = (unsigned char) PACKET_LENGTH_PARAMETER_DUMP; |
|
723 | parameter_dump_packet.packetLength[1] = (unsigned char) PACKET_LENGTH_PARAMETER_DUMP; | |
830 | // DATA FIELD HEADER |
|
724 | // DATA FIELD HEADER | |
831 | parameter_dump_packet.spare1_pusVersion_spare2 = SPARE1_PUSVERSION_SPARE2; |
|
725 | parameter_dump_packet.spare1_pusVersion_spare2 = SPARE1_PUSVERSION_SPARE2; | |
832 | parameter_dump_packet.serviceType = TM_TYPE_PARAMETER_DUMP; |
|
726 | parameter_dump_packet.serviceType = TM_TYPE_PARAMETER_DUMP; | |
833 | parameter_dump_packet.serviceSubType = TM_SUBTYPE_PARAMETER_DUMP; |
|
727 | parameter_dump_packet.serviceSubType = TM_SUBTYPE_PARAMETER_DUMP; | |
834 | parameter_dump_packet.destinationID = TM_DESTINATION_ID_GROUND; |
|
728 | parameter_dump_packet.destinationID = TM_DESTINATION_ID_GROUND; | |
835 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
729 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
836 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
730 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
837 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
731 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
838 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
732 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
839 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
733 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
840 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
734 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); | |
841 | parameter_dump_packet.sid = SID_PARAMETER_DUMP; |
|
735 | parameter_dump_packet.sid = SID_PARAMETER_DUMP; | |
842 |
|
736 | |||
843 | //****************** |
|
737 | //****************** | |
844 | // COMMON PARAMETERS |
|
738 | // COMMON PARAMETERS | |
845 | parameter_dump_packet.unused0 = DEFAULT_SY_LFR_COMMON0; |
|
739 | parameter_dump_packet.unused0 = DEFAULT_SY_LFR_COMMON0; | |
846 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = DEFAULT_SY_LFR_COMMON1; |
|
740 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = DEFAULT_SY_LFR_COMMON1; | |
847 |
|
741 | |||
848 | //****************** |
|
742 | //****************** | |
849 | // NORMAL PARAMETERS |
|
743 | // NORMAL PARAMETERS | |
850 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (SY_LFR_N_SWF_L >> 8); |
|
744 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (SY_LFR_N_SWF_L >> 8); | |
851 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (SY_LFR_N_SWF_L ); |
|
745 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (SY_LFR_N_SWF_L ); | |
852 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (SY_LFR_N_SWF_P >> 8); |
|
746 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (SY_LFR_N_SWF_P >> 8); | |
853 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (SY_LFR_N_SWF_P ); |
|
747 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (SY_LFR_N_SWF_P ); | |
854 | parameter_dump_packet.sy_lfr_n_asm_p[0] = (unsigned char) (SY_LFR_N_ASM_P >> 8); |
|
748 | parameter_dump_packet.sy_lfr_n_asm_p[0] = (unsigned char) (SY_LFR_N_ASM_P >> 8); | |
855 | parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (SY_LFR_N_ASM_P ); |
|
749 | parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (SY_LFR_N_ASM_P ); | |
856 | parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) SY_LFR_N_BP_P0; |
|
750 | parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) SY_LFR_N_BP_P0; | |
857 | parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) SY_LFR_N_BP_P1; |
|
751 | parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) SY_LFR_N_BP_P1; | |
858 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = (unsigned char) SY_LFR_N_CWF_LONG_F3; |
|
752 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = (unsigned char) SY_LFR_N_CWF_LONG_F3; | |
859 |
|
753 | |||
860 | //***************** |
|
754 | //***************** | |
861 | // BURST PARAMETERS |
|
755 | // BURST PARAMETERS | |
862 | parameter_dump_packet.sy_lfr_b_bp_p0 = (unsigned char) DEFAULT_SY_LFR_B_BP_P0; |
|
756 | parameter_dump_packet.sy_lfr_b_bp_p0 = (unsigned char) DEFAULT_SY_LFR_B_BP_P0; | |
863 | parameter_dump_packet.sy_lfr_b_bp_p1 = (unsigned char) DEFAULT_SY_LFR_B_BP_P1; |
|
757 | parameter_dump_packet.sy_lfr_b_bp_p1 = (unsigned char) DEFAULT_SY_LFR_B_BP_P1; | |
864 |
|
758 | |||
865 | //**************** |
|
759 | //**************** | |
866 | // SBM1 PARAMETERS |
|
760 | // SBM1 PARAMETERS | |
867 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period |
|
761 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period | |
868 | parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1; |
|
762 | parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1; | |
869 |
|
763 | |||
870 | //**************** |
|
764 | //**************** | |
871 | // SBM2 PARAMETERS |
|
765 | // SBM2 PARAMETERS | |
872 | parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0; |
|
766 | parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0; | |
873 | parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1; |
|
767 | parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1; | |
874 | } |
|
768 | } | |
875 |
|
769 | |||
876 |
|
770 | |||
877 |
|
771 | |||
878 |
|
772 | |||
879 |
|
773 | |||
880 |
|
774 | |||
881 |
|
775 |
@@ -1,510 +1,510 | |||||
1 | /** Functions to send TM packets related to TC parsing and execution. |
|
1 | /** Functions to send TM packets related to TC parsing and execution. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to send appropriate TM packets after parsing and execution: |
|
6 | * A group of functions to send appropriate TM packets after parsing and execution: | |
7 | * - TM_LFR_TC_EXE_SUCCESS |
|
7 | * - TM_LFR_TC_EXE_SUCCESS | |
8 | * - TM_LFR_TC_EXE_INCONSISTENT |
|
8 | * - TM_LFR_TC_EXE_INCONSISTENT | |
9 | * - TM_LFR_TC_EXE_NOT_EXECUTABLE |
|
9 | * - TM_LFR_TC_EXE_NOT_EXECUTABLE | |
10 | * - TM_LFR_TC_EXE_NOT_IMPLEMENTED |
|
10 | * - TM_LFR_TC_EXE_NOT_IMPLEMENTED | |
11 | * - TM_LFR_TC_EXE_ERROR |
|
11 | * - TM_LFR_TC_EXE_ERROR | |
12 | * - TM_LFR_TC_EXE_CORRUPTED |
|
12 | * - TM_LFR_TC_EXE_CORRUPTED | |
13 | * |
|
13 | * | |
14 | */ |
|
14 | */ | |
15 |
|
15 | |||
16 | #include "tm_lfr_tc_exe.h" |
|
16 | #include "tm_lfr_tc_exe.h" | |
17 |
|
17 | |||
18 | int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
18 | int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
19 | { |
|
19 | { | |
20 | /** This function sends a TM_LFR_TC_EXE_SUCCESS packet in the dedicated RTEMS message queue. |
|
20 | /** This function sends a TM_LFR_TC_EXE_SUCCESS packet in the dedicated RTEMS message queue. | |
21 | * |
|
21 | * | |
22 | * @param TC points to the TeleCommand packet that is being processed |
|
22 | * @param TC points to the TeleCommand packet that is being processed | |
23 | * @param queue_id is the id of the queue which handles TM |
|
23 | * @param queue_id is the id of the queue which handles TM | |
24 | * |
|
24 | * | |
25 | * @return RTEMS directive status code: |
|
25 | * @return RTEMS directive status code: | |
26 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
26 | * - RTEMS_SUCCESSFUL - message sent successfully | |
27 | * - RTEMS_INVALID_ID - invalid queue id |
|
27 | * - RTEMS_INVALID_ID - invalid queue id | |
28 | * - RTEMS_INVALID_SIZE - invalid message size |
|
28 | * - RTEMS_INVALID_SIZE - invalid message size | |
29 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
29 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
30 | * - RTEMS_UNSATISFIED - out of message buffers |
|
30 | * - RTEMS_UNSATISFIED - out of message buffers | |
31 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
31 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
32 | * |
|
32 | * | |
33 | */ |
|
33 | */ | |
34 |
|
34 | |||
35 | rtems_status_code status; |
|
35 | rtems_status_code status; | |
36 | Packet_TM_LFR_TC_EXE_SUCCESS_t TM; |
|
36 | Packet_TM_LFR_TC_EXE_SUCCESS_t TM; | |
37 | unsigned char messageSize; |
|
37 | unsigned char messageSize; | |
38 |
|
38 | |||
39 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
39 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
40 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
40 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
41 | TM.reserved = DEFAULT_RESERVED; |
|
41 | TM.reserved = DEFAULT_RESERVED; | |
42 | TM.userApplication = CCSDS_USER_APP; |
|
42 | TM.userApplication = CCSDS_USER_APP; | |
43 | // PACKET HEADER |
|
43 | // PACKET HEADER | |
44 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
44 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
45 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
45 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
46 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
46 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
47 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS >> 8); |
|
47 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS >> 8); | |
48 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS ); |
|
48 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS ); | |
49 | // DATA FIELD HEADER |
|
49 | // DATA FIELD HEADER | |
50 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
50 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
51 | TM.serviceType = TM_TYPE_TC_EXE; |
|
51 | TM.serviceType = TM_TYPE_TC_EXE; | |
52 | TM.serviceSubType = TM_SUBTYPE_EXE_OK; |
|
52 | TM.serviceSubType = TM_SUBTYPE_EXE_OK; | |
53 | TM.destinationID = TC->sourceID; |
|
53 | TM.destinationID = TC->sourceID; | |
54 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
54 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
55 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
55 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
56 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
56 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
57 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
57 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
58 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
58 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
59 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
59 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
60 | // |
|
60 | // | |
61 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
61 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
62 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
62 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
63 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
63 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
64 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
64 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
65 |
|
65 | |||
66 | messageSize = PACKET_LENGTH_TC_EXE_SUCCESS + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
66 | messageSize = PACKET_LENGTH_TC_EXE_SUCCESS + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
67 |
|
67 | |||
68 | // SEND DATA |
|
68 | // SEND DATA | |
69 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
69 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
70 | if (status != RTEMS_SUCCESSFUL) { |
|
70 | if (status != RTEMS_SUCCESSFUL) { | |
71 | PRINTF("in send_tm_lfr_tc_exe_success *** ERR\n") |
|
71 | PRINTF("in send_tm_lfr_tc_exe_success *** ERR\n") | |
72 | } |
|
72 | } | |
73 |
|
73 | |||
74 | // UPDATE HK FIELDS |
|
74 | // UPDATE HK FIELDS | |
75 | update_last_TC_exe( TC, TM.time ); |
|
75 | update_last_TC_exe( TC, TM.time ); | |
76 |
|
76 | |||
77 | return status; |
|
77 | return status; | |
78 | } |
|
78 | } | |
79 |
|
79 | |||
80 | int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
80 | int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
81 | unsigned char byte_position, unsigned char rcv_value ) |
|
81 | unsigned char byte_position, unsigned char rcv_value ) | |
82 | { |
|
82 | { | |
83 | /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue. |
|
83 | /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue. | |
84 | * |
|
84 | * | |
85 | * @param TC points to the TeleCommand packet that is being processed |
|
85 | * @param TC points to the TeleCommand packet that is being processed | |
86 | * @param queue_id is the id of the queue which handles TM |
|
86 | * @param queue_id is the id of the queue which handles TM | |
87 | * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent |
|
87 | * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent | |
88 | * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent |
|
88 | * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent | |
89 | * |
|
89 | * | |
90 | * @return RTEMS directive status code: |
|
90 | * @return RTEMS directive status code: | |
91 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
91 | * - RTEMS_SUCCESSFUL - message sent successfully | |
92 | * - RTEMS_INVALID_ID - invalid queue id |
|
92 | * - RTEMS_INVALID_ID - invalid queue id | |
93 | * - RTEMS_INVALID_SIZE - invalid message size |
|
93 | * - RTEMS_INVALID_SIZE - invalid message size | |
94 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
94 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
95 | * - RTEMS_UNSATISFIED - out of message buffers |
|
95 | * - RTEMS_UNSATISFIED - out of message buffers | |
96 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
96 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
97 | * |
|
97 | * | |
98 | */ |
|
98 | */ | |
99 |
|
99 | |||
100 | rtems_status_code status; |
|
100 | rtems_status_code status; | |
101 | Packet_TM_LFR_TC_EXE_INCONSISTENT_t TM; |
|
101 | Packet_TM_LFR_TC_EXE_INCONSISTENT_t TM; | |
102 | unsigned char messageSize; |
|
102 | unsigned char messageSize; | |
103 |
|
103 | |||
104 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
104 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
105 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
105 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
106 | TM.reserved = DEFAULT_RESERVED; |
|
106 | TM.reserved = DEFAULT_RESERVED; | |
107 | TM.userApplication = CCSDS_USER_APP; |
|
107 | TM.userApplication = CCSDS_USER_APP; | |
108 | // PACKET HEADER |
|
108 | // PACKET HEADER | |
109 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
109 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
110 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
110 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
111 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
111 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
112 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); |
|
112 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); | |
113 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); |
|
113 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); | |
114 | // DATA FIELD HEADER |
|
114 | // DATA FIELD HEADER | |
115 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
115 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
116 | TM.serviceType = TM_TYPE_TC_EXE; |
|
116 | TM.serviceType = TM_TYPE_TC_EXE; | |
117 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
117 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
118 | TM.destinationID = TC->sourceID; |
|
118 | TM.destinationID = TC->sourceID; | |
119 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
119 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
120 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
120 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
121 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
121 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
122 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
122 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
123 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
123 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
124 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
124 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
125 | // |
|
125 | // | |
126 | TM.tc_failure_code[0] = (char) (WRONG_APP_DATA >> 8); |
|
126 | TM.tc_failure_code[0] = (char) (WRONG_APP_DATA >> 8); | |
127 | TM.tc_failure_code[1] = (char) (WRONG_APP_DATA ); |
|
127 | TM.tc_failure_code[1] = (char) (WRONG_APP_DATA ); | |
128 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
128 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
129 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
129 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
130 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
130 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
131 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
131 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
132 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
132 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
133 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
133 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
134 | TM.byte_position = byte_position; |
|
134 | TM.byte_position = byte_position; | |
135 | TM.rcv_value = rcv_value; |
|
135 | TM.rcv_value = (unsigned char) rcv_value; | |
136 |
|
136 | |||
137 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
137 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
138 |
|
138 | |||
139 | // SEND DATA |
|
139 | // SEND DATA | |
140 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
140 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
141 | if (status != RTEMS_SUCCESSFUL) { |
|
141 | if (status != RTEMS_SUCCESSFUL) { | |
142 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") |
|
142 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") | |
143 | } |
|
143 | } | |
144 |
|
144 | |||
145 | // UPDATE HK FIELDS |
|
145 | // UPDATE HK FIELDS | |
146 | update_last_TC_rej( TC, TM.time ); |
|
146 | update_last_TC_rej( TC, TM.time ); | |
147 |
|
147 | |||
148 | return status; |
|
148 | return status; | |
149 | } |
|
149 | } | |
150 |
|
150 | |||
151 | int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
151 | int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
152 | { |
|
152 | { | |
153 | /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue. |
|
153 | /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue. | |
154 | * |
|
154 | * | |
155 | * @param TC points to the TeleCommand packet that is being processed |
|
155 | * @param TC points to the TeleCommand packet that is being processed | |
156 | * @param queue_id is the id of the queue which handles TM |
|
156 | * @param queue_id is the id of the queue which handles TM | |
157 | * |
|
157 | * | |
158 | * @return RTEMS directive status code: |
|
158 | * @return RTEMS directive status code: | |
159 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
159 | * - RTEMS_SUCCESSFUL - message sent successfully | |
160 | * - RTEMS_INVALID_ID - invalid queue id |
|
160 | * - RTEMS_INVALID_ID - invalid queue id | |
161 | * - RTEMS_INVALID_SIZE - invalid message size |
|
161 | * - RTEMS_INVALID_SIZE - invalid message size | |
162 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
162 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
163 | * - RTEMS_UNSATISFIED - out of message buffers |
|
163 | * - RTEMS_UNSATISFIED - out of message buffers | |
164 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
164 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
165 | * |
|
165 | * | |
166 | */ |
|
166 | */ | |
167 |
|
167 | |||
168 | rtems_status_code status; |
|
168 | rtems_status_code status; | |
169 | Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t TM; |
|
169 | Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t TM; | |
170 | unsigned char messageSize; |
|
170 | unsigned char messageSize; | |
171 |
|
171 | |||
172 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
172 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
173 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
173 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
174 | TM.reserved = DEFAULT_RESERVED; |
|
174 | TM.reserved = DEFAULT_RESERVED; | |
175 | TM.userApplication = CCSDS_USER_APP; |
|
175 | TM.userApplication = CCSDS_USER_APP; | |
176 | // PACKET HEADER |
|
176 | // PACKET HEADER | |
177 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
177 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
178 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
178 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
179 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
179 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
180 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); |
|
180 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); | |
181 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); |
|
181 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); | |
182 | // DATA FIELD HEADER |
|
182 | // DATA FIELD HEADER | |
183 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
183 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
184 | TM.serviceType = TM_TYPE_TC_EXE; |
|
184 | TM.serviceType = TM_TYPE_TC_EXE; | |
185 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
185 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
186 | TM.destinationID = TC->sourceID; // default destination id |
|
186 | TM.destinationID = TC->sourceID; // default destination id | |
187 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
187 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
188 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
188 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
189 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
189 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
190 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
190 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
191 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
191 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
192 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
192 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
193 | // |
|
193 | // | |
194 | TM.tc_failure_code[0] = (char) (TC_NOT_EXE >> 8); |
|
194 | TM.tc_failure_code[0] = (char) (TC_NOT_EXE >> 8); | |
195 | TM.tc_failure_code[1] = (char) (TC_NOT_EXE ); |
|
195 | TM.tc_failure_code[1] = (char) (TC_NOT_EXE ); | |
196 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
196 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
197 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
197 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
198 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
198 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
199 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
199 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
200 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
200 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
201 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
201 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
202 | TM.lfr_status_word[0] = housekeeping_packet.lfr_status_word[0]; |
|
202 | TM.lfr_status_word[0] = housekeeping_packet.lfr_status_word[0]; | |
203 | TM.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1]; |
|
203 | TM.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1]; | |
204 |
|
204 | |||
205 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
205 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
206 |
|
206 | |||
207 | // SEND DATA |
|
207 | // SEND DATA | |
208 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
208 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
209 | if (status != RTEMS_SUCCESSFUL) { |
|
209 | if (status != RTEMS_SUCCESSFUL) { | |
210 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") |
|
210 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") | |
211 | } |
|
211 | } | |
212 |
|
212 | |||
213 | // UPDATE HK FIELDS |
|
213 | // UPDATE HK FIELDS | |
214 | update_last_TC_rej( TC, TM.time ); |
|
214 | update_last_TC_rej( TC, TM.time ); | |
215 |
|
215 | |||
216 | return status; |
|
216 | return status; | |
217 | } |
|
217 | } | |
218 |
|
218 | |||
219 | int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) |
|
219 | int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) | |
220 | { |
|
220 | { | |
221 | /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue. |
|
221 | /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue. | |
222 | * |
|
222 | * | |
223 | * @param TC points to the TeleCommand packet that is being processed |
|
223 | * @param TC points to the TeleCommand packet that is being processed | |
224 | * @param queue_id is the id of the queue which handles TM |
|
224 | * @param queue_id is the id of the queue which handles TM | |
225 | * |
|
225 | * | |
226 | * @return RTEMS directive status code: |
|
226 | * @return RTEMS directive status code: | |
227 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
227 | * - RTEMS_SUCCESSFUL - message sent successfully | |
228 | * - RTEMS_INVALID_ID - invalid queue id |
|
228 | * - RTEMS_INVALID_ID - invalid queue id | |
229 | * - RTEMS_INVALID_SIZE - invalid message size |
|
229 | * - RTEMS_INVALID_SIZE - invalid message size | |
230 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
230 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
231 | * - RTEMS_UNSATISFIED - out of message buffers |
|
231 | * - RTEMS_UNSATISFIED - out of message buffers | |
232 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
232 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
233 | * |
|
233 | * | |
234 | */ |
|
234 | */ | |
235 |
|
235 | |||
236 | rtems_status_code status; |
|
236 | rtems_status_code status; | |
237 | Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t TM; |
|
237 | Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t TM; | |
238 | unsigned char messageSize; |
|
238 | unsigned char messageSize; | |
239 |
|
239 | |||
240 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
240 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
241 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
241 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
242 | TM.reserved = DEFAULT_RESERVED; |
|
242 | TM.reserved = DEFAULT_RESERVED; | |
243 | TM.userApplication = CCSDS_USER_APP; |
|
243 | TM.userApplication = CCSDS_USER_APP; | |
244 | // PACKET HEADER |
|
244 | // PACKET HEADER | |
245 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
245 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
246 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
246 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
247 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
247 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
248 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); |
|
248 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); | |
249 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); |
|
249 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); | |
250 | // DATA FIELD HEADER |
|
250 | // DATA FIELD HEADER | |
251 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
251 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
252 | TM.serviceType = TM_TYPE_TC_EXE; |
|
252 | TM.serviceType = TM_TYPE_TC_EXE; | |
253 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
253 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
254 | TM.destinationID = TC->sourceID; // default destination id |
|
254 | TM.destinationID = TC->sourceID; // default destination id | |
255 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
255 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
256 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
256 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
257 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
257 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
258 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
258 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
259 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
259 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
260 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
260 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
261 | // |
|
261 | // | |
262 | TM.tc_failure_code[0] = (char) (FUNCT_NOT_IMPL >> 8); |
|
262 | TM.tc_failure_code[0] = (char) (FUNCT_NOT_IMPL >> 8); | |
263 | TM.tc_failure_code[1] = (char) (FUNCT_NOT_IMPL ); |
|
263 | TM.tc_failure_code[1] = (char) (FUNCT_NOT_IMPL ); | |
264 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
264 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
265 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
265 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
266 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
266 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
267 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
267 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
268 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
268 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
269 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
269 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
270 |
|
270 | |||
271 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
271 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
272 |
|
272 | |||
273 | // SEND DATA |
|
273 | // SEND DATA | |
274 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
274 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
275 | if (status != RTEMS_SUCCESSFUL) { |
|
275 | if (status != RTEMS_SUCCESSFUL) { | |
276 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") |
|
276 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") | |
277 | } |
|
277 | } | |
278 |
|
278 | |||
279 | // UPDATE HK FIELDS |
|
279 | // UPDATE HK FIELDS | |
280 | update_last_TC_rej( TC, TM.time ); |
|
280 | update_last_TC_rej( TC, TM.time ); | |
281 |
|
281 | |||
282 | return status; |
|
282 | return status; | |
283 | } |
|
283 | } | |
284 |
|
284 | |||
285 | int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
285 | int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
286 | { |
|
286 | { | |
287 | /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue. |
|
287 | /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue. | |
288 | * |
|
288 | * | |
289 | * @param TC points to the TeleCommand packet that is being processed |
|
289 | * @param TC points to the TeleCommand packet that is being processed | |
290 | * @param queue_id is the id of the queue which handles TM |
|
290 | * @param queue_id is the id of the queue which handles TM | |
291 | * |
|
291 | * | |
292 | * @return RTEMS directive status code: |
|
292 | * @return RTEMS directive status code: | |
293 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
293 | * - RTEMS_SUCCESSFUL - message sent successfully | |
294 | * - RTEMS_INVALID_ID - invalid queue id |
|
294 | * - RTEMS_INVALID_ID - invalid queue id | |
295 | * - RTEMS_INVALID_SIZE - invalid message size |
|
295 | * - RTEMS_INVALID_SIZE - invalid message size | |
296 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
296 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
297 | * - RTEMS_UNSATISFIED - out of message buffers |
|
297 | * - RTEMS_UNSATISFIED - out of message buffers | |
298 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
298 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
299 | * |
|
299 | * | |
300 | */ |
|
300 | */ | |
301 |
|
301 | |||
302 | rtems_status_code status; |
|
302 | rtems_status_code status; | |
303 | Packet_TM_LFR_TC_EXE_ERROR_t TM; |
|
303 | Packet_TM_LFR_TC_EXE_ERROR_t TM; | |
304 | unsigned char messageSize; |
|
304 | unsigned char messageSize; | |
305 |
|
305 | |||
306 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
306 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
307 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
307 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
308 | TM.reserved = DEFAULT_RESERVED; |
|
308 | TM.reserved = DEFAULT_RESERVED; | |
309 | TM.userApplication = CCSDS_USER_APP; |
|
309 | TM.userApplication = CCSDS_USER_APP; | |
310 | // PACKET HEADER |
|
310 | // PACKET HEADER | |
311 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
311 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
312 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
312 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
313 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
313 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
314 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); |
|
314 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); | |
315 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); |
|
315 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); | |
316 | // DATA FIELD HEADER |
|
316 | // DATA FIELD HEADER | |
317 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
317 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
318 | TM.serviceType = TM_TYPE_TC_EXE; |
|
318 | TM.serviceType = TM_TYPE_TC_EXE; | |
319 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
319 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
320 | TM.destinationID = TC->sourceID; // default destination id |
|
320 | TM.destinationID = TC->sourceID; // default destination id | |
321 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
321 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
322 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
322 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
323 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
323 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
324 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
324 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
325 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
325 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
326 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
326 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
327 | // |
|
327 | // | |
328 | TM.tc_failure_code[0] = (char) (FAIL_DETECTED >> 8); |
|
328 | TM.tc_failure_code[0] = (char) (FAIL_DETECTED >> 8); | |
329 | TM.tc_failure_code[1] = (char) (FAIL_DETECTED ); |
|
329 | TM.tc_failure_code[1] = (char) (FAIL_DETECTED ); | |
330 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
330 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
331 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
331 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
332 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
332 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
333 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
333 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
334 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
334 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
335 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
335 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
336 |
|
336 | |||
337 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
337 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
338 |
|
338 | |||
339 | // SEND DATA |
|
339 | // SEND DATA | |
340 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
340 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
341 | if (status != RTEMS_SUCCESSFUL) { |
|
341 | if (status != RTEMS_SUCCESSFUL) { | |
342 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
342 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
343 | } |
|
343 | } | |
344 |
|
344 | |||
345 | // UPDATE HK FIELDS |
|
345 | // UPDATE HK FIELDS | |
346 | update_last_TC_rej( TC, TM.time ); |
|
346 | update_last_TC_rej( TC, TM.time ); | |
347 |
|
347 | |||
348 | return status; |
|
348 | return status; | |
349 | } |
|
349 | } | |
350 |
|
350 | |||
351 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
351 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
352 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, |
|
352 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, | |
353 | unsigned char destinationID ) |
|
353 | unsigned char destinationID ) | |
354 | { |
|
354 | { | |
355 | /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue. |
|
355 | /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue. | |
356 | * |
|
356 | * | |
357 | * @param TC points to the TeleCommand packet that is being processed |
|
357 | * @param TC points to the TeleCommand packet that is being processed | |
358 | * @param queue_id is the id of the queue which handles TM |
|
358 | * @param queue_id is the id of the queue which handles TM | |
359 | * @param computed_CRC points to a buffer of two bytes containing the CRC computed during the parsing of the TeleCommand |
|
359 | * @param computed_CRC points to a buffer of two bytes containing the CRC computed during the parsing of the TeleCommand | |
360 | * @param currentTC_LEN_RCV points to a buffer of two bytes containing a packet size field computed on the received data |
|
360 | * @param currentTC_LEN_RCV points to a buffer of two bytes containing a packet size field computed on the received data | |
361 | * |
|
361 | * | |
362 | * @return RTEMS directive status code: |
|
362 | * @return RTEMS directive status code: | |
363 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
363 | * - RTEMS_SUCCESSFUL - message sent successfully | |
364 | * - RTEMS_INVALID_ID - invalid queue id |
|
364 | * - RTEMS_INVALID_ID - invalid queue id | |
365 | * - RTEMS_INVALID_SIZE - invalid message size |
|
365 | * - RTEMS_INVALID_SIZE - invalid message size | |
366 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
366 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
367 | * - RTEMS_UNSATISFIED - out of message buffers |
|
367 | * - RTEMS_UNSATISFIED - out of message buffers | |
368 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
368 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
369 | * |
|
369 | * | |
370 | */ |
|
370 | */ | |
371 |
|
371 | |||
372 | rtems_status_code status; |
|
372 | rtems_status_code status; | |
373 | Packet_TM_LFR_TC_EXE_CORRUPTED_t TM; |
|
373 | Packet_TM_LFR_TC_EXE_CORRUPTED_t TM; | |
374 | unsigned char messageSize; |
|
374 | unsigned char messageSize; | |
375 | unsigned int packetLength; |
|
375 | unsigned int packetLength; | |
376 | unsigned char *packetDataField; |
|
376 | unsigned char *packetDataField; | |
377 |
|
377 | |||
378 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; // compute the packet length parameter |
|
378 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; // compute the packet length parameter | |
379 | packetDataField = (unsigned char *) &TC->headerFlag_pusVersion_Ack; // get the beginning of the data field |
|
379 | packetDataField = (unsigned char *) &TC->headerFlag_pusVersion_Ack; // get the beginning of the data field | |
380 |
|
380 | |||
381 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
381 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
382 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
382 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
383 | TM.reserved = DEFAULT_RESERVED; |
|
383 | TM.reserved = DEFAULT_RESERVED; | |
384 | TM.userApplication = CCSDS_USER_APP; |
|
384 | TM.userApplication = CCSDS_USER_APP; | |
385 | // PACKET HEADER |
|
385 | // PACKET HEADER | |
386 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); |
|
386 | TM.packetID[0] = (unsigned char) (APID_TM_TC_EXE >> 8); | |
387 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); |
|
387 | TM.packetID[1] = (unsigned char) (APID_TM_TC_EXE ); | |
388 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
388 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
389 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); |
|
389 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); | |
390 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); |
|
390 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); | |
391 | // DATA FIELD HEADER |
|
391 | // DATA FIELD HEADER | |
392 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
392 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
393 | TM.serviceType = TM_TYPE_TC_EXE; |
|
393 | TM.serviceType = TM_TYPE_TC_EXE; | |
394 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
394 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
395 | TM.destinationID = destinationID; |
|
395 | TM.destinationID = destinationID; | |
396 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
396 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
397 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
397 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
398 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
398 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
399 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
399 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
400 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
400 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
401 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
401 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
402 | // |
|
402 | // | |
403 | TM.tc_failure_code[0] = (unsigned char) (CORRUPTED >> 8); |
|
403 | TM.tc_failure_code[0] = (unsigned char) (CORRUPTED >> 8); | |
404 | TM.tc_failure_code[1] = (unsigned char) (CORRUPTED ); |
|
404 | TM.tc_failure_code[1] = (unsigned char) (CORRUPTED ); | |
405 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
405 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
406 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
406 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
407 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
407 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
408 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
408 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
409 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
409 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
410 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
410 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
411 | TM.pkt_len_rcv_value[0] = TC->packetLength[0]; |
|
411 | TM.pkt_len_rcv_value[0] = TC->packetLength[0]; | |
412 | TM.pkt_len_rcv_value[1] = TC->packetLength[1]; |
|
412 | TM.pkt_len_rcv_value[1] = TC->packetLength[1]; | |
413 | TM.pkt_datafieldsize_cnt[0] = currentTC_LEN_RCV[0]; |
|
413 | TM.pkt_datafieldsize_cnt[0] = currentTC_LEN_RCV[0]; | |
414 | TM.pkt_datafieldsize_cnt[1] = currentTC_LEN_RCV[1]; |
|
414 | TM.pkt_datafieldsize_cnt[1] = currentTC_LEN_RCV[1]; | |
415 | TM.rcv_crc[0] = packetDataField[ packetLength - 1 ]; |
|
415 | TM.rcv_crc[0] = packetDataField[ packetLength - 1 ]; | |
416 | TM.rcv_crc[1] = packetDataField[ packetLength ]; |
|
416 | TM.rcv_crc[1] = packetDataField[ packetLength ]; | |
417 | TM.computed_crc[0] = computed_CRC[0]; |
|
417 | TM.computed_crc[0] = computed_CRC[0]; | |
418 | TM.computed_crc[1] = computed_CRC[1]; |
|
418 | TM.computed_crc[1] = computed_CRC[1]; | |
419 |
|
419 | |||
420 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
420 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
421 |
|
421 | |||
422 | // SEND DATA |
|
422 | // SEND DATA | |
423 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
423 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
424 | if (status != RTEMS_SUCCESSFUL) { |
|
424 | if (status != RTEMS_SUCCESSFUL) { | |
425 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
425 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
426 | } |
|
426 | } | |
427 |
|
427 | |||
428 | // UPDATE HK FIELDS |
|
428 | // UPDATE HK FIELDS | |
429 | update_last_TC_rej( TC, TM.time ); |
|
429 | update_last_TC_rej( TC, TM.time ); | |
430 |
|
430 | |||
431 | return status; |
|
431 | return status; | |
432 | } |
|
432 | } | |
433 |
|
433 | |||
434 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) |
|
434 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) | |
435 | { |
|
435 | { | |
436 | /** This function increment the packet sequence control parameter of a TC, depending on its destination ID. |
|
436 | /** This function increment the packet sequence control parameter of a TC, depending on its destination ID. | |
437 | * |
|
437 | * | |
438 | * @param packet_sequence_control points to the packet sequence control which will be incremented |
|
438 | * @param packet_sequence_control points to the packet sequence control which will be incremented | |
439 | * @param destination_id is the destination ID of the TM, there is one counter by destination ID |
|
439 | * @param destination_id is the destination ID of the TM, there is one counter by destination ID | |
440 | * |
|
440 | * | |
441 | * If the destination ID is not known, a dedicated counter is incremented. |
|
441 | * If the destination ID is not known, a dedicated counter is incremented. | |
442 | * |
|
442 | * | |
443 | */ |
|
443 | */ | |
444 |
|
444 | |||
445 | unsigned short sequence_cnt; |
|
445 | unsigned short sequence_cnt; | |
446 | unsigned short segmentation_grouping_flag; |
|
446 | unsigned short segmentation_grouping_flag; | |
447 | unsigned short new_packet_sequence_control; |
|
447 | unsigned short new_packet_sequence_control; | |
448 | unsigned char i; |
|
448 | unsigned char i; | |
449 |
|
449 | |||
450 | switch (destination_id) |
|
450 | switch (destination_id) | |
451 | { |
|
451 | { | |
452 | case SID_TC_GROUND: |
|
452 | case SID_TC_GROUND: | |
453 | i = GROUND; |
|
453 | i = GROUND; | |
454 | break; |
|
454 | break; | |
455 | case SID_TC_MISSION_TIMELINE: |
|
455 | case SID_TC_MISSION_TIMELINE: | |
456 | i = MISSION_TIMELINE; |
|
456 | i = MISSION_TIMELINE; | |
457 | break; |
|
457 | break; | |
458 | case SID_TC_TC_SEQUENCES: |
|
458 | case SID_TC_TC_SEQUENCES: | |
459 | i = TC_SEQUENCES; |
|
459 | i = TC_SEQUENCES; | |
460 | break; |
|
460 | break; | |
461 | case SID_TC_RECOVERY_ACTION_CMD: |
|
461 | case SID_TC_RECOVERY_ACTION_CMD: | |
462 | i = RECOVERY_ACTION_CMD; |
|
462 | i = RECOVERY_ACTION_CMD; | |
463 | break; |
|
463 | break; | |
464 | case SID_TC_BACKUP_MISSION_TIMELINE: |
|
464 | case SID_TC_BACKUP_MISSION_TIMELINE: | |
465 | i = BACKUP_MISSION_TIMELINE; |
|
465 | i = BACKUP_MISSION_TIMELINE; | |
466 | break; |
|
466 | break; | |
467 | case SID_TC_DIRECT_CMD: |
|
467 | case SID_TC_DIRECT_CMD: | |
468 | i = DIRECT_CMD; |
|
468 | i = DIRECT_CMD; | |
469 | break; |
|
469 | break; | |
470 | case SID_TC_SPARE_GRD_SRC1: |
|
470 | case SID_TC_SPARE_GRD_SRC1: | |
471 | i = SPARE_GRD_SRC1; |
|
471 | i = SPARE_GRD_SRC1; | |
472 | break; |
|
472 | break; | |
473 | case SID_TC_SPARE_GRD_SRC2: |
|
473 | case SID_TC_SPARE_GRD_SRC2: | |
474 | i = SPARE_GRD_SRC2; |
|
474 | i = SPARE_GRD_SRC2; | |
475 | break; |
|
475 | break; | |
476 | case SID_TC_OBCP: |
|
476 | case SID_TC_OBCP: | |
477 | i = OBCP; |
|
477 | i = OBCP; | |
478 | break; |
|
478 | break; | |
479 | case SID_TC_SYSTEM_CONTROL: |
|
479 | case SID_TC_SYSTEM_CONTROL: | |
480 | i = SYSTEM_CONTROL; |
|
480 | i = SYSTEM_CONTROL; | |
481 | break; |
|
481 | break; | |
482 | case SID_TC_AOCS: |
|
482 | case SID_TC_AOCS: | |
483 | i = AOCS; |
|
483 | i = AOCS; | |
484 | break; |
|
484 | break; | |
485 | case SID_TC_RPW_INTERNAL: |
|
485 | case SID_TC_RPW_INTERNAL: | |
486 | i = RPW_INTERNAL; |
|
486 | i = RPW_INTERNAL; | |
487 | break; |
|
487 | break; | |
488 | default: |
|
488 | default: | |
489 | i = GROUND; |
|
489 | i = GROUND; | |
490 | break; |
|
490 | break; | |
491 | } |
|
491 | } | |
492 |
|
492 | |||
493 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; |
|
493 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
494 | sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff; |
|
494 | sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff; | |
495 |
|
495 | |||
496 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; |
|
496 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; | |
497 |
|
497 | |||
498 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); |
|
498 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |
499 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); |
|
499 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |
500 |
|
500 | |||
501 | // increment the sequence counter |
|
501 | // increment the sequence counter | |
502 | if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX ) |
|
502 | if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX ) | |
503 | { |
|
503 | { | |
504 | sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1; |
|
504 | sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1; | |
505 | } |
|
505 | } | |
506 | else |
|
506 | else | |
507 | { |
|
507 | { | |
508 | sequenceCounters_TC_EXE[ i ] = 0; |
|
508 | sequenceCounters_TC_EXE[ i ] = 0; | |
509 | } |
|
509 | } | |
510 | } |
|
510 | } |
General Comments 0
You need to be logged in to leave comments.
Login now