@@ -1,7 +1,9 | |||||
1 | syntax: glob |
|
1 | syntax: glob | |
2 |
|
2 | |||
3 | *~ |
|
3 | *~ | |
4 | *.o |
|
4 | *.o | |
5 | tests/*.err |
|
5 | tests/*.err | |
6 | doc |
|
6 | doc | |
|
7 | *.srec | |||
|
8 | FSW-qt/bin/fsw | |||
7 |
|
9 |
@@ -1,248 +1,248 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Nov 13 08:18:19 2013 | |
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=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=2 |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -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 |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header | |
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_processing.c \ |
|
48 | ../src/fsw_processing.c \ | |
49 | ../src/fsw_misc.c \ |
|
49 | ../src/fsw_misc.c \ | |
50 | ../src/fsw_init.c \ |
|
50 | ../src/fsw_init.c \ | |
51 | ../src/fsw_globals.c \ |
|
51 | ../src/fsw_globals.c \ | |
52 | ../src/fsw_spacewire.c \ |
|
52 | ../src/fsw_spacewire.c \ | |
53 | ../src/tc_load_dump_parameters.c \ |
|
53 | ../src/tc_load_dump_parameters.c \ | |
54 | ../src/tm_lfr_tc_exe.c \ |
|
54 | ../src/tm_lfr_tc_exe.c \ | |
55 | ../src/tc_acceptance.c |
|
55 | ../src/tc_acceptance.c | |
56 | OBJECTS = obj/wf_handler.o \ |
|
56 | OBJECTS = obj/wf_handler.o \ | |
57 | obj/tc_handler.o \ |
|
57 | obj/tc_handler.o \ | |
58 | obj/fsw_processing.o \ |
|
58 | obj/fsw_processing.o \ | |
59 | obj/fsw_misc.o \ |
|
59 | obj/fsw_misc.o \ | |
60 | obj/fsw_init.o \ |
|
60 | obj/fsw_init.o \ | |
61 | obj/fsw_globals.o \ |
|
61 | obj/fsw_globals.o \ | |
62 | obj/fsw_spacewire.o \ |
|
62 | obj/fsw_spacewire.o \ | |
63 | obj/tc_load_dump_parameters.o \ |
|
63 | obj/tc_load_dump_parameters.o \ | |
64 | obj/tm_lfr_tc_exe.o \ |
|
64 | obj/tm_lfr_tc_exe.o \ | |
65 | obj/tc_acceptance.o |
|
65 | obj/tc_acceptance.o | |
66 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
66 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
67 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
67 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
68 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
68 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
69 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
69 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
70 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
70 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
71 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
71 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
72 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
72 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
73 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
73 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
74 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
74 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
75 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
75 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
76 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
76 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
77 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
77 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
78 | sparc.pri \ |
|
78 | sparc.pri \ | |
79 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
79 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
80 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
80 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
81 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
81 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
82 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
82 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
83 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
83 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
84 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
84 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
85 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
85 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
86 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
86 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
87 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
87 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
88 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
88 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
89 | fsw-qt.pro |
|
89 | fsw-qt.pro | |
90 | QMAKE_TARGET = fsw |
|
90 | QMAKE_TARGET = fsw | |
91 | DESTDIR = bin/ |
|
91 | DESTDIR = bin/ | |
92 | TARGET = bin/fsw |
|
92 | TARGET = bin/fsw | |
93 |
|
93 | |||
94 | first: all |
|
94 | first: all | |
95 | ####### Implicit rules |
|
95 | ####### Implicit rules | |
96 |
|
96 | |||
97 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
97 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
98 |
|
98 | |||
99 | .cpp.o: |
|
99 | .cpp.o: | |
100 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
100 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
101 |
|
101 | |||
102 | .cc.o: |
|
102 | .cc.o: | |
103 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
103 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
104 |
|
104 | |||
105 | .cxx.o: |
|
105 | .cxx.o: | |
106 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
106 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
107 |
|
107 | |||
108 | .C.o: |
|
108 | .C.o: | |
109 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
109 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
110 |
|
110 | |||
111 | .c.o: |
|
111 | .c.o: | |
112 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
112 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
113 |
|
113 | |||
114 | ####### Build rules |
|
114 | ####### Build rules | |
115 |
|
115 | |||
116 | all: Makefile $(TARGET) |
|
116 | all: Makefile $(TARGET) | |
117 |
|
117 | |||
118 | $(TARGET): $(OBJECTS) |
|
118 | $(TARGET): $(OBJECTS) | |
119 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
119 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ | |
120 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
|
120 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
121 |
|
121 | |||
122 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
122 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
123 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
123 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
124 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
124 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
125 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
125 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
126 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
126 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
127 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
127 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
128 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
128 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
129 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
129 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
130 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
130 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
131 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
131 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
132 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
132 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
133 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
133 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
134 | sparc.pri \ |
|
134 | sparc.pri \ | |
135 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
135 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
136 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
136 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
137 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
137 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
138 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
138 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
139 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
139 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
140 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
140 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
141 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
141 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
142 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
142 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
143 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
143 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
144 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
144 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf | |
145 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
145 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
146 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
146 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
147 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
147 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
148 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
148 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
149 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
149 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: | |
150 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
150 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: | |
151 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
151 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: | |
152 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
152 | /usr/lib64/qt4/mkspecs/qconfig.pri: | |
153 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: |
|
153 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: | |
154 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
154 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: | |
155 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
155 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: | |
156 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
156 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: | |
157 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
157 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
158 | sparc.pri: |
|
158 | sparc.pri: | |
159 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
159 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
160 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
160 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
161 | /usr/lib64/qt4/mkspecs/features/shared.prf: |
|
161 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |
162 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
162 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
163 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
163 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
164 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
164 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
165 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
165 | /usr/lib64/qt4/mkspecs/features/uic.prf: | |
166 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
166 | /usr/lib64/qt4/mkspecs/features/yacc.prf: | |
167 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
167 | /usr/lib64/qt4/mkspecs/features/lex.prf: | |
168 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
168 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: | |
169 | qmake: FORCE |
|
169 | qmake: FORCE | |
170 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
170 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
171 |
|
171 | |||
172 | dist: |
|
172 | dist: | |
173 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
173 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
174 | $(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 |
|
174 | $(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 | |
175 |
|
175 | |||
176 |
|
176 | |||
177 | clean:compiler_clean |
|
177 | clean:compiler_clean | |
178 | -$(DEL_FILE) $(OBJECTS) |
|
178 | -$(DEL_FILE) $(OBJECTS) | |
179 | -$(DEL_FILE) *~ core *.core |
|
179 | -$(DEL_FILE) *~ core *.core | |
180 |
|
180 | |||
181 |
|
181 | |||
182 | ####### Sub-libraries |
|
182 | ####### Sub-libraries | |
183 |
|
183 | |||
184 | distclean: clean |
|
184 | distclean: clean | |
185 | -$(DEL_FILE) $(TARGET) |
|
185 | -$(DEL_FILE) $(TARGET) | |
186 | -$(DEL_FILE) Makefile |
|
186 | -$(DEL_FILE) Makefile | |
187 |
|
187 | |||
188 |
|
188 | |||
189 | grmon: |
|
189 | grmon: | |
190 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
190 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u | |
191 |
|
191 | |||
192 | check: first |
|
192 | check: first | |
193 |
|
193 | |||
194 | compiler_rcc_make_all: |
|
194 | compiler_rcc_make_all: | |
195 | compiler_rcc_clean: |
|
195 | compiler_rcc_clean: | |
196 | compiler_uic_make_all: |
|
196 | compiler_uic_make_all: | |
197 | compiler_uic_clean: |
|
197 | compiler_uic_clean: | |
198 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
198 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
199 | compiler_image_collection_clean: |
|
199 | compiler_image_collection_clean: | |
200 | -$(DEL_FILE) qmake_image_collection.cpp |
|
200 | -$(DEL_FILE) qmake_image_collection.cpp | |
201 | compiler_yacc_decl_make_all: |
|
201 | compiler_yacc_decl_make_all: | |
202 | compiler_yacc_decl_clean: |
|
202 | compiler_yacc_decl_clean: | |
203 | compiler_yacc_impl_make_all: |
|
203 | compiler_yacc_impl_make_all: | |
204 | compiler_yacc_impl_clean: |
|
204 | compiler_yacc_impl_clean: | |
205 | compiler_lex_make_all: |
|
205 | compiler_lex_make_all: | |
206 | compiler_lex_clean: |
|
206 | compiler_lex_clean: | |
207 | compiler_clean: |
|
207 | compiler_clean: | |
208 |
|
208 | |||
209 | ####### Compile |
|
209 | ####### Compile | |
210 |
|
210 | |||
211 | obj/wf_handler.o: ../src/wf_handler.c |
|
211 | obj/wf_handler.o: ../src/wf_handler.c | |
212 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
212 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c | |
213 |
|
213 | |||
214 | obj/tc_handler.o: ../src/tc_handler.c |
|
214 | obj/tc_handler.o: ../src/tc_handler.c | |
215 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
215 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c | |
216 |
|
216 | |||
217 | obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c |
|
217 | obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c | |
218 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c |
|
218 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c | |
219 |
|
219 | |||
220 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
220 | obj/fsw_misc.o: ../src/fsw_misc.c | |
221 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
221 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c | |
222 |
|
222 | |||
223 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c |
|
223 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c | |
224 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
224 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c | |
225 |
|
225 | |||
226 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
226 | obj/fsw_globals.o: ../src/fsw_globals.c | |
227 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
227 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
228 |
|
228 | |||
229 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c |
|
229 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c | |
230 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c |
|
230 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c | |
231 |
|
231 | |||
232 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c |
|
232 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c | |
233 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c |
|
233 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c | |
234 |
|
234 | |||
235 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c |
|
235 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c | |
236 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c |
|
236 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c | |
237 |
|
237 | |||
238 | obj/tc_acceptance.o: ../src/tc_acceptance.c |
|
238 | obj/tc_acceptance.o: ../src/tc_acceptance.c | |
239 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c |
|
239 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c | |
240 |
|
240 | |||
241 | ####### Install |
|
241 | ####### Install | |
242 |
|
242 | |||
243 | install: FORCE |
|
243 | install: FORCE | |
244 |
|
244 | |||
245 | uninstall: FORCE |
|
245 | uninstall: FORCE | |
246 |
|
246 | |||
247 | FORCE: |
|
247 | FORCE: | |
248 |
|
248 |
@@ -1,78 +1,78 | |||||
1 | TEMPLATE = app |
|
1 | TEMPLATE = app | |
2 | # CONFIG += console v8 sim |
|
2 | # CONFIG += console v8 sim | |
3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa |
|
3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa | |
4 | CONFIG += console verbose |
|
4 | CONFIG += console verbose | |
5 | CONFIG -= qt |
|
5 | CONFIG -= qt | |
6 |
|
6 | |||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) | |
8 |
|
8 | |||
9 | # flight software version |
|
9 | # flight software version | |
10 |
SWVERSION=-0-2 |
|
10 | SWVERSION=-0-22 | |
11 | DEFINES += SW_VERSION_N1=0 |
|
11 | DEFINES += SW_VERSION_N1=0 | |
12 | DEFINES += SW_VERSION_N2=0 |
|
12 | DEFINES += SW_VERSION_N2=0 | |
13 | DEFINES += SW_VERSION_N3=0 |
|
13 | DEFINES += SW_VERSION_N3=0 | |
14 |
DEFINES += SW_VERSION_N4=2 |
|
14 | DEFINES += SW_VERSION_N4=22 | |
15 |
|
15 | |||
16 | contains( CONFIG, verbose ) { |
|
16 | contains( CONFIG, verbose ) { | |
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
|
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE | |
18 | } |
|
18 | } | |
19 |
|
19 | |||
20 | contains( CONFIG, debug_messages ) { |
|
20 | contains( CONFIG, debug_messages ) { | |
21 | DEFINES += DEBUG_MESSAGES |
|
21 | DEFINES += DEBUG_MESSAGES | |
22 | } |
|
22 | } | |
23 |
|
23 | |||
24 | contains( CONFIG, cpu_usage_report ) { |
|
24 | contains( CONFIG, cpu_usage_report ) { | |
25 | DEFINES += PRINT_TASK_STATISTICS |
|
25 | DEFINES += PRINT_TASK_STATISTICS | |
26 | } |
|
26 | } | |
27 |
|
27 | |||
28 | contains( CONFIG, stack_report ) { |
|
28 | contains( CONFIG, stack_report ) { | |
29 | DEFINES += PRINT_STACK_REPORT |
|
29 | DEFINES += PRINT_STACK_REPORT | |
30 | } |
|
30 | } | |
31 |
|
31 | |||
32 | contains( CONFIG, boot_messages ) { |
|
32 | contains( CONFIG, boot_messages ) { | |
33 | DEFINES += BOOT_MESSAGES |
|
33 | DEFINES += BOOT_MESSAGES | |
34 | } |
|
34 | } | |
35 |
|
35 | |||
36 | #doxygen.target = doxygen |
|
36 | #doxygen.target = doxygen | |
37 | #doxygen.commands = doxygen ../doc/Doxyfile |
|
37 | #doxygen.commands = doxygen ../doc/Doxyfile | |
38 | #QMAKE_EXTRA_TARGETS += doxygen |
|
38 | #QMAKE_EXTRA_TARGETS += doxygen | |
39 |
|
39 | |||
40 | TARGET = fsw |
|
40 | TARGET = fsw | |
41 | contains( CONFIG, gsa ) { |
|
41 | contains( CONFIG, gsa ) { | |
42 | DEFINES += GSA |
|
42 | DEFINES += GSA | |
43 | TARGET = fsw-gsa |
|
43 | TARGET = fsw-gsa | |
44 | } |
|
44 | } | |
45 |
|
45 | |||
46 | INCLUDEPATH += \ |
|
46 | INCLUDEPATH += \ | |
47 | ../src \ |
|
47 | ../src \ | |
48 | ../header |
|
48 | ../header | |
49 |
|
49 | |||
50 | SOURCES += \ |
|
50 | SOURCES += \ | |
51 | ../src/wf_handler.c \ |
|
51 | ../src/wf_handler.c \ | |
52 | ../src/tc_handler.c \ |
|
52 | ../src/tc_handler.c \ | |
53 | ../src/fsw_processing.c \ |
|
53 | ../src/fsw_processing.c \ | |
54 | ../src/fsw_misc.c \ |
|
54 | ../src/fsw_misc.c \ | |
55 | ../src/fsw_init.c \ |
|
55 | ../src/fsw_init.c \ | |
56 | ../src/fsw_globals.c \ |
|
56 | ../src/fsw_globals.c \ | |
57 | ../src/fsw_spacewire.c \ |
|
57 | ../src/fsw_spacewire.c \ | |
58 | ../src/tc_load_dump_parameters.c \ |
|
58 | ../src/tc_load_dump_parameters.c \ | |
59 | ../src/tm_lfr_tc_exe.c \ |
|
59 | ../src/tm_lfr_tc_exe.c \ | |
60 | ../src/tc_acceptance.c |
|
60 | ../src/tc_acceptance.c | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | HEADERS += \ |
|
63 | HEADERS += \ | |
64 | ../header/wf_handler.h \ |
|
64 | ../header/wf_handler.h \ | |
65 | ../header/tc_handler.h \ |
|
65 | ../header/tc_handler.h \ | |
66 | ../header/grlib_regs.h \ |
|
66 | ../header/grlib_regs.h \ | |
67 | ../header/fsw_processing.h \ |
|
67 | ../header/fsw_processing.h \ | |
68 | ../header/fsw_params.h \ |
|
68 | ../header/fsw_params.h \ | |
69 | ../header/fsw_misc.h \ |
|
69 | ../header/fsw_misc.h \ | |
70 | ../header/fsw_init.h \ |
|
70 | ../header/fsw_init.h \ | |
71 | ../header/ccsds_types.h \ |
|
71 | ../header/ccsds_types.h \ | |
72 | ../header/fsw_params_processing.h \ |
|
72 | ../header/fsw_params_processing.h \ | |
73 | ../header/fsw_spacewire.h \ |
|
73 | ../header/fsw_spacewire.h \ | |
74 | ../header/tm_byte_positions.h \ |
|
74 | ../header/tm_byte_positions.h \ | |
75 | ../header/tc_load_dump_parameters.h \ |
|
75 | ../header/tc_load_dump_parameters.h \ | |
76 | ../header/tm_lfr_tc_exe.h \ |
|
76 | ../header/tm_lfr_tc_exe.h \ | |
77 | ../header/tc_acceptance.h |
|
77 | ../header/tc_acceptance.h | |
78 |
|
78 |
@@ -1,305 +1,305 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 2.8.1, 2013-11-1 |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-11-13T08:16:16. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> | |
7 | <value type="int">0</value> |
|
7 | <value type="int">0</value> | |
8 | </data> |
|
8 | </data> | |
9 | <data> |
|
9 | <data> | |
10 | <variable>ProjectExplorer.Project.EditorSettings</variable> |
|
10 | <variable>ProjectExplorer.Project.EditorSettings</variable> | |
11 | <valuemap type="QVariantMap"> |
|
11 | <valuemap type="QVariantMap"> | |
12 | <value type="bool" key="EditorConfiguration.AutoIndent">true</value> |
|
12 | <value type="bool" key="EditorConfiguration.AutoIndent">true</value> | |
13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|
13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> | |
14 | <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> |
|
14 | <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> | |
15 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|
15 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> | |
16 | <value type="QString" key="language">Cpp</value> |
|
16 | <value type="QString" key="language">Cpp</value> | |
17 | <valuemap type="QVariantMap" key="value"> |
|
17 | <valuemap type="QVariantMap" key="value"> | |
18 | <value type="QString" key="CurrentPreferences">CppGlobal</value> |
|
18 | <value type="QString" key="CurrentPreferences">CppGlobal</value> | |
19 | </valuemap> |
|
19 | </valuemap> | |
20 | </valuemap> |
|
20 | </valuemap> | |
21 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|
21 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> | |
22 | <value type="QString" key="language">QmlJS</value> |
|
22 | <value type="QString" key="language">QmlJS</value> | |
23 | <valuemap type="QVariantMap" key="value"> |
|
23 | <valuemap type="QVariantMap" key="value"> | |
24 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> |
|
24 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> | |
25 | </valuemap> |
|
25 | </valuemap> | |
26 | </valuemap> |
|
26 | </valuemap> | |
27 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|
27 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> | |
28 | <value type="QByteArray" key="EditorConfiguration.Codec">System</value> |
|
28 | <value type="QByteArray" key="EditorConfiguration.Codec">System</value> | |
29 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|
29 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> | |
30 | <value type="int" key="EditorConfiguration.IndentSize">4</value> |
|
30 | <value type="int" key="EditorConfiguration.IndentSize">4</value> | |
31 | <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> |
|
31 | <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> | |
32 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|
32 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> | |
33 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|
33 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> | |
34 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|
34 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> | |
35 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|
35 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> | |
36 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|
36 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> | |
37 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|
37 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> | |
38 | <value type="int" key="EditorConfiguration.TabSize">8</value> |
|
38 | <value type="int" key="EditorConfiguration.TabSize">8</value> | |
39 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|
39 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> | |
40 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|
40 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> | |
41 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|
41 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> | |
42 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|
42 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> | |
43 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|
43 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> | |
44 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|
44 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> | |
45 | </valuemap> |
|
45 | </valuemap> | |
46 | </data> |
|
46 | </data> | |
47 | <data> |
|
47 | <data> | |
48 | <variable>ProjectExplorer.Project.PluginSettings</variable> |
|
48 | <variable>ProjectExplorer.Project.PluginSettings</variable> | |
49 | <valuemap type="QVariantMap"/> |
|
49 | <valuemap type="QVariantMap"/> | |
50 | </data> |
|
50 | </data> | |
51 | <data> |
|
51 | <data> | |
52 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
52 | <variable>ProjectExplorer.Project.Target.0</variable> | |
53 | <valuemap type="QVariantMap"> |
|
53 | <valuemap type="QVariantMap"> | |
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> | |
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> | |
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> |
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> | |
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value> |
|
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value> | |
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
61 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
61 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
63 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
63 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
67 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
67 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> | |
69 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
69 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
70 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
70 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
71 | </valuemap> |
|
71 | </valuemap> | |
72 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
72 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
73 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
73 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
74 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
74 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
77 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
77 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
78 | <value type="QString">-w</value> |
|
78 | <value type="QString">-w</value> | |
79 | <value type="QString">-r</value> |
|
79 | <value type="QString">-r</value> | |
80 | </valuelist> |
|
80 | </valuelist> | |
81 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
81 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
82 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value> |
|
82 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value> | |
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
84 | </valuemap> |
|
84 | </valuemap> | |
85 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
85 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
89 | </valuemap> |
|
89 | </valuemap> | |
90 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
90 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
92 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
92 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
96 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
96 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
97 | <value type="QString">-w</value> |
|
97 | <value type="QString">-w</value> | |
98 | <value type="QString">-r</value> |
|
98 | <value type="QString">-r</value> | |
99 | </valuelist> |
|
99 | </valuelist> | |
100 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
100 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
101 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value> |
|
101 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value> | |
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
103 | </valuemap> |
|
103 | </valuemap> | |
104 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
104 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
105 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
105 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
108 | </valuemap> |
|
108 | </valuemap> | |
109 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
109 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
110 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
110 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
111 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
111 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> |
|
112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> | |
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
115 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
115 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
116 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
116 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
118 | </valuemap> |
|
118 | </valuemap> | |
119 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|
119 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> | |
120 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
120 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
122 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
122 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
126 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
126 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
127 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
127 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> | |
128 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
128 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
129 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
129 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
130 | </valuemap> |
|
130 | </valuemap> | |
131 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
131 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
132 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
132 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
133 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
133 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
134 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
134 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
136 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
136 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
137 | <value type="QString">-w</value> |
|
137 | <value type="QString">-w</value> | |
138 | <value type="QString">-r</value> |
|
138 | <value type="QString">-r</value> | |
139 | </valuelist> |
|
139 | </valuelist> | |
140 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
140 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
141 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value> |
|
141 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value> | |
142 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
142 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
143 | </valuemap> |
|
143 | </valuemap> | |
144 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
144 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
146 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
146 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
147 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
147 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
148 | </valuemap> |
|
148 | </valuemap> | |
149 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
149 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
150 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
150 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
151 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
151 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
153 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
153 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
154 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
154 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
155 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
155 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
156 | <value type="QString">-w</value> |
|
156 | <value type="QString">-w</value> | |
157 | <value type="QString">-r</value> |
|
157 | <value type="QString">-r</value> | |
158 | </valuelist> |
|
158 | </valuelist> | |
159 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
159 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
160 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value> |
|
160 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value> | |
161 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
161 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
162 | </valuemap> |
|
162 | </valuemap> | |
163 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
163 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
165 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
165 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
166 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
166 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
167 | </valuemap> |
|
167 | </valuemap> | |
168 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
168 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
169 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
169 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
170 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
170 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> |
|
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> | |
172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
174 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|
174 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> | |
175 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
175 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
176 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
176 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
177 | </valuemap> |
|
177 | </valuemap> | |
178 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> |
|
178 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> | |
179 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
179 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
180 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
180 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
181 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
181 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
182 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
182 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
183 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
183 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
184 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|
184 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
185 | </valuemap> |
|
185 | </valuemap> | |
186 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
186 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
187 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> |
|
187 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> | |
188 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
188 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
189 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
189 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
190 | </valuemap> |
|
190 | </valuemap> | |
191 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
191 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
192 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|
192 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
193 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
193 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
194 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
194 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
196 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
196 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
197 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
197 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
198 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
198 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
199 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
199 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
200 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
200 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
201 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
201 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
202 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
202 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
203 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
203 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
204 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
204 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
205 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
205 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
206 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
206 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
207 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
207 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
208 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
208 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
209 | <value type="int">0</value> |
|
209 | <value type="int">0</value> | |
210 | <value type="int">1</value> |
|
210 | <value type="int">1</value> | |
211 | <value type="int">2</value> |
|
211 | <value type="int">2</value> | |
212 | <value type="int">3</value> |
|
212 | <value type="int">3</value> | |
213 | <value type="int">4</value> |
|
213 | <value type="int">4</value> | |
214 | <value type="int">5</value> |
|
214 | <value type="int">5</value> | |
215 | <value type="int">6</value> |
|
215 | <value type="int">6</value> | |
216 | <value type="int">7</value> |
|
216 | <value type="int">7</value> | |
217 | <value type="int">8</value> |
|
217 | <value type="int">8</value> | |
218 | <value type="int">9</value> |
|
218 | <value type="int">9</value> | |
219 | <value type="int">10</value> |
|
219 | <value type="int">10</value> | |
220 | <value type="int">11</value> |
|
220 | <value type="int">11</value> | |
221 | <value type="int">12</value> |
|
221 | <value type="int">12</value> | |
222 | <value type="int">13</value> |
|
222 | <value type="int">13</value> | |
223 | <value type="int">14</value> |
|
223 | <value type="int">14</value> | |
224 | </valuelist> |
|
224 | </valuelist> | |
225 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
225 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
226 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
226 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
227 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
227 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> | |
228 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
228 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
229 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> |
|
229 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> | |
230 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
230 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
231 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
231 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
232 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
232 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
233 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
233 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
234 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
234 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
235 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
235 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
236 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
236 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> | |
237 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> |
|
237 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> | |
238 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
238 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
239 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
239 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
240 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> |
|
240 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> | |
241 | </valuemap> |
|
241 | </valuemap> | |
242 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1"> |
|
242 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1"> | |
243 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
243 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
244 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
244 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
245 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
245 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
246 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
246 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
247 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
247 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
248 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
248 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
249 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
249 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
250 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
250 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
251 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
251 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
252 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
252 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
253 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
253 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
254 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
254 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
255 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
255 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
256 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
256 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
257 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
257 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
258 | <value type="int">0</value> |
|
258 | <value type="int">0</value> | |
259 | <value type="int">1</value> |
|
259 | <value type="int">1</value> | |
260 | <value type="int">2</value> |
|
260 | <value type="int">2</value> | |
261 | <value type="int">3</value> |
|
261 | <value type="int">3</value> | |
262 | <value type="int">4</value> |
|
262 | <value type="int">4</value> | |
263 | <value type="int">5</value> |
|
263 | <value type="int">5</value> | |
264 | <value type="int">6</value> |
|
264 | <value type="int">6</value> | |
265 | <value type="int">7</value> |
|
265 | <value type="int">7</value> | |
266 | <value type="int">8</value> |
|
266 | <value type="int">8</value> | |
267 | <value type="int">9</value> |
|
267 | <value type="int">9</value> | |
268 | <value type="int">10</value> |
|
268 | <value type="int">10</value> | |
269 | <value type="int">11</value> |
|
269 | <value type="int">11</value> | |
270 | <value type="int">12</value> |
|
270 | <value type="int">12</value> | |
271 | <value type="int">13</value> |
|
271 | <value type="int">13</value> | |
272 | <value type="int">14</value> |
|
272 | <value type="int">14</value> | |
273 | </valuelist> |
|
273 | </valuelist> | |
274 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
274 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
275 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
275 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
276 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> |
|
276 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> | |
277 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value> |
|
277 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value> | |
278 | <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value> |
|
278 | <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value> | |
279 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value> |
|
279 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value> | |
280 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value> |
|
280 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value> | |
281 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
281 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
282 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> |
|
282 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> | |
283 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
283 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
284 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
284 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> | |
285 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> |
|
285 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> | |
286 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
286 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
287 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
287 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
288 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
288 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> | |
289 | </valuemap> |
|
289 | </valuemap> | |
290 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value> |
|
290 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value> | |
291 | </valuemap> |
|
291 | </valuemap> | |
292 | </data> |
|
292 | </data> | |
293 | <data> |
|
293 | <data> | |
294 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
294 | <variable>ProjectExplorer.Project.TargetCount</variable> | |
295 | <value type="int">1</value> |
|
295 | <value type="int">1</value> | |
296 | </data> |
|
296 | </data> | |
297 | <data> |
|
297 | <data> | |
298 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
298 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> | |
299 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> |
|
299 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> | |
300 | </data> |
|
300 | </data> | |
301 | <data> |
|
301 | <data> | |
302 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
302 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> | |
303 | <value type="int">14</value> |
|
303 | <value type="int">14</value> | |
304 | </data> |
|
304 | </data> | |
305 | </qtcreator> |
|
305 | </qtcreator> |
@@ -1,28 +1,28 | |||||
1 | #ifndef TM_LFR_TC_EXE_H_INCLUDED |
|
1 | #ifndef TM_LFR_TC_EXE_H_INCLUDED | |
2 | #define TM_LFR_TC_EXE_H_INCLUDED |
|
2 | #define TM_LFR_TC_EXE_H_INCLUDED | |
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 "fsw_spacewire.h" |
|
8 | #include "fsw_spacewire.h" | |
9 |
|
9 | |||
10 | extern time_management_regs_t *time_management_regs; |
|
10 | extern time_management_regs_t *time_management_regs; | |
11 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
11 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
12 | extern unsigned short sequenceCounters_TC_EXE[]; |
|
12 | extern unsigned short sequenceCounters_TC_EXE[]; | |
13 |
|
13 | |||
14 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
14 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
15 | int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
15 | int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
16 | unsigned char byte_position, unsigned char rcv_value); |
|
16 | unsigned char byte_position, unsigned char rcv_value); | |
17 | int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
17 | int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
18 | int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
18 | int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
19 | int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
19 | int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
20 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
20 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
21 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV); |
|
21 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID); | |
22 |
|
22 | |||
23 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ); |
|
23 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ); | |
24 |
|
24 | |||
25 | #endif // TM_LFR_TC_EXE_H_INCLUDED |
|
25 | #endif // TM_LFR_TC_EXE_H_INCLUDED | |
26 |
|
26 | |||
27 |
|
27 | |||
28 |
|
28 |
@@ -1,612 +1,621 | |||||
1 | /** Functions related to the SpaceWire interface. |
|
1 | /** Functions related to the SpaceWire interface. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to handle SpaceWire transmissions: |
|
6 | * A group of functions to handle SpaceWire transmissions: | |
7 | * - configuration of the SpaceWire link |
|
7 | * - configuration of the SpaceWire link | |
8 | * - SpaceWire related interruption requests processing |
|
8 | * - SpaceWire related interruption requests processing | |
9 | * - transmission of TeleMetry packets by a dedicated RTEMS task |
|
9 | * - transmission of TeleMetry packets by a dedicated RTEMS task | |
10 | * - reception of TeleCommands by a dedicated RTEMS task |
|
10 | * - reception of TeleCommands by a dedicated RTEMS task | |
11 | * |
|
11 | * | |
12 | */ |
|
12 | */ | |
13 |
|
13 | |||
14 | #include "fsw_spacewire.h" |
|
14 | #include "fsw_spacewire.h" | |
15 |
|
15 | |||
16 | char *lstates[6] = {"Error-reset", |
|
16 | char *lstates[6] = {"Error-reset", | |
17 | "Error-wait", |
|
17 | "Error-wait", | |
18 | "Ready", |
|
18 | "Ready", | |
19 | "Started", |
|
19 | "Started", | |
20 | "Connecting", |
|
20 | "Connecting", | |
21 | "Run" |
|
21 | "Run" | |
22 | }; |
|
22 | }; | |
23 |
|
23 | |||
24 | rtems_name semq_name; |
|
24 | rtems_name semq_name; | |
25 | rtems_id semq_id; |
|
25 | rtems_id semq_id; | |
26 |
|
26 | |||
27 | //*********** |
|
27 | //*********** | |
28 | // RTEMS TASK |
|
28 | // RTEMS TASK | |
29 | rtems_task spiq_task(rtems_task_argument unused) |
|
29 | rtems_task spiq_task(rtems_task_argument unused) | |
30 | { |
|
30 | { | |
31 | /** This RTEMS task is awaken by an rtems_event sent by the interruption subroutine of the SpaceWire driver. |
|
31 | /** This RTEMS task is awaken by an rtems_event sent by the interruption subroutine of the SpaceWire driver. | |
32 | * |
|
32 | * | |
33 | * @param unused is the starting argument of the RTEMS task |
|
33 | * @param unused is the starting argument of the RTEMS task | |
34 | * |
|
34 | * | |
35 | */ |
|
35 | */ | |
36 |
|
36 | |||
37 | rtems_event_set event_out; |
|
37 | rtems_event_set event_out; | |
38 | rtems_status_code status; |
|
38 | rtems_status_code status; | |
39 | int linkStatus; |
|
39 | int linkStatus; | |
40 |
|
40 | |||
41 | BOOT_PRINTF("in SPIQ *** \n") |
|
41 | BOOT_PRINTF("in SPIQ *** \n") | |
42 |
|
42 | |||
43 | while(true){ |
|
43 | while(true){ | |
44 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT |
|
44 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT | |
45 | PRINTF("in SPIQ *** got SPW_LINKERR_EVENT\n") |
|
45 | PRINTF("in SPIQ *** got SPW_LINKERR_EVENT\n") | |
46 |
|
46 | |||
47 | // [0] SUSPEND RECV AND SEND TASKS |
|
47 | // [0] SUSPEND RECV AND SEND TASKS | |
48 | rtems_task_suspend( Task_id[ TASKID_RECV ] ); |
|
48 | rtems_task_suspend( Task_id[ TASKID_RECV ] ); | |
49 | rtems_task_suspend( Task_id[ TASKID_SEND ] ); |
|
49 | rtems_task_suspend( Task_id[ TASKID_SEND ] ); | |
50 |
|
50 | |||
51 | // [1] CHECK THE LINK |
|
51 | // [1] CHECK THE LINK | |
52 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (1) |
|
52 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (1) | |
53 | if ( linkStatus != 5) { |
|
53 | if ( linkStatus != 5) { | |
54 | PRINTF1("in SPIQ *** linkStatus %d, wait...\n", linkStatus) |
|
54 | PRINTF1("in SPIQ *** linkStatus %d, wait...\n", linkStatus) | |
55 | rtems_task_wake_after( SY_LFR_DPU_CONNECT_TIMEOUT ); // wait SY_LFR_DPU_CONNECT_TIMEOUT 1000 ms |
|
55 | rtems_task_wake_after( SY_LFR_DPU_CONNECT_TIMEOUT ); // wait SY_LFR_DPU_CONNECT_TIMEOUT 1000 ms | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | // [2] RECHECK THE LINK AFTER SY_LFR_DPU_CONNECT_TIMEOUT |
|
58 | // [2] RECHECK THE LINK AFTER SY_LFR_DPU_CONNECT_TIMEOUT | |
59 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (2) |
|
59 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status (2) | |
60 | if ( linkStatus != 5 ) // [2.a] not in run state, reset the link |
|
60 | if ( linkStatus != 5 ) // [2.a] not in run state, reset the link | |
61 | { |
|
61 | { | |
62 | spacewire_compute_stats_offsets(); |
|
62 | spacewire_compute_stats_offsets(); | |
63 | status = spacewire_reset_link( ); |
|
63 | status = spacewire_reset_link( ); | |
64 | } |
|
64 | } | |
65 | else // [2.b] in run state, start the link |
|
65 | else // [2.b] in run state, start the link | |
66 | { |
|
66 | { | |
67 | status = spacewire_stop_start_link( fdSPW ); // start the link |
|
67 | status = spacewire_stop_start_link( fdSPW ); // start the link | |
68 | if ( status != RTEMS_SUCCESSFUL) |
|
68 | if ( status != RTEMS_SUCCESSFUL) | |
69 | { |
|
69 | { | |
70 | PRINTF1("in SPIQ *** ERR spacewire_start_link %d\n", status) |
|
70 | PRINTF1("in SPIQ *** ERR spacewire_start_link %d\n", status) | |
71 | } |
|
71 | } | |
72 | } |
|
72 | } | |
73 |
|
73 | |||
74 | // [3] COMPLETE RECOVERY ACTION AFTER SY_LFR_DPU_CONNECT_ATTEMPTS |
|
74 | // [3] COMPLETE RECOVERY ACTION AFTER SY_LFR_DPU_CONNECT_ATTEMPTS | |
75 | if ( status == RTEMS_SUCCESSFUL ) // [3.a] the link is in run state and has been started successfully |
|
75 | if ( status == RTEMS_SUCCESSFUL ) // [3.a] the link is in run state and has been started successfully | |
76 | { |
|
76 | { | |
77 | status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 ); |
|
77 | status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 ); | |
78 | if ( status != RTEMS_SUCCESSFUL ) { |
|
78 | if ( status != RTEMS_SUCCESSFUL ) { | |
79 | PRINTF("in SPIQ *** ERR resuming SEND Task\n") |
|
79 | PRINTF("in SPIQ *** ERR resuming SEND Task\n") | |
80 | } |
|
80 | } | |
81 | status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 ); |
|
81 | status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 ); | |
82 | if ( status != RTEMS_SUCCESSFUL ) { |
|
82 | if ( status != RTEMS_SUCCESSFUL ) { | |
83 | PRINTF("in SPIQ *** ERR resuming RECV Task\n") |
|
83 | PRINTF("in SPIQ *** ERR resuming RECV Task\n") | |
84 | } |
|
84 | } | |
85 | } |
|
85 | } | |
86 | else // [3.b] the link is not in run state, go in STANDBY mode |
|
86 | else // [3.b] the link is not in run state, go in STANDBY mode | |
87 | { |
|
87 | { | |
88 | status = stop_current_mode(); |
|
88 | status = stop_current_mode(); | |
89 | if ( status != RTEMS_SUCCESSFUL ) { |
|
89 | if ( status != RTEMS_SUCCESSFUL ) { | |
90 | PRINTF1("in SPIQ *** ERR stop_current_mode *** code %d\n", status) |
|
90 | PRINTF1("in SPIQ *** ERR stop_current_mode *** code %d\n", status) | |
91 | } |
|
91 | } | |
92 | status = enter_standby_mode(); |
|
92 | status = enter_standby_mode(); | |
93 | if ( status != RTEMS_SUCCESSFUL ) { |
|
93 | if ( status != RTEMS_SUCCESSFUL ) { | |
94 | PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status) |
|
94 | PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status) | |
95 | } |
|
95 | } | |
96 | // wake the WTDG task up to wait for the link recovery |
|
96 | // wake the WTDG task up to wait for the link recovery | |
97 | status = rtems_event_send ( Task_id[TASKID_WTDG], RTEMS_EVENT_0 ); |
|
97 | status = rtems_event_send ( Task_id[TASKID_WTDG], RTEMS_EVENT_0 ); | |
98 | rtems_task_suspend( RTEMS_SELF ); |
|
98 | rtems_task_suspend( RTEMS_SELF ); | |
99 | } |
|
99 | } | |
100 | } |
|
100 | } | |
101 | } |
|
101 | } | |
102 |
|
102 | |||
103 | rtems_task recv_task( rtems_task_argument unused ) |
|
103 | rtems_task recv_task( rtems_task_argument unused ) | |
104 | { |
|
104 | { | |
105 | /** This RTEMS task is dedicated to the reception of incoming TeleCommands. |
|
105 | /** This RTEMS task is dedicated to the reception of incoming TeleCommands. | |
106 | * |
|
106 | * | |
107 | * @param unused is the starting argument of the RTEMS task |
|
107 | * @param unused is the starting argument of the RTEMS task | |
108 | * |
|
108 | * | |
109 | * The RECV task blocks on a call to the read system call, waiting for incoming SpaceWire data. When unblocked: |
|
109 | * The RECV task blocks on a call to the read system call, waiting for incoming SpaceWire data. When unblocked: | |
110 | * 1. It reads the incoming data. |
|
110 | * 1. It reads the incoming data. | |
111 | * 2. Launches the acceptance procedure. |
|
111 | * 2. Launches the acceptance procedure. | |
112 | * 3. If the Telecommand is valid, sends it to a dedicated RTEMS message queue. |
|
112 | * 3. If the Telecommand is valid, sends it to a dedicated RTEMS message queue. | |
113 | * |
|
113 | * | |
114 | */ |
|
114 | */ | |
115 |
|
115 | |||
116 | int len; |
|
116 | int len; | |
117 | ccsdsTelecommandPacket_t currentTC; |
|
117 | ccsdsTelecommandPacket_t currentTC; | |
118 | unsigned char computed_CRC[ 2 ]; |
|
118 | unsigned char computed_CRC[ 2 ]; | |
119 | unsigned char currentTC_LEN_RCV[ 2 ]; |
|
119 | unsigned char currentTC_LEN_RCV[ 2 ]; | |
|
120 | unsigned char destinationID; | |||
120 | unsigned int currentTC_LEN_RCV_AsUnsignedInt; |
|
121 | unsigned int currentTC_LEN_RCV_AsUnsignedInt; | |
121 | unsigned int parserCode; |
|
122 | unsigned int parserCode; | |
122 | rtems_status_code status; |
|
123 | rtems_status_code status; | |
123 | rtems_id queue_recv_id; |
|
124 | rtems_id queue_recv_id; | |
124 | rtems_id queue_send_id; |
|
125 | rtems_id queue_send_id; | |
125 |
|
126 | |||
126 | initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes |
|
127 | initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes | |
127 |
|
128 | |||
128 | status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id ); |
|
129 | status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id ); | |
129 | if (status != RTEMS_SUCCESSFUL) |
|
130 | if (status != RTEMS_SUCCESSFUL) | |
130 | { |
|
131 | { | |
131 | PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status) |
|
132 | PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status) | |
132 | } |
|
133 | } | |
133 |
|
134 | |||
134 | status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id ); |
|
135 | status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id ); | |
135 | if (status != RTEMS_SUCCESSFUL) |
|
136 | if (status != RTEMS_SUCCESSFUL) | |
136 | { |
|
137 | { | |
137 | PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status) |
|
138 | PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status) | |
138 | } |
|
139 | } | |
139 |
|
140 | |||
140 | BOOT_PRINTF("in RECV *** \n") |
|
141 | BOOT_PRINTF("in RECV *** \n") | |
141 |
|
142 | |||
142 | while(1) |
|
143 | while(1) | |
143 | { |
|
144 | { | |
144 | len = read( fdSPW, (char*) ¤tTC, CCSDS_TC_PKT_MAX_SIZE ); // the call to read is blocking |
|
145 | len = read( fdSPW, (char*) ¤tTC, CCSDS_TC_PKT_MAX_SIZE ); // the call to read is blocking | |
145 | if (len == -1){ // error during the read call |
|
146 | if (len == -1){ // error during the read call | |
146 | PRINTF1("in RECV *** last read call returned -1, ERRNO %d\n", errno) |
|
147 | PRINTF1("in RECV *** last read call returned -1, ERRNO %d\n", errno) | |
147 | } |
|
148 | } | |
148 | else { |
|
149 | else { | |
149 | if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) { |
|
150 | if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) { | |
150 | PRINTF("in RECV *** packet lenght too short\n") |
|
151 | PRINTF("in RECV *** packet lenght too short\n") | |
151 | } |
|
152 | } | |
152 | else { |
|
153 | else { | |
153 | currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes |
|
154 | currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes | |
154 | currentTC_LEN_RCV[ 0 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt >> 8); |
|
155 | currentTC_LEN_RCV[ 0 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt >> 8); | |
155 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt ); |
|
156 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt ); | |
156 | // CHECK THE TC |
|
157 | // CHECK THE TC | |
157 | parserCode = tc_parser( ¤tTC, currentTC_LEN_RCV_AsUnsignedInt, computed_CRC ) ; |
|
158 | parserCode = tc_parser( ¤tTC, currentTC_LEN_RCV_AsUnsignedInt, computed_CRC ) ; | |
158 | if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_PKT) |
|
159 | if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_PKT) | |
159 | || (parserCode == INCOR_CHECKSUM) || (parserCode == ILL_TYPE) |
|
160 | || (parserCode == INCOR_CHECKSUM) || (parserCode == ILL_TYPE) | |
160 | || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) |
|
161 | || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) | |
161 | || (parserCode == WRONG_SRC_ID) ) |
|
162 | || (parserCode == WRONG_SRC_ID) ) | |
162 | { // send TM_LFR_TC_EXE_CORRUPTED |
|
163 | { // send TM_LFR_TC_EXE_CORRUPTED | |
163 | if ( !( (currentTC.serviceType==TC_TYPE_TIME) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_TIME) ) |
|
164 | if ( !( (currentTC.serviceType==TC_TYPE_TIME) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_TIME) ) | |
164 | && |
|
165 | && | |
165 | !( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO)) |
|
166 | !( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO)) | |
166 | ) |
|
167 | ) | |
167 | { |
|
168 | { | |
168 | send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV ); |
|
169 | if ( parserCode == WRONG_SRC_ID ) | |
|
170 | { | |||
|
171 | destinationID = SID_TC_GROUND; | |||
|
172 | } | |||
|
173 | else | |||
|
174 | { | |||
|
175 | destinationID = currentTC.sourceID; | |||
|
176 | } | |||
|
177 | send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV, destinationID ); | |||
169 | } |
|
178 | } | |
170 | } |
|
179 | } | |
171 | else |
|
180 | else | |
172 | { // send valid TC to the action launcher |
|
181 | { // send valid TC to the action launcher | |
173 | status = rtems_message_queue_send( queue_recv_id, ¤tTC, |
|
182 | status = rtems_message_queue_send( queue_recv_id, ¤tTC, | |
174 | currentTC_LEN_RCV_AsUnsignedInt + CCSDS_TC_TM_PACKET_OFFSET + 3); |
|
183 | currentTC_LEN_RCV_AsUnsignedInt + CCSDS_TC_TM_PACKET_OFFSET + 3); | |
175 | } |
|
184 | } | |
176 | } |
|
185 | } | |
177 | } |
|
186 | } | |
178 | } |
|
187 | } | |
179 | } |
|
188 | } | |
180 |
|
189 | |||
181 | rtems_task send_task( rtems_task_argument argument) |
|
190 | rtems_task send_task( rtems_task_argument argument) | |
182 | { |
|
191 | { | |
183 | /** This RTEMS task is dedicated to the transmission of TeleMetry packets. |
|
192 | /** This RTEMS task is dedicated to the transmission of TeleMetry packets. | |
184 | * |
|
193 | * | |
185 | * @param unused is the starting argument of the RTEMS task |
|
194 | * @param unused is the starting argument of the RTEMS task | |
186 | * |
|
195 | * | |
187 | * The SEND task waits for a message to become available in the dedicated RTEMS queue. When a message arrives: |
|
196 | * The SEND task waits for a message to become available in the dedicated RTEMS queue. When a message arrives: | |
188 | * - if the first byte is equal to CCSDS_DESTINATION_ID, the message is sent as is using the write system call. |
|
197 | * - if the first byte is equal to CCSDS_DESTINATION_ID, the message is sent as is using the write system call. | |
189 | * - if the first byte is not equal to CCSDS_DESTINATION_ID, the message is handled as a spw_ioctl_pkt_send. After |
|
198 | * - if the first byte is not equal to CCSDS_DESTINATION_ID, the message is handled as a spw_ioctl_pkt_send. After | |
190 | * analyzis, the packet is sent either using the write system call or using the ioctl call SPACEWIRE_IOCTRL_SEND, depending on the |
|
199 | * analyzis, the packet is sent either using the write system call or using the ioctl call SPACEWIRE_IOCTRL_SEND, depending on the | |
191 | * data it contains. |
|
200 | * data it contains. | |
192 | * |
|
201 | * | |
193 | */ |
|
202 | */ | |
194 |
|
203 | |||
195 | rtems_status_code status; // RTEMS status code |
|
204 | rtems_status_code status; // RTEMS status code | |
196 | char incomingData[ACTION_MSG_PKTS_MAX_SIZE]; // incoming data buffer |
|
205 | char incomingData[ACTION_MSG_PKTS_MAX_SIZE]; // incoming data buffer | |
197 | spw_ioctl_pkt_send *spw_ioctl_send; |
|
206 | spw_ioctl_pkt_send *spw_ioctl_send; | |
198 | size_t size; // size of the incoming TC packet |
|
207 | size_t size; // size of the incoming TC packet | |
199 | u_int32_t count; |
|
208 | u_int32_t count; | |
200 | rtems_id queue_id; |
|
209 | rtems_id queue_id; | |
201 |
|
210 | |||
202 | status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id ); |
|
211 | status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id ); | |
203 | if (status != RTEMS_SUCCESSFUL) |
|
212 | if (status != RTEMS_SUCCESSFUL) | |
204 | { |
|
213 | { | |
205 | PRINTF1("in SEND *** ERR getting queue id, %d\n", status) |
|
214 | PRINTF1("in SEND *** ERR getting queue id, %d\n", status) | |
206 | } |
|
215 | } | |
207 |
|
216 | |||
208 | BOOT_PRINTF("in SEND *** \n") |
|
217 | BOOT_PRINTF("in SEND *** \n") | |
209 |
|
218 | |||
210 | while(1) |
|
219 | while(1) | |
211 | { |
|
220 | { | |
212 | status = rtems_message_queue_receive( queue_id, incomingData, &size, |
|
221 | status = rtems_message_queue_receive( queue_id, incomingData, &size, | |
213 | RTEMS_WAIT, RTEMS_NO_TIMEOUT ); |
|
222 | RTEMS_WAIT, RTEMS_NO_TIMEOUT ); | |
214 |
|
223 | |||
215 | if (status!=RTEMS_SUCCESSFUL) |
|
224 | if (status!=RTEMS_SUCCESSFUL) | |
216 | { |
|
225 | { | |
217 | PRINTF1("in SEND *** (1) ERR = %d\n", status) |
|
226 | PRINTF1("in SEND *** (1) ERR = %d\n", status) | |
218 | } |
|
227 | } | |
219 | else |
|
228 | else | |
220 | { |
|
229 | { | |
221 | if ( incomingData[0] == CCSDS_DESTINATION_ID) // the incoming message is a ccsds packet |
|
230 | if ( incomingData[0] == CCSDS_DESTINATION_ID) // the incoming message is a ccsds packet | |
222 | { |
|
231 | { | |
223 | status = write( fdSPW, incomingData, size ); |
|
232 | status = write( fdSPW, incomingData, size ); | |
224 | if (status == -1){ |
|
233 | if (status == -1){ | |
225 | PRINTF2("in SEND *** (2.a) ERRNO = %d, size = %d\n", errno, size) |
|
234 | PRINTF2("in SEND *** (2.a) ERRNO = %d, size = %d\n", errno, size) | |
226 | } |
|
235 | } | |
227 | } |
|
236 | } | |
228 | else // the incoming message is a spw_ioctl_pkt_send structure |
|
237 | else // the incoming message is a spw_ioctl_pkt_send structure | |
229 | { |
|
238 | { | |
230 | spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData; |
|
239 | spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData; | |
231 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send ); |
|
240 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send ); | |
232 | if (status == -1){ |
|
241 | if (status == -1){ | |
233 | PRINTF2("in SEND *** (2.b) ERRNO = %d, RTEMS = %d\n", errno, status) |
|
242 | PRINTF2("in SEND *** (2.b) ERRNO = %d, RTEMS = %d\n", errno, status) | |
234 | } |
|
243 | } | |
235 | } |
|
244 | } | |
236 | } |
|
245 | } | |
237 |
|
246 | |||
238 | status = rtems_message_queue_get_number_pending( queue_id, &count ); |
|
247 | status = rtems_message_queue_get_number_pending( queue_id, &count ); | |
239 | if (status != RTEMS_SUCCESSFUL) |
|
248 | if (status != RTEMS_SUCCESSFUL) | |
240 | { |
|
249 | { | |
241 | PRINTF1("in SEND *** (3) ERR = %d\n", status) |
|
250 | PRINTF1("in SEND *** (3) ERR = %d\n", status) | |
242 | } |
|
251 | } | |
243 | else |
|
252 | else | |
244 | { |
|
253 | { | |
245 | if (count > maxCount) |
|
254 | if (count > maxCount) | |
246 | { |
|
255 | { | |
247 | maxCount = count; |
|
256 | maxCount = count; | |
248 | } |
|
257 | } | |
249 | } |
|
258 | } | |
250 | } |
|
259 | } | |
251 | } |
|
260 | } | |
252 |
|
261 | |||
253 | rtems_task wtdg_task( rtems_task_argument argument ) |
|
262 | rtems_task wtdg_task( rtems_task_argument argument ) | |
254 | { |
|
263 | { | |
255 | rtems_event_set event_out; |
|
264 | rtems_event_set event_out; | |
256 | rtems_status_code status; |
|
265 | rtems_status_code status; | |
257 | int linkStatus; |
|
266 | int linkStatus; | |
258 |
|
267 | |||
259 | BOOT_PRINTF("in WTDG ***\n") |
|
268 | BOOT_PRINTF("in WTDG ***\n") | |
260 |
|
269 | |||
261 | while(1) |
|
270 | while(1) | |
262 | { |
|
271 | { | |
263 | // wait for an RTEMS_EVENT |
|
272 | // wait for an RTEMS_EVENT | |
264 | rtems_event_receive( RTEMS_EVENT_0, |
|
273 | rtems_event_receive( RTEMS_EVENT_0, | |
265 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
274 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
266 | PRINTF("in WTDG *** wait for the link\n") |
|
275 | PRINTF("in WTDG *** wait for the link\n") | |
267 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status |
|
276 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status | |
268 | while( linkStatus != 5) // wait for the link |
|
277 | while( linkStatus != 5) // wait for the link | |
269 | { |
|
278 | { | |
270 | rtems_task_wake_after( 10 ); |
|
279 | rtems_task_wake_after( 10 ); | |
271 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status |
|
280 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status | |
272 | } |
|
281 | } | |
273 |
|
282 | |||
274 | status = spacewire_stop_start_link( fdSPW ); |
|
283 | status = spacewire_stop_start_link( fdSPW ); | |
275 |
|
284 | |||
276 | if (status != RTEMS_SUCCESSFUL) |
|
285 | if (status != RTEMS_SUCCESSFUL) | |
277 | { |
|
286 | { | |
278 | PRINTF1("in WTDG *** ERR link not started %d\n", status) |
|
287 | PRINTF1("in WTDG *** ERR link not started %d\n", status) | |
279 | } |
|
288 | } | |
280 | else |
|
289 | else | |
281 | { |
|
290 | { | |
282 | PRINTF("in WTDG *** OK link started\n") |
|
291 | PRINTF("in WTDG *** OK link started\n") | |
283 | } |
|
292 | } | |
284 |
|
293 | |||
285 | // restart the SPIQ task |
|
294 | // restart the SPIQ task | |
286 | status = rtems_task_restart( Task_id[TASKID_SPIQ], 1 ); |
|
295 | status = rtems_task_restart( Task_id[TASKID_SPIQ], 1 ); | |
287 | if ( status != RTEMS_SUCCESSFUL ) { |
|
296 | if ( status != RTEMS_SUCCESSFUL ) { | |
288 | PRINTF("in SPIQ *** ERR restarting SPIQ Task\n") |
|
297 | PRINTF("in SPIQ *** ERR restarting SPIQ Task\n") | |
289 | } |
|
298 | } | |
290 |
|
299 | |||
291 | // restart RECV and SEND |
|
300 | // restart RECV and SEND | |
292 | status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 ); |
|
301 | status = rtems_task_restart( Task_id[ TASKID_SEND ], 1 ); | |
293 | if ( status != RTEMS_SUCCESSFUL ) { |
|
302 | if ( status != RTEMS_SUCCESSFUL ) { | |
294 | PRINTF("in SPIQ *** ERR restarting SEND Task\n") |
|
303 | PRINTF("in SPIQ *** ERR restarting SEND Task\n") | |
295 | } |
|
304 | } | |
296 | status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 ); |
|
305 | status = rtems_task_restart( Task_id[ TASKID_RECV ], 1 ); | |
297 | if ( status != RTEMS_SUCCESSFUL ) { |
|
306 | if ( status != RTEMS_SUCCESSFUL ) { | |
298 | PRINTF("in SPIQ *** ERR restarting RECV Task\n") |
|
307 | PRINTF("in SPIQ *** ERR restarting RECV Task\n") | |
299 | } |
|
308 | } | |
300 | } |
|
309 | } | |
301 | } |
|
310 | } | |
302 |
|
311 | |||
303 | //**************** |
|
312 | //**************** | |
304 | // OTHER FUNCTIONS |
|
313 | // OTHER FUNCTIONS | |
305 | int spacewire_open_link( void ) |
|
314 | int spacewire_open_link( void ) | |
306 | { |
|
315 | { | |
307 | /** This function opens the SpaceWire link. |
|
316 | /** This function opens the SpaceWire link. | |
308 | * |
|
317 | * | |
309 | * @return a valid file descriptor in case of success, -1 in case of a failure |
|
318 | * @return a valid file descriptor in case of success, -1 in case of a failure | |
310 | * |
|
319 | * | |
311 | */ |
|
320 | */ | |
312 | rtems_status_code status; |
|
321 | rtems_status_code status; | |
313 |
|
322 | |||
314 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware |
|
323 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call resets the hardware | |
315 | if ( fdSPW < 0 ) { |
|
324 | if ( fdSPW < 0 ) { | |
316 | PRINTF1("ERR *** in configure_spw_link *** error opening "GRSPW_DEVICE_NAME" with ERR %d\n", errno) |
|
325 | PRINTF1("ERR *** in configure_spw_link *** error opening "GRSPW_DEVICE_NAME" with ERR %d\n", errno) | |
317 | } |
|
326 | } | |
318 | else |
|
327 | else | |
319 | { |
|
328 | { | |
320 | status = RTEMS_SUCCESSFUL; |
|
329 | status = RTEMS_SUCCESSFUL; | |
321 | } |
|
330 | } | |
322 |
|
331 | |||
323 | return status; |
|
332 | return status; | |
324 | } |
|
333 | } | |
325 |
|
334 | |||
326 | int spacewire_start_link( int fd ) |
|
335 | int spacewire_start_link( int fd ) | |
327 | { |
|
336 | { | |
328 | rtems_status_code status; |
|
337 | rtems_status_code status; | |
329 |
|
338 | |||
330 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started |
|
339 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started | |
331 | // -1 default hardcoded driver timeout |
|
340 | // -1 default hardcoded driver timeout | |
332 |
|
341 | |||
333 | return status; |
|
342 | return status; | |
334 | } |
|
343 | } | |
335 |
|
344 | |||
336 | int spacewire_stop_start_link( int fd ) |
|
345 | int spacewire_stop_start_link( int fd ) | |
337 | { |
|
346 | { | |
338 | rtems_status_code status; |
|
347 | rtems_status_code status; | |
339 |
|
348 | |||
340 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_STOP); // start fails if link pDev->running != 0 |
|
349 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_STOP); // start fails if link pDev->running != 0 | |
341 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started |
|
350 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_START, -1); // returns successfuly if the link is started | |
342 | // -1 default hardcoded driver timeout |
|
351 | // -1 default hardcoded driver timeout | |
343 |
|
352 | |||
344 | return status; |
|
353 | return status; | |
345 | } |
|
354 | } | |
346 |
|
355 | |||
347 | int spacewire_configure_link( int fd ) |
|
356 | int spacewire_configure_link( int fd ) | |
348 | { |
|
357 | { | |
349 | /** This function configures the SpaceWire link. |
|
358 | /** This function configures the SpaceWire link. | |
350 | * |
|
359 | * | |
351 | * @return GR-RTEMS-DRIVER directive status codes: |
|
360 | * @return GR-RTEMS-DRIVER directive status codes: | |
352 | * - 22 EINVAL - Null pointer or an out of range value was given as the argument. |
|
361 | * - 22 EINVAL - Null pointer or an out of range value was given as the argument. | |
353 | * - 16 EBUSY - Only used for SEND. Returned when no descriptors are avialble in non-blocking mode. |
|
362 | * - 16 EBUSY - Only used for SEND. Returned when no descriptors are avialble in non-blocking mode. | |
354 | * - 88 ENOSYS - Returned for SET_DESTKEY if RMAP command handler is not available or if a non-implemented call is used. |
|
363 | * - 88 ENOSYS - Returned for SET_DESTKEY if RMAP command handler is not available or if a non-implemented call is used. | |
355 | * - 116 ETIMEDOUT - REturned for SET_PACKET_SIZE and START if the link could not be brought up. |
|
364 | * - 116 ETIMEDOUT - REturned for SET_PACKET_SIZE and START if the link could not be brought up. | |
356 | * - 12 ENOMEM - Returned for SET_PACKETSIZE if it was unable to allocate the new buffers. |
|
365 | * - 12 ENOMEM - Returned for SET_PACKETSIZE if it was unable to allocate the new buffers. | |
357 | * - 5 EIO - Error when writing to grswp hardware registers. |
|
366 | * - 5 EIO - Error when writing to grswp hardware registers. | |
358 | * - 2 ENOENT - No such file or directory |
|
367 | * - 2 ENOENT - No such file or directory | |
359 | */ |
|
368 | */ | |
360 |
|
369 | |||
361 | rtems_status_code status; |
|
370 | rtems_status_code status; | |
362 |
|
371 | |||
363 | spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force |
|
372 | spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force | |
364 | spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration |
|
373 | spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration | |
365 |
|
374 | |||
366 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception |
|
375 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception | |
367 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n") |
|
376 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n") | |
368 | // |
|
377 | // | |
369 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a |
|
378 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a | |
370 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs |
|
379 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs | |
371 | // |
|
380 | // | |
372 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 0); // automatic link-disabling due to link-error interrupts |
|
381 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 0); // automatic link-disabling due to link-error interrupts | |
373 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n") |
|
382 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n") | |
374 | // |
|
383 | // | |
375 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit |
|
384 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit | |
376 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ\n") |
|
385 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ\n") | |
377 | // |
|
386 | // | |
378 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TXBLOCK, 0); // transmission blocks |
|
387 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TXBLOCK, 0); // transmission blocks | |
379 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK\n") |
|
388 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK\n") | |
380 | // |
|
389 | // | |
381 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL, 1); // transmission blocks when no transmission descriptor is available |
|
390 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL, 1); // transmission blocks when no transmission descriptor is available | |
382 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL\n") |
|
391 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL\n") | |
383 | // |
|
392 | // | |
384 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TCODE_CTRL, 0x0909); // [Time Rx : Time Tx : Link error : Tick-out IRQ] |
|
393 | status = ioctl(fd, SPACEWIRE_IOCTRL_SET_TCODE_CTRL, 0x0909); // [Time Rx : Time Tx : Link error : Tick-out IRQ] | |
385 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n") |
|
394 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n") | |
386 |
|
395 | |||
387 | return status; |
|
396 | return status; | |
388 | } |
|
397 | } | |
389 |
|
398 | |||
390 | int spacewire_reset_link( void ) |
|
399 | int spacewire_reset_link( void ) | |
391 | { |
|
400 | { | |
392 | /** This function is executed by the SPIQ rtems_task wehn it has been awaken by an interruption raised by the SpaceWire driver. |
|
401 | /** This function is executed by the SPIQ rtems_task wehn it has been awaken by an interruption raised by the SpaceWire driver. | |
393 | * |
|
402 | * | |
394 | * @return RTEMS directive status code: |
|
403 | * @return RTEMS directive status code: | |
395 | * - RTEMS_UNSATISFIED is returned is the link is not in the running state after 10 s. |
|
404 | * - RTEMS_UNSATISFIED is returned is the link is not in the running state after 10 s. | |
396 | * - RTEMS_SUCCESSFUL is returned if the link is up before the timeout. |
|
405 | * - RTEMS_SUCCESSFUL is returned if the link is up before the timeout. | |
397 | * |
|
406 | * | |
398 | */ |
|
407 | */ | |
399 |
|
408 | |||
400 | rtems_status_code status_spw; |
|
409 | rtems_status_code status_spw; | |
401 | int i; |
|
410 | int i; | |
402 |
|
411 | |||
403 | for ( i=0; i<SY_LFR_DPU_CONNECT_ATTEMPT; i++ ) |
|
412 | for ( i=0; i<SY_LFR_DPU_CONNECT_ATTEMPT; i++ ) | |
404 | { |
|
413 | { | |
405 | PRINTF1("in spacewire_reset_link *** link recovery, try %d\n", i); |
|
414 | PRINTF1("in spacewire_reset_link *** link recovery, try %d\n", i); | |
406 |
|
415 | |||
407 | // CLOSING THE DRIVER AT THIS POINT WILL MAKE THE SEND TASK BLOCK THE SYSTEM |
|
416 | // CLOSING THE DRIVER AT THIS POINT WILL MAKE THE SEND TASK BLOCK THE SYSTEM | |
408 |
|
417 | |||
409 | status_spw = spacewire_stop_start_link( fdSPW ); |
|
418 | status_spw = spacewire_stop_start_link( fdSPW ); | |
410 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
419 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
411 | { |
|
420 | { | |
412 | PRINTF1("in spacewire_reset_link *** ERR spacewire_start_link code %d\n", status_spw) |
|
421 | PRINTF1("in spacewire_reset_link *** ERR spacewire_start_link code %d\n", status_spw) | |
413 | } |
|
422 | } | |
414 |
|
423 | |||
415 | if ( status_spw == RTEMS_SUCCESSFUL) |
|
424 | if ( status_spw == RTEMS_SUCCESSFUL) | |
416 | { |
|
425 | { | |
417 | break; |
|
426 | break; | |
418 | } |
|
427 | } | |
419 | } |
|
428 | } | |
420 |
|
429 | |||
421 | return status_spw; |
|
430 | return status_spw; | |
422 | } |
|
431 | } | |
423 |
|
432 | |||
424 | void spacewire_set_NP( unsigned char val, unsigned int regAddr ) // [N]o [P]ort force |
|
433 | void spacewire_set_NP( unsigned char val, unsigned int regAddr ) // [N]o [P]ort force | |
425 | { |
|
434 | { | |
426 | /** This function sets the [N]o [P]ort force bit of the GRSPW control register. |
|
435 | /** This function sets the [N]o [P]ort force bit of the GRSPW control register. | |
427 | * |
|
436 | * | |
428 | * @param val is the value, 0 or 1, used to set the value of the NP bit. |
|
437 | * @param val is the value, 0 or 1, used to set the value of the NP bit. | |
429 | * @param regAddr is the address of the GRSPW control register. |
|
438 | * @param regAddr is the address of the GRSPW control register. | |
430 | * |
|
439 | * | |
431 | * NP is the bit 20 of the GRSPW control register. |
|
440 | * NP is the bit 20 of the GRSPW control register. | |
432 | * |
|
441 | * | |
433 | */ |
|
442 | */ | |
434 |
|
443 | |||
435 | unsigned int *spwptr = (unsigned int*) regAddr; |
|
444 | unsigned int *spwptr = (unsigned int*) regAddr; | |
436 |
|
445 | |||
437 | if (val == 1) { |
|
446 | if (val == 1) { | |
438 | *spwptr = *spwptr | 0x00100000; // [NP] set the No port force bit |
|
447 | *spwptr = *spwptr | 0x00100000; // [NP] set the No port force bit | |
439 | } |
|
448 | } | |
440 | if (val== 0) { |
|
449 | if (val== 0) { | |
441 | *spwptr = *spwptr & 0xffdfffff; |
|
450 | *spwptr = *spwptr & 0xffdfffff; | |
442 | } |
|
451 | } | |
443 | } |
|
452 | } | |
444 |
|
453 | |||
445 | void spacewire_set_RE( unsigned char val, unsigned int regAddr ) // [R]MAP [E]nable |
|
454 | void spacewire_set_RE( unsigned char val, unsigned int regAddr ) // [R]MAP [E]nable | |
446 | { |
|
455 | { | |
447 | /** This function sets the [R]MAP [E]nable bit of the GRSPW control register. |
|
456 | /** This function sets the [R]MAP [E]nable bit of the GRSPW control register. | |
448 | * |
|
457 | * | |
449 | * @param val is the value, 0 or 1, used to set the value of the RE bit. |
|
458 | * @param val is the value, 0 or 1, used to set the value of the RE bit. | |
450 | * @param regAddr is the address of the GRSPW control register. |
|
459 | * @param regAddr is the address of the GRSPW control register. | |
451 | * |
|
460 | * | |
452 | * RE is the bit 16 of the GRSPW control register. |
|
461 | * RE is the bit 16 of the GRSPW control register. | |
453 | * |
|
462 | * | |
454 | */ |
|
463 | */ | |
455 |
|
464 | |||
456 | unsigned int *spwptr = (unsigned int*) regAddr; |
|
465 | unsigned int *spwptr = (unsigned int*) regAddr; | |
457 |
|
466 | |||
458 | if (val == 1) |
|
467 | if (val == 1) | |
459 | { |
|
468 | { | |
460 | *spwptr = *spwptr | 0x00010000; // [RE] set the RMAP Enable bit |
|
469 | *spwptr = *spwptr | 0x00010000; // [RE] set the RMAP Enable bit | |
461 | } |
|
470 | } | |
462 | if (val== 0) |
|
471 | if (val== 0) | |
463 | { |
|
472 | { | |
464 | *spwptr = *spwptr & 0xfffdffff; |
|
473 | *spwptr = *spwptr & 0xfffdffff; | |
465 | } |
|
474 | } | |
466 | } |
|
475 | } | |
467 |
|
476 | |||
468 | void spacewire_compute_stats_offsets( void ) |
|
477 | void spacewire_compute_stats_offsets( void ) | |
469 | { |
|
478 | { | |
470 | /** This function computes the SpaceWire statistics offsets in case of a SpaceWire related interruption raising. |
|
479 | /** This function computes the SpaceWire statistics offsets in case of a SpaceWire related interruption raising. | |
471 | * |
|
480 | * | |
472 | * The offsets keep a record of the statistics in case of a reset of the statistics. They are added to the current statistics |
|
481 | * The offsets keep a record of the statistics in case of a reset of the statistics. They are added to the current statistics | |
473 | * to keep the counters consistent even after a reset of the SpaceWire driver (the counter are set to zero by the driver when it |
|
482 | * to keep the counters consistent even after a reset of the SpaceWire driver (the counter are set to zero by the driver when it | |
474 | * during the open systel call). |
|
483 | * during the open systel call). | |
475 | * |
|
484 | * | |
476 | */ |
|
485 | */ | |
477 |
|
486 | |||
478 | spw_stats spacewire_stats_grspw; |
|
487 | spw_stats spacewire_stats_grspw; | |
479 | rtems_status_code status; |
|
488 | rtems_status_code status; | |
480 |
|
489 | |||
481 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw ); |
|
490 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw ); | |
482 |
|
491 | |||
483 | spacewire_stats_backup.packets_received = spacewire_stats_grspw.packets_received |
|
492 | spacewire_stats_backup.packets_received = spacewire_stats_grspw.packets_received | |
484 | + spacewire_stats.packets_received; |
|
493 | + spacewire_stats.packets_received; | |
485 | spacewire_stats_backup.packets_sent = spacewire_stats_grspw.packets_sent |
|
494 | spacewire_stats_backup.packets_sent = spacewire_stats_grspw.packets_sent | |
486 | + spacewire_stats.packets_sent; |
|
495 | + spacewire_stats.packets_sent; | |
487 | spacewire_stats_backup.parity_err = spacewire_stats_grspw.parity_err |
|
496 | spacewire_stats_backup.parity_err = spacewire_stats_grspw.parity_err | |
488 | + spacewire_stats.parity_err; |
|
497 | + spacewire_stats.parity_err; | |
489 | spacewire_stats_backup.disconnect_err = spacewire_stats_grspw.disconnect_err |
|
498 | spacewire_stats_backup.disconnect_err = spacewire_stats_grspw.disconnect_err | |
490 | + spacewire_stats.disconnect_err; |
|
499 | + spacewire_stats.disconnect_err; | |
491 | spacewire_stats_backup.escape_err = spacewire_stats_grspw.escape_err |
|
500 | spacewire_stats_backup.escape_err = spacewire_stats_grspw.escape_err | |
492 | + spacewire_stats.escape_err; |
|
501 | + spacewire_stats.escape_err; | |
493 | spacewire_stats_backup.credit_err = spacewire_stats_grspw.credit_err |
|
502 | spacewire_stats_backup.credit_err = spacewire_stats_grspw.credit_err | |
494 | + spacewire_stats.credit_err; |
|
503 | + spacewire_stats.credit_err; | |
495 | spacewire_stats_backup.write_sync_err = spacewire_stats_grspw.write_sync_err |
|
504 | spacewire_stats_backup.write_sync_err = spacewire_stats_grspw.write_sync_err | |
496 | + spacewire_stats.write_sync_err; |
|
505 | + spacewire_stats.write_sync_err; | |
497 | spacewire_stats_backup.rx_rmap_header_crc_err = spacewire_stats_grspw.rx_rmap_header_crc_err |
|
506 | spacewire_stats_backup.rx_rmap_header_crc_err = spacewire_stats_grspw.rx_rmap_header_crc_err | |
498 | + spacewire_stats.rx_rmap_header_crc_err; |
|
507 | + spacewire_stats.rx_rmap_header_crc_err; | |
499 | spacewire_stats_backup.rx_rmap_data_crc_err = spacewire_stats_grspw.rx_rmap_data_crc_err |
|
508 | spacewire_stats_backup.rx_rmap_data_crc_err = spacewire_stats_grspw.rx_rmap_data_crc_err | |
500 | + spacewire_stats.rx_rmap_data_crc_err; |
|
509 | + spacewire_stats.rx_rmap_data_crc_err; | |
501 | spacewire_stats_backup.early_ep = spacewire_stats_grspw.early_ep |
|
510 | spacewire_stats_backup.early_ep = spacewire_stats_grspw.early_ep | |
502 | + spacewire_stats.early_ep; |
|
511 | + spacewire_stats.early_ep; | |
503 | spacewire_stats_backup.invalid_address = spacewire_stats_grspw.invalid_address |
|
512 | spacewire_stats_backup.invalid_address = spacewire_stats_grspw.invalid_address | |
504 | + spacewire_stats.invalid_address; |
|
513 | + spacewire_stats.invalid_address; | |
505 | spacewire_stats_backup.rx_eep_err = spacewire_stats_grspw.rx_eep_err |
|
514 | spacewire_stats_backup.rx_eep_err = spacewire_stats_grspw.rx_eep_err | |
506 | + spacewire_stats.rx_eep_err; |
|
515 | + spacewire_stats.rx_eep_err; | |
507 | spacewire_stats_backup.rx_truncated = spacewire_stats_grspw.rx_truncated |
|
516 | spacewire_stats_backup.rx_truncated = spacewire_stats_grspw.rx_truncated | |
508 | + spacewire_stats.rx_truncated; |
|
517 | + spacewire_stats.rx_truncated; | |
509 | } |
|
518 | } | |
510 |
|
519 | |||
511 | void spacewire_update_statistics( void ) |
|
520 | void spacewire_update_statistics( void ) | |
512 | { |
|
521 | { | |
513 | rtems_status_code status; |
|
522 | rtems_status_code status; | |
514 | spw_stats spacewire_stats_grspw; |
|
523 | spw_stats spacewire_stats_grspw; | |
515 |
|
524 | |||
516 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw ); |
|
525 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_GET_STATISTICS, &spacewire_stats_grspw ); | |
517 |
|
526 | |||
518 | spacewire_stats.packets_received = spacewire_stats_backup.packets_received |
|
527 | spacewire_stats.packets_received = spacewire_stats_backup.packets_received | |
519 | + spacewire_stats_grspw.packets_received; |
|
528 | + spacewire_stats_grspw.packets_received; | |
520 | spacewire_stats.packets_sent = spacewire_stats_backup.packets_sent |
|
529 | spacewire_stats.packets_sent = spacewire_stats_backup.packets_sent | |
521 | + spacewire_stats_grspw.packets_sent; |
|
530 | + spacewire_stats_grspw.packets_sent; | |
522 | spacewire_stats.parity_err = spacewire_stats_backup.parity_err |
|
531 | spacewire_stats.parity_err = spacewire_stats_backup.parity_err | |
523 | + spacewire_stats_grspw.parity_err; |
|
532 | + spacewire_stats_grspw.parity_err; | |
524 | spacewire_stats.disconnect_err = spacewire_stats_backup.disconnect_err |
|
533 | spacewire_stats.disconnect_err = spacewire_stats_backup.disconnect_err | |
525 | + spacewire_stats_grspw.disconnect_err; |
|
534 | + spacewire_stats_grspw.disconnect_err; | |
526 | spacewire_stats.escape_err = spacewire_stats_backup.escape_err |
|
535 | spacewire_stats.escape_err = spacewire_stats_backup.escape_err | |
527 | + spacewire_stats_grspw.escape_err; |
|
536 | + spacewire_stats_grspw.escape_err; | |
528 | spacewire_stats.credit_err = spacewire_stats_backup.credit_err |
|
537 | spacewire_stats.credit_err = spacewire_stats_backup.credit_err | |
529 | + spacewire_stats_grspw.credit_err; |
|
538 | + spacewire_stats_grspw.credit_err; | |
530 | spacewire_stats.write_sync_err = spacewire_stats_backup.write_sync_err |
|
539 | spacewire_stats.write_sync_err = spacewire_stats_backup.write_sync_err | |
531 | + spacewire_stats_grspw.write_sync_err; |
|
540 | + spacewire_stats_grspw.write_sync_err; | |
532 | spacewire_stats.rx_rmap_header_crc_err = spacewire_stats_backup.rx_rmap_header_crc_err |
|
541 | spacewire_stats.rx_rmap_header_crc_err = spacewire_stats_backup.rx_rmap_header_crc_err | |
533 | + spacewire_stats_grspw.rx_rmap_header_crc_err; |
|
542 | + spacewire_stats_grspw.rx_rmap_header_crc_err; | |
534 | spacewire_stats.rx_rmap_data_crc_err = spacewire_stats_backup.rx_rmap_data_crc_err |
|
543 | spacewire_stats.rx_rmap_data_crc_err = spacewire_stats_backup.rx_rmap_data_crc_err | |
535 | + spacewire_stats_grspw.rx_rmap_data_crc_err; |
|
544 | + spacewire_stats_grspw.rx_rmap_data_crc_err; | |
536 | spacewire_stats.early_ep = spacewire_stats_backup.early_ep |
|
545 | spacewire_stats.early_ep = spacewire_stats_backup.early_ep | |
537 | + spacewire_stats_grspw.early_ep; |
|
546 | + spacewire_stats_grspw.early_ep; | |
538 | spacewire_stats.invalid_address = spacewire_stats_backup.invalid_address |
|
547 | spacewire_stats.invalid_address = spacewire_stats_backup.invalid_address | |
539 | + spacewire_stats_grspw.invalid_address; |
|
548 | + spacewire_stats_grspw.invalid_address; | |
540 | spacewire_stats.rx_eep_err = spacewire_stats_backup.rx_eep_err |
|
549 | spacewire_stats.rx_eep_err = spacewire_stats_backup.rx_eep_err | |
541 | + spacewire_stats_grspw.rx_eep_err; |
|
550 | + spacewire_stats_grspw.rx_eep_err; | |
542 | spacewire_stats.rx_truncated = spacewire_stats_backup.rx_truncated |
|
551 | spacewire_stats.rx_truncated = spacewire_stats_backup.rx_truncated | |
543 | + spacewire_stats_grspw.rx_truncated; |
|
552 | + spacewire_stats_grspw.rx_truncated; | |
544 | //spacewire_stats.tx_link_err; |
|
553 | //spacewire_stats.tx_link_err; | |
545 |
|
554 | |||
546 | //**************************** |
|
555 | //**************************** | |
547 | // DPU_SPACEWIRE_IF_STATISTICS |
|
556 | // DPU_SPACEWIRE_IF_STATISTICS | |
548 | housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[0] = (unsigned char) (spacewire_stats.packets_received >> 8); |
|
557 | housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[0] = (unsigned char) (spacewire_stats.packets_received >> 8); | |
549 | housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[1] = (unsigned char) (spacewire_stats.packets_received); |
|
558 | housekeeping_packet.hk_lfr_dpu_spw_pkt_rcv_cnt[1] = (unsigned char) (spacewire_stats.packets_received); | |
550 | housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[0] = (unsigned char) (spacewire_stats.packets_sent >> 8); |
|
559 | housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[0] = (unsigned char) (spacewire_stats.packets_sent >> 8); | |
551 | housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[1] = (unsigned char) (spacewire_stats.packets_sent); |
|
560 | housekeeping_packet.hk_lfr_dpu_spw_pkt_sent_cnt[1] = (unsigned char) (spacewire_stats.packets_sent); | |
552 | //housekeeping_packet.hk_lfr_dpu_spw_tick_out_cnt; |
|
561 | //housekeeping_packet.hk_lfr_dpu_spw_tick_out_cnt; | |
553 | //housekeeping_packet.hk_lfr_dpu_spw_last_timc; |
|
562 | //housekeeping_packet.hk_lfr_dpu_spw_last_timc; | |
554 |
|
563 | |||
555 | //****************************************** |
|
564 | //****************************************** | |
556 | // ERROR COUNTERS / SPACEWIRE / LOW SEVERITY |
|
565 | // ERROR COUNTERS / SPACEWIRE / LOW SEVERITY | |
557 | housekeeping_packet.hk_lfr_dpu_spw_parity = (unsigned char) spacewire_stats.parity_err; |
|
566 | housekeeping_packet.hk_lfr_dpu_spw_parity = (unsigned char) spacewire_stats.parity_err; | |
558 | housekeeping_packet.hk_lfr_dpu_spw_disconnect = (unsigned char) spacewire_stats.disconnect_err; |
|
567 | housekeeping_packet.hk_lfr_dpu_spw_disconnect = (unsigned char) spacewire_stats.disconnect_err; | |
559 | housekeeping_packet.hk_lfr_dpu_spw_escape = (unsigned char) spacewire_stats.escape_err; |
|
568 | housekeeping_packet.hk_lfr_dpu_spw_escape = (unsigned char) spacewire_stats.escape_err; | |
560 | housekeeping_packet.hk_lfr_dpu_spw_credit = (unsigned char) spacewire_stats.credit_err; |
|
569 | housekeeping_packet.hk_lfr_dpu_spw_credit = (unsigned char) spacewire_stats.credit_err; | |
561 | housekeeping_packet.hk_lfr_dpu_spw_write_sync = (unsigned char) spacewire_stats.write_sync_err; |
|
570 | housekeeping_packet.hk_lfr_dpu_spw_write_sync = (unsigned char) spacewire_stats.write_sync_err; | |
562 | // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb; |
|
571 | // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb; | |
563 | // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb; |
|
572 | // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb; | |
564 | housekeeping_packet.hk_lfr_dpu_spw_header_crc = (unsigned char) spacewire_stats.rx_rmap_header_crc_err; |
|
573 | housekeeping_packet.hk_lfr_dpu_spw_header_crc = (unsigned char) spacewire_stats.rx_rmap_header_crc_err; | |
565 | housekeeping_packet.hk_lfr_dpu_spw_data_crc = (unsigned char) spacewire_stats.rx_rmap_data_crc_err; |
|
574 | housekeeping_packet.hk_lfr_dpu_spw_data_crc = (unsigned char) spacewire_stats.rx_rmap_data_crc_err; | |
566 |
|
575 | |||
567 | //********************************************* |
|
576 | //********************************************* | |
568 | // ERROR COUNTERS / SPACEWIRE / MEDIUM SEVERITY |
|
577 | // ERROR COUNTERS / SPACEWIRE / MEDIUM SEVERITY | |
569 | housekeeping_packet.hk_lfr_dpu_spw_early_eop = (unsigned char) spacewire_stats.early_ep; |
|
578 | housekeeping_packet.hk_lfr_dpu_spw_early_eop = (unsigned char) spacewire_stats.early_ep; | |
570 | housekeeping_packet.hk_lfr_dpu_spw_invalid_addr = (unsigned char) spacewire_stats.invalid_address; |
|
579 | housekeeping_packet.hk_lfr_dpu_spw_invalid_addr = (unsigned char) spacewire_stats.invalid_address; | |
571 | housekeeping_packet.hk_lfr_dpu_spw_eep = (unsigned char) spacewire_stats.rx_eep_err; |
|
580 | housekeeping_packet.hk_lfr_dpu_spw_eep = (unsigned char) spacewire_stats.rx_eep_err; | |
572 | housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) spacewire_stats.rx_truncated; |
|
581 | housekeeping_packet.hk_lfr_dpu_spw_rx_too_big = (unsigned char) spacewire_stats.rx_truncated; | |
573 |
|
582 | |||
574 | } |
|
583 | } | |
575 |
|
584 | |||
576 | void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc ) |
|
585 | void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc ) | |
577 | { |
|
586 | { | |
578 | //if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_1 ) != RTEMS_SUCCESSFUL) { |
|
587 | //if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_1 ) != RTEMS_SUCCESSFUL) { | |
579 | // printf("In timecode_irq_handler *** Error sending event to DUMB\n"); |
|
588 | // printf("In timecode_irq_handler *** Error sending event to DUMB\n"); | |
580 | //} |
|
589 | //} | |
581 | } |
|
590 | } | |
582 |
|
591 | |||
583 | rtems_timer_service_routine user_routine( rtems_id timer_id, void *user_data ) |
|
592 | rtems_timer_service_routine user_routine( rtems_id timer_id, void *user_data ) | |
584 | { |
|
593 | { | |
585 | int linkStatus; |
|
594 | int linkStatus; | |
586 | rtems_status_code status; |
|
595 | rtems_status_code status; | |
587 |
|
596 | |||
588 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status |
|
597 | ioctl(fdSPW, SPACEWIRE_IOCTRL_GET_LINK_STATUS, &linkStatus); // get the link status | |
589 |
|
598 | |||
590 | if ( linkStatus == 5) { |
|
599 | if ( linkStatus == 5) { | |
591 | PRINTF("in spacewire_reset_link *** link is running\n") |
|
600 | PRINTF("in spacewire_reset_link *** link is running\n") | |
592 | status = RTEMS_SUCCESSFUL; |
|
601 | status = RTEMS_SUCCESSFUL; | |
593 | } |
|
602 | } | |
594 | } |
|
603 | } | |
595 |
|
604 | |||
596 | rtems_status_code rtems_message_queue_send_lfr( rtems_id id, const void *buffer, size_t size ) |
|
605 | rtems_status_code rtems_message_queue_send_lfr( rtems_id id, const void *buffer, size_t size ) | |
597 | { |
|
606 | { | |
598 | rtems_status_code status; |
|
607 | rtems_status_code status; | |
599 | rtems_mode previous_mode_set; |
|
608 | rtems_mode previous_mode_set; | |
600 |
|
609 | |||
601 | // set the preemption OFF |
|
610 | // set the preemption OFF | |
602 | status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode_set ); |
|
611 | status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode_set ); | |
603 |
|
612 | |||
604 | // use the message queue |
|
613 | // use the message queue | |
605 | status = rtems_message_queue_send_lfr( id, buffer, size ); |
|
614 | status = rtems_message_queue_send_lfr( id, buffer, size ); | |
606 |
|
615 | |||
607 | // set the preemption ON |
|
616 | // set the preemption ON | |
608 | status = rtems_task_mode( RTEMS_PREEMPT , RTEMS_PREEMPT_MASK, &previous_mode_set ); |
|
617 | status = rtems_task_mode( RTEMS_PREEMPT , RTEMS_PREEMPT_MASK, &previous_mode_set ); | |
609 |
|
618 | |||
610 | return status; |
|
619 | return status; | |
611 | } |
|
620 | } | |
612 |
|
621 |
@@ -1,415 +1,417 | |||||
1 | /** Functions related to TeleCommand acceptance. |
|
1 | /** Functions related to TeleCommand acceptance. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to handle TeleCommands parsing.\n |
|
6 | * A group of functions to handle TeleCommands parsing.\n | |
7 | * |
|
7 | * | |
8 | */ |
|
8 | */ | |
9 |
|
9 | |||
10 | #include "tc_acceptance.h" |
|
10 | #include "tc_acceptance.h" | |
11 |
|
11 | |||
12 | unsigned int lookUpTableForCRC[256]; |
|
12 | unsigned int lookUpTableForCRC[256]; | |
13 |
|
13 | |||
14 | //********************** |
|
14 | //********************** | |
15 | // GENERAL USE FUNCTIONS |
|
15 | // GENERAL USE FUNCTIONS | |
16 | unsigned int Crc_opt( unsigned char D, unsigned int Chk) |
|
16 | unsigned int Crc_opt( unsigned char D, unsigned int Chk) | |
17 | { |
|
17 | { | |
18 | /** This function generate the CRC for one byte and returns the value of the new syndrome. |
|
18 | /** This function generate the CRC for one byte and returns the value of the new syndrome. | |
19 | * |
|
19 | * | |
20 | * @param D is the current byte of data. |
|
20 | * @param D is the current byte of data. | |
21 | * @param Chk is the current syndrom value. |
|
21 | * @param Chk is the current syndrom value. | |
22 | * |
|
22 | * | |
23 | * @return the value of the new syndrome on two bytes. |
|
23 | * @return the value of the new syndrome on two bytes. | |
24 | * |
|
24 | * | |
25 | */ |
|
25 | */ | |
26 |
|
26 | |||
27 | return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]); |
|
27 | return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]); | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
30 | void initLookUpTableForCRC( void ) |
|
30 | void initLookUpTableForCRC( void ) | |
31 | { |
|
31 | { | |
32 | /** This function is used to initiates the look-up table for fast CRC computation. |
|
32 | /** This function is used to initiates the look-up table for fast CRC computation. | |
33 | * |
|
33 | * | |
34 | * The global table lookUpTableForCRC[256] is initiated. |
|
34 | * The global table lookUpTableForCRC[256] is initiated. | |
35 | * |
|
35 | * | |
36 | */ |
|
36 | */ | |
37 |
|
37 | |||
38 | unsigned int i; |
|
38 | unsigned int i; | |
39 | unsigned int tmp; |
|
39 | unsigned int tmp; | |
40 |
|
40 | |||
41 | for (i=0; i<256; i++) |
|
41 | for (i=0; i<256; i++) | |
42 | { |
|
42 | { | |
43 | tmp = 0; |
|
43 | tmp = 0; | |
44 | if((i & 1) != 0) { |
|
44 | if((i & 1) != 0) { | |
45 | tmp = tmp ^ 0x1021; |
|
45 | tmp = tmp ^ 0x1021; | |
46 | } |
|
46 | } | |
47 | if((i & 2) != 0) { |
|
47 | if((i & 2) != 0) { | |
48 | tmp = tmp ^ 0x2042; |
|
48 | tmp = tmp ^ 0x2042; | |
49 | } |
|
49 | } | |
50 | if((i & 4) != 0) { |
|
50 | if((i & 4) != 0) { | |
51 | tmp = tmp ^ 0x4084; |
|
51 | tmp = tmp ^ 0x4084; | |
52 | } |
|
52 | } | |
53 | if((i & 8) != 0) { |
|
53 | if((i & 8) != 0) { | |
54 | tmp = tmp ^ 0x8108; |
|
54 | tmp = tmp ^ 0x8108; | |
55 | } |
|
55 | } | |
56 | if((i & 16) != 0) { |
|
56 | if((i & 16) != 0) { | |
57 | tmp = tmp ^ 0x1231; |
|
57 | tmp = tmp ^ 0x1231; | |
58 | } |
|
58 | } | |
59 | if((i & 32) != 0) { |
|
59 | if((i & 32) != 0) { | |
60 | tmp = tmp ^ 0x2462; |
|
60 | tmp = tmp ^ 0x2462; | |
61 | } |
|
61 | } | |
62 | if((i & 64) != 0) { |
|
62 | if((i & 64) != 0) { | |
63 | tmp = tmp ^ 0x48c4; |
|
63 | tmp = tmp ^ 0x48c4; | |
64 | } |
|
64 | } | |
65 | if((i & 128) != 0) { |
|
65 | if((i & 128) != 0) { | |
66 | tmp = tmp ^ 0x9188; |
|
66 | tmp = tmp ^ 0x9188; | |
67 | } |
|
67 | } | |
68 | lookUpTableForCRC[i] = tmp; |
|
68 | lookUpTableForCRC[i] = tmp; | |
69 | } |
|
69 | } | |
70 | } |
|
70 | } | |
71 |
|
71 | |||
72 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData) |
|
72 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData) | |
73 | { |
|
73 | { | |
74 | /** This function calculates a two bytes Cyclic Redundancy Code. |
|
74 | /** This function calculates a two bytes Cyclic Redundancy Code. | |
75 | * |
|
75 | * | |
76 | * @param data points to a buffer containing the data on which to compute the CRC. |
|
76 | * @param data points to a buffer containing the data on which to compute the CRC. | |
77 | * @param crcAsTwoBytes points points to a two bytes buffer in which the CRC is stored. |
|
77 | * @param crcAsTwoBytes points points to a two bytes buffer in which the CRC is stored. | |
78 | * @param sizeOfData is the number of bytes of *data* used to compute the CRC. |
|
78 | * @param sizeOfData is the number of bytes of *data* used to compute the CRC. | |
79 | * |
|
79 | * | |
80 | * The specification of the Cyclic Redundancy Code is described in the following document: ECSS-E-70-41-A. |
|
80 | * The specification of the Cyclic Redundancy Code is described in the following document: ECSS-E-70-41-A. | |
81 | * |
|
81 | * | |
82 | */ |
|
82 | */ | |
83 |
|
83 | |||
84 | unsigned int Chk; |
|
84 | unsigned int Chk; | |
85 | int j; |
|
85 | int j; | |
86 | Chk = 0xffff; // reset the syndrom to all ones |
|
86 | Chk = 0xffff; // reset the syndrom to all ones | |
87 | for (j=0; j<sizeOfData; j++) { |
|
87 | for (j=0; j<sizeOfData; j++) { | |
88 | Chk = Crc_opt(data[j], Chk); |
|
88 | Chk = Crc_opt(data[j], Chk); | |
89 | } |
|
89 | } | |
90 | crcAsTwoBytes[0] = (unsigned char) (Chk >> 8); |
|
90 | crcAsTwoBytes[0] = (unsigned char) (Chk >> 8); | |
91 | crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff); |
|
91 | crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff); | |
92 | } |
|
92 | } | |
93 |
|
93 | |||
94 | //********************* |
|
94 | //********************* | |
95 | // ACCEPTANCE FUNCTIONS |
|
95 | // ACCEPTANCE FUNCTIONS | |
96 | int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV, unsigned char *computed_CRC) |
|
96 | int tc_parser(ccsdsTelecommandPacket_t * TCPacket, unsigned int TC_LEN_RCV, unsigned char *computed_CRC) | |
97 | { |
|
97 | { | |
98 | /** This function parses TeleCommands. |
|
98 | /** This function parses TeleCommands. | |
99 | * |
|
99 | * | |
100 | * @param TC points to the TeleCommand that will be parsed. |
|
100 | * @param TC points to the TeleCommand that will be parsed. | |
101 | * @param TC_LEN_RCV is the received packet length. |
|
101 | * @param TC_LEN_RCV is the received packet length. | |
102 | * |
|
102 | * | |
103 | * @return Status code of the parsing. |
|
103 | * @return Status code of the parsing. | |
104 | * |
|
104 | * | |
105 | * The parsing checks: |
|
105 | * The parsing checks: | |
106 | * - process id |
|
106 | * - process id | |
107 | * - category |
|
107 | * - category | |
108 | * - length: a global check is performed and a per subtype check also |
|
108 | * - length: a global check is performed and a per subtype check also | |
109 | * - type |
|
109 | * - type | |
110 | * - subtype |
|
110 | * - subtype | |
111 | * - crc |
|
111 | * - crc | |
112 | * |
|
112 | * | |
113 | */ |
|
113 | */ | |
114 |
|
114 | |||
115 | int status; |
|
115 | int status; | |
|
116 | int status_crc; | |||
116 | unsigned char pid; |
|
117 | unsigned char pid; | |
117 | unsigned char category; |
|
118 | unsigned char category; | |
118 | unsigned int length; |
|
119 | unsigned int length; | |
119 | unsigned char packetType; |
|
120 | unsigned char packetType; | |
120 | unsigned char packetSubtype; |
|
121 | unsigned char packetSubtype; | |
121 | unsigned char sid; |
|
122 | unsigned char sid; | |
122 |
|
123 | |||
123 | status = CCSDS_TM_VALID; |
|
124 | status = CCSDS_TM_VALID; | |
124 |
|
125 | |||
125 | // APID check *** APID on 2 bytes |
|
126 | // APID check *** APID on 2 bytes | |
126 | pid = ((TCPacket->packetID[0] & 0x07)<<4) + ( (TCPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx |
|
127 | pid = ((TCPacket->packetID[0] & 0x07)<<4) + ( (TCPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx | |
127 | category = (TCPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210 |
|
128 | category = (TCPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210 | |
128 | length = (TCPacket->packetLength[0] * 256) + TCPacket->packetLength[1]; |
|
129 | length = (TCPacket->packetLength[0] * 256) + TCPacket->packetLength[1]; | |
129 | packetType = TCPacket->serviceType; |
|
130 | packetType = TCPacket->serviceType; | |
130 | packetSubtype = TCPacket->serviceSubType; |
|
131 | packetSubtype = TCPacket->serviceSubType; | |
131 | sid = TCPacket->sourceID; |
|
132 | sid = TCPacket->sourceID; | |
132 |
|
133 | |||
133 | if ( pid != CCSDS_PROCESS_ID ) // CHECK THE PROCESS ID |
|
134 | if ( pid != CCSDS_PROCESS_ID ) // CHECK THE PROCESS ID | |
134 | { |
|
135 | { | |
135 | status = ILLEGAL_APID; |
|
136 | status = ILLEGAL_APID; | |
136 | } |
|
137 | } | |
137 | if (status == CCSDS_TM_VALID) // CHECK THE CATEGORY |
|
138 | if (status == CCSDS_TM_VALID) // CHECK THE CATEGORY | |
138 | { |
|
139 | { | |
139 | if ( category != CCSDS_PACKET_CATEGORY ) |
|
140 | if ( category != CCSDS_PACKET_CATEGORY ) | |
140 | { |
|
141 | { | |
141 | status = ILLEGAL_APID; |
|
142 | status = ILLEGAL_APID; | |
142 | } |
|
143 | } | |
143 | } |
|
144 | } | |
144 | if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE |
|
145 | if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE | |
145 | { |
|
146 | { | |
146 | if (length != TC_LEN_RCV ) { |
|
147 | if (length != TC_LEN_RCV ) { | |
147 | status = WRONG_LEN_PKT; |
|
148 | status = WRONG_LEN_PKT; | |
148 | } |
|
149 | } | |
149 | } |
|
150 | } | |
150 | if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE |
|
151 | if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE | |
151 | { |
|
152 | { | |
152 | if ( length >= CCSDS_TC_PKT_MAX_SIZE ) { |
|
153 | if ( length >= CCSDS_TC_PKT_MAX_SIZE ) { | |
153 | status = WRONG_LEN_PKT; |
|
154 | status = WRONG_LEN_PKT; | |
154 | } |
|
155 | } | |
155 | } |
|
156 | } | |
156 | if (status == CCSDS_TM_VALID) // CHECK THE TYPE |
|
157 | if (status == CCSDS_TM_VALID) // CHECK THE TYPE | |
157 | { |
|
158 | { | |
158 | status = tc_check_type( packetType ); |
|
159 | status = tc_check_type( packetType ); | |
159 | } |
|
160 | } | |
160 | if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE |
|
161 | if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE | |
161 | { |
|
162 | { | |
162 | status = tc_check_subtype( packetSubtype ); |
|
163 | status = tc_check_subtype( packetSubtype ); | |
163 | } |
|
164 | } | |
164 | if (status == CCSDS_TM_VALID) // CHECK THE SID |
|
165 | if (status == CCSDS_TM_VALID) // CHECK THE SID | |
165 | { |
|
166 | { | |
166 | status = tc_check_sid( sid ); |
|
167 | status = tc_check_sid( sid ); | |
167 | } |
|
168 | } | |
168 | if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE AND LENGTH COMPLIANCE |
|
169 | if (status == CCSDS_TM_VALID) // CHECK THE SUBTYPE AND LENGTH COMPLIANCE | |
169 | { |
|
170 | { | |
170 | status = tc_check_length( packetSubtype, length ); |
|
171 | status = tc_check_length( packetSubtype, length ); | |
171 | } |
|
172 | } | |
|
173 | status_crc = tc_check_crc( TCPacket, length, computed_CRC ); | |||
172 | if (status == CCSDS_TM_VALID ) // CHECK CRC |
|
174 | if (status == CCSDS_TM_VALID ) // CHECK CRC | |
173 | { |
|
175 | { | |
174 | status = tc_check_crc( TCPacket, length, computed_CRC ); |
|
176 | status = status_crc; | |
175 | } |
|
177 | } | |
176 |
|
178 | |||
177 | return status; |
|
179 | return status; | |
178 | } |
|
180 | } | |
179 |
|
181 | |||
180 | int tc_check_type( unsigned char packetType ) |
|
182 | int tc_check_type( unsigned char packetType ) | |
181 | { |
|
183 | { | |
182 | /** This function checks that the type of a TeleCommand is valid. |
|
184 | /** This function checks that the type of a TeleCommand is valid. | |
183 | * |
|
185 | * | |
184 | * @param packetType is the type to check. |
|
186 | * @param packetType is the type to check. | |
185 | * |
|
187 | * | |
186 | * @return Status code CCSDS_TM_VALID or ILL_TYPE. |
|
188 | * @return Status code CCSDS_TM_VALID or ILL_TYPE. | |
187 | * |
|
189 | * | |
188 | */ |
|
190 | */ | |
189 |
|
191 | |||
190 | int status; |
|
192 | int status; | |
191 |
|
193 | |||
192 | if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME)) |
|
194 | if ( (packetType == TC_TYPE_GEN) || (packetType == TC_TYPE_TIME)) | |
193 | { |
|
195 | { | |
194 | status = CCSDS_TM_VALID; |
|
196 | status = CCSDS_TM_VALID; | |
195 | } |
|
197 | } | |
196 | else |
|
198 | else | |
197 | { |
|
199 | { | |
198 | status = ILL_TYPE; |
|
200 | status = ILL_TYPE; | |
199 | } |
|
201 | } | |
200 |
|
202 | |||
201 | return status; |
|
203 | return status; | |
202 | } |
|
204 | } | |
203 |
|
205 | |||
204 | int tc_check_subtype( unsigned char packetSubType ) |
|
206 | int tc_check_subtype( unsigned char packetSubType ) | |
205 | { |
|
207 | { | |
206 | /** This function checks that the subtype of a TeleCommand is valid. |
|
208 | /** This function checks that the subtype of a TeleCommand is valid. | |
207 | * |
|
209 | * | |
208 | * @param packetSubType is the subtype to check. |
|
210 | * @param packetSubType is the subtype to check. | |
209 | * |
|
211 | * | |
210 | * @return Status code CCSDS_TM_VALID or ILL_SUBTYPE. |
|
212 | * @return Status code CCSDS_TM_VALID or ILL_SUBTYPE. | |
211 | * |
|
213 | * | |
212 | */ |
|
214 | */ | |
213 |
|
215 | |||
214 | int status; |
|
216 | int status; | |
215 |
|
217 | |||
216 | if ( (packetSubType == TC_SUBTYPE_RESET) |
|
218 | if ( (packetSubType == TC_SUBTYPE_RESET) | |
217 | || (packetSubType == TC_SUBTYPE_LOAD_COMM) |
|
219 | || (packetSubType == TC_SUBTYPE_LOAD_COMM) | |
218 | || (packetSubType == TC_SUBTYPE_LOAD_NORM) || (packetSubType == TC_SUBTYPE_LOAD_BURST) |
|
220 | || (packetSubType == TC_SUBTYPE_LOAD_NORM) || (packetSubType == TC_SUBTYPE_LOAD_BURST) | |
219 | || (packetSubType == TC_SUBTYPE_LOAD_SBM1) || (packetSubType == TC_SUBTYPE_LOAD_SBM2) |
|
221 | || (packetSubType == TC_SUBTYPE_LOAD_SBM1) || (packetSubType == TC_SUBTYPE_LOAD_SBM2) | |
220 | || (packetSubType == TC_SUBTYPE_DUMP) |
|
222 | || (packetSubType == TC_SUBTYPE_DUMP) | |
221 | || (packetSubType == TC_SUBTYPE_ENTER) |
|
223 | || (packetSubType == TC_SUBTYPE_ENTER) | |
222 | || (packetSubType == TC_SUBTYPE_UPDT_INFO) || (packetSubType == TC_SUBTYPE_UPDT_TIME) |
|
224 | || (packetSubType == TC_SUBTYPE_UPDT_INFO) || (packetSubType == TC_SUBTYPE_UPDT_TIME) | |
223 | || (packetSubType == TC_SUBTYPE_EN_CAL) || (packetSubType == TC_SUBTYPE_DIS_CAL) ) |
|
225 | || (packetSubType == TC_SUBTYPE_EN_CAL) || (packetSubType == TC_SUBTYPE_DIS_CAL) ) | |
224 | { |
|
226 | { | |
225 | status = CCSDS_TM_VALID; |
|
227 | status = CCSDS_TM_VALID; | |
226 | } |
|
228 | } | |
227 | else |
|
229 | else | |
228 | { |
|
230 | { | |
229 | status = ILL_SUBTYPE; |
|
231 | status = ILL_SUBTYPE; | |
230 | } |
|
232 | } | |
231 |
|
233 | |||
232 | return status; |
|
234 | return status; | |
233 | } |
|
235 | } | |
234 |
|
236 | |||
235 | int tc_check_sid( unsigned char sid ) |
|
237 | int tc_check_sid( unsigned char sid ) | |
236 | { |
|
238 | { | |
237 | /** This function checks that the sid of a TeleCommand is valid. |
|
239 | /** This function checks that the sid of a TeleCommand is valid. | |
238 | * |
|
240 | * | |
239 | * @param sid is the sid to check. |
|
241 | * @param sid is the sid to check. | |
240 | * |
|
242 | * | |
241 | * @return Status code CCSDS_TM_VALID or CORRUPTED. |
|
243 | * @return Status code CCSDS_TM_VALID or CORRUPTED. | |
242 | * |
|
244 | * | |
243 | */ |
|
245 | */ | |
244 |
|
246 | |||
245 | int status; |
|
247 | int status; | |
246 |
|
248 | |||
247 | if ( (sid == SID_TC_GROUND) |
|
249 | if ( (sid == SID_TC_GROUND) | |
248 | || (sid == SID_TC_MISSION_TIMELINE) || (sid == SID_TC_TC_SEQUENCES) || (sid == SID_TC_RECOVERY_ACTION_CMD) |
|
250 | || (sid == SID_TC_MISSION_TIMELINE) || (sid == SID_TC_TC_SEQUENCES) || (sid == SID_TC_RECOVERY_ACTION_CMD) | |
249 | || (sid == SID_TC_BACKUP_MISSION_TIMELINE) |
|
251 | || (sid == SID_TC_BACKUP_MISSION_TIMELINE) | |
250 | || (sid == SID_TC_DIRECT_CMD) || (sid == SID_TC_SPARE_GRD_SRC1) || (sid == SID_TC_SPARE_GRD_SRC2) |
|
252 | || (sid == SID_TC_DIRECT_CMD) || (sid == SID_TC_SPARE_GRD_SRC1) || (sid == SID_TC_SPARE_GRD_SRC2) | |
251 | || (sid == SID_TC_OBCP) || (sid == SID_TC_SYSTEM_CONTROL) || (sid == SID_TC_AOCS) |
|
253 | || (sid == SID_TC_OBCP) || (sid == SID_TC_SYSTEM_CONTROL) || (sid == SID_TC_AOCS) | |
252 | || (sid == SID_TC_RPW_INTERNAL)) |
|
254 | || (sid == SID_TC_RPW_INTERNAL)) | |
253 | { |
|
255 | { | |
254 | status = CCSDS_TM_VALID; |
|
256 | status = CCSDS_TM_VALID; | |
255 | } |
|
257 | } | |
256 | else |
|
258 | else | |
257 | { |
|
259 | { | |
258 | status = WRONG_SRC_ID; |
|
260 | status = WRONG_SRC_ID; | |
259 | } |
|
261 | } | |
260 |
|
262 | |||
261 | return status; |
|
263 | return status; | |
262 | } |
|
264 | } | |
263 |
|
265 | |||
264 | int tc_check_length( unsigned char packetSubType, unsigned int length ) |
|
266 | int tc_check_length( unsigned char packetSubType, unsigned int length ) | |
265 | { |
|
267 | { | |
266 | /** This function checks that the subtype and the length are compliant. |
|
268 | /** This function checks that the subtype and the length are compliant. | |
267 | * |
|
269 | * | |
268 | * @param packetSubType is the subtype to check. |
|
270 | * @param packetSubType is the subtype to check. | |
269 | * @param length is the length to check. |
|
271 | * @param length is the length to check. | |
270 | * |
|
272 | * | |
271 | * @return Status code CCSDS_TM_VALID or ILL_TYPE. |
|
273 | * @return Status code CCSDS_TM_VALID or ILL_TYPE. | |
272 | * |
|
274 | * | |
273 | */ |
|
275 | */ | |
274 |
|
276 | |||
275 | int status; |
|
277 | int status; | |
276 |
|
278 | |||
277 | status = LFR_SUCCESSFUL; |
|
279 | status = LFR_SUCCESSFUL; | |
278 |
|
280 | |||
279 | switch(packetSubType) |
|
281 | switch(packetSubType) | |
280 | { |
|
282 | { | |
281 | case TC_SUBTYPE_RESET: |
|
283 | case TC_SUBTYPE_RESET: | |
282 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
284 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { | |
283 | status = WRONG_LEN_PKT; |
|
285 | status = WRONG_LEN_PKT; | |
284 | } |
|
286 | } | |
285 | else { |
|
287 | else { | |
286 | status = CCSDS_TM_VALID; |
|
288 | status = CCSDS_TM_VALID; | |
287 | } |
|
289 | } | |
288 | break; |
|
290 | break; | |
289 | case TC_SUBTYPE_LOAD_COMM: |
|
291 | case TC_SUBTYPE_LOAD_COMM: | |
290 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
292 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
291 | status = WRONG_LEN_PKT; |
|
293 | status = WRONG_LEN_PKT; | |
292 | } |
|
294 | } | |
293 | else { |
|
295 | else { | |
294 | status = CCSDS_TM_VALID; |
|
296 | status = CCSDS_TM_VALID; | |
295 | } |
|
297 | } | |
296 | break; |
|
298 | break; | |
297 | case TC_SUBTYPE_LOAD_NORM: |
|
299 | case TC_SUBTYPE_LOAD_NORM: | |
298 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
300 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
299 | status = WRONG_LEN_PKT; |
|
301 | status = WRONG_LEN_PKT; | |
300 | } |
|
302 | } | |
301 | else { |
|
303 | else { | |
302 | status = CCSDS_TM_VALID; |
|
304 | status = CCSDS_TM_VALID; | |
303 | } |
|
305 | } | |
304 | break; |
|
306 | break; | |
305 | case TC_SUBTYPE_LOAD_BURST: |
|
307 | case TC_SUBTYPE_LOAD_BURST: | |
306 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
308 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { | |
307 | status = WRONG_LEN_PKT; |
|
309 | status = WRONG_LEN_PKT; | |
308 | } |
|
310 | } | |
309 | else { |
|
311 | else { | |
310 | status = CCSDS_TM_VALID; |
|
312 | status = CCSDS_TM_VALID; | |
311 | } |
|
313 | } | |
312 | break; |
|
314 | break; | |
313 | case TC_SUBTYPE_LOAD_SBM1: |
|
315 | case TC_SUBTYPE_LOAD_SBM1: | |
314 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
316 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { | |
315 | status = WRONG_LEN_PKT; |
|
317 | status = WRONG_LEN_PKT; | |
316 | } |
|
318 | } | |
317 | else { |
|
319 | else { | |
318 | status = CCSDS_TM_VALID; |
|
320 | status = CCSDS_TM_VALID; | |
319 | } |
|
321 | } | |
320 | break; |
|
322 | break; | |
321 | case TC_SUBTYPE_LOAD_SBM2: |
|
323 | case TC_SUBTYPE_LOAD_SBM2: | |
322 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
324 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { | |
323 | status = WRONG_LEN_PKT; |
|
325 | status = WRONG_LEN_PKT; | |
324 | } |
|
326 | } | |
325 | else { |
|
327 | else { | |
326 | status = CCSDS_TM_VALID; |
|
328 | status = CCSDS_TM_VALID; | |
327 | } |
|
329 | } | |
328 | break; |
|
330 | break; | |
329 | case TC_SUBTYPE_DUMP: |
|
331 | case TC_SUBTYPE_DUMP: | |
330 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
332 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { | |
331 | status = WRONG_LEN_PKT; |
|
333 | status = WRONG_LEN_PKT; | |
332 | } |
|
334 | } | |
333 | else { |
|
335 | else { | |
334 | status = CCSDS_TM_VALID; |
|
336 | status = CCSDS_TM_VALID; | |
335 | } |
|
337 | } | |
336 | break; |
|
338 | break; | |
337 | case TC_SUBTYPE_ENTER: |
|
339 | case TC_SUBTYPE_ENTER: | |
338 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
340 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { | |
339 | status = WRONG_LEN_PKT; |
|
341 | status = WRONG_LEN_PKT; | |
340 | } |
|
342 | } | |
341 | else { |
|
343 | else { | |
342 | status = CCSDS_TM_VALID; |
|
344 | status = CCSDS_TM_VALID; | |
343 | } |
|
345 | } | |
344 | break; |
|
346 | break; | |
345 | case TC_SUBTYPE_UPDT_INFO: |
|
347 | case TC_SUBTYPE_UPDT_INFO: | |
346 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
348 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { | |
347 | status = WRONG_LEN_PKT; |
|
349 | status = WRONG_LEN_PKT; | |
348 | } |
|
350 | } | |
349 | else { |
|
351 | else { | |
350 | status = CCSDS_TM_VALID; |
|
352 | status = CCSDS_TM_VALID; | |
351 | } |
|
353 | } | |
352 | break; |
|
354 | break; | |
353 | case TC_SUBTYPE_EN_CAL: |
|
355 | case TC_SUBTYPE_EN_CAL: | |
354 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
356 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
355 | status = WRONG_LEN_PKT; |
|
357 | status = WRONG_LEN_PKT; | |
356 | } |
|
358 | } | |
357 | else { |
|
359 | else { | |
358 | status = CCSDS_TM_VALID; |
|
360 | status = CCSDS_TM_VALID; | |
359 | } |
|
361 | } | |
360 | break; |
|
362 | break; | |
361 | case TC_SUBTYPE_DIS_CAL: |
|
363 | case TC_SUBTYPE_DIS_CAL: | |
362 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
364 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
363 | status = WRONG_LEN_PKT; |
|
365 | status = WRONG_LEN_PKT; | |
364 | } |
|
366 | } | |
365 | else { |
|
367 | else { | |
366 | status = CCSDS_TM_VALID; |
|
368 | status = CCSDS_TM_VALID; | |
367 | } |
|
369 | } | |
368 | break; |
|
370 | break; | |
369 | case TC_SUBTYPE_UPDT_TIME: |
|
371 | case TC_SUBTYPE_UPDT_TIME: | |
370 | if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
372 | if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { | |
371 | status = WRONG_LEN_PKT; |
|
373 | status = WRONG_LEN_PKT; | |
372 | } |
|
374 | } | |
373 | else { |
|
375 | else { | |
374 | status = CCSDS_TM_VALID; |
|
376 | status = CCSDS_TM_VALID; | |
375 | } |
|
377 | } | |
376 | break; |
|
378 | break; | |
377 | default: // if the subtype is not a legal value, return ILL_SUBTYPE |
|
379 | default: // if the subtype is not a legal value, return ILL_SUBTYPE | |
378 | status = ILL_SUBTYPE; |
|
380 | status = ILL_SUBTYPE; | |
379 | break ; |
|
381 | break ; | |
380 | } |
|
382 | } | |
381 |
|
383 | |||
382 | return status; |
|
384 | return status; | |
383 | } |
|
385 | } | |
384 |
|
386 | |||
385 | int tc_check_crc( ccsdsTelecommandPacket_t * TCPacket, unsigned int length, unsigned char *computed_CRC ) |
|
387 | int tc_check_crc( ccsdsTelecommandPacket_t * TCPacket, unsigned int length, unsigned char *computed_CRC ) | |
386 | { |
|
388 | { | |
387 | /** This function checks the CRC validity of the corresponding TeleCommand packet. |
|
389 | /** This function checks the CRC validity of the corresponding TeleCommand packet. | |
388 | * |
|
390 | * | |
389 | * @param TCPacket points to the TeleCommand packet to check. |
|
391 | * @param TCPacket points to the TeleCommand packet to check. | |
390 | * @param length is the length of the TC packet. |
|
392 | * @param length is the length of the TC packet. | |
391 | * |
|
393 | * | |
392 | * @return Status code CCSDS_TM_VALID or INCOR_CHECKSUM. |
|
394 | * @return Status code CCSDS_TM_VALID or INCOR_CHECKSUM. | |
393 | * |
|
395 | * | |
394 | */ |
|
396 | */ | |
395 |
|
397 | |||
396 | int status; |
|
398 | int status; | |
397 | unsigned char * CCSDSContent; |
|
399 | unsigned char * CCSDSContent; | |
398 |
|
400 | |||
399 | CCSDSContent = (unsigned char*) TCPacket->packetID; |
|
401 | CCSDSContent = (unsigned char*) TCPacket->packetID; | |
400 | GetCRCAsTwoBytes(CCSDSContent, computed_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC |
|
402 | GetCRCAsTwoBytes(CCSDSContent, computed_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC | |
401 | if (computed_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) { |
|
403 | if (computed_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) { | |
402 | status = INCOR_CHECKSUM; |
|
404 | status = INCOR_CHECKSUM; | |
403 | } |
|
405 | } | |
404 | else if (computed_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) { |
|
406 | else if (computed_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) { | |
405 | status = INCOR_CHECKSUM; |
|
407 | status = INCOR_CHECKSUM; | |
406 | } |
|
408 | } | |
407 | else { |
|
409 | else { | |
408 | status = CCSDS_TM_VALID; |
|
410 | status = CCSDS_TM_VALID; | |
409 | } |
|
411 | } | |
410 |
|
412 | |||
411 | return status; |
|
413 | return status; | |
412 | } |
|
414 | } | |
413 |
|
415 | |||
414 |
|
416 | |||
415 |
|
417 |
@@ -1,490 +1,491 | |||||
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) (TM_PACKET_ID_TC_EXE >> 8); |
|
44 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
45 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
45 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_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 | return status; |
|
74 | return status; | |
75 | } |
|
75 | } | |
76 |
|
76 | |||
77 | int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
77 | int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
78 | unsigned char byte_position, unsigned char rcv_value ) |
|
78 | unsigned char byte_position, unsigned char rcv_value ) | |
79 | { |
|
79 | { | |
80 | /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue. |
|
80 | /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue. | |
81 | * |
|
81 | * | |
82 | * @param TC points to the TeleCommand packet that is being processed |
|
82 | * @param TC points to the TeleCommand packet that is being processed | |
83 | * @param queue_id is the id of the queue which handles TM |
|
83 | * @param queue_id is the id of the queue which handles TM | |
84 | * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent |
|
84 | * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent | |
85 | * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent |
|
85 | * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent | |
86 | * |
|
86 | * | |
87 | * @return RTEMS directive status code: |
|
87 | * @return RTEMS directive status code: | |
88 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
88 | * - RTEMS_SUCCESSFUL - message sent successfully | |
89 | * - RTEMS_INVALID_ID - invalid queue id |
|
89 | * - RTEMS_INVALID_ID - invalid queue id | |
90 | * - RTEMS_INVALID_SIZE - invalid message size |
|
90 | * - RTEMS_INVALID_SIZE - invalid message size | |
91 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
91 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
92 | * - RTEMS_UNSATISFIED - out of message buffers |
|
92 | * - RTEMS_UNSATISFIED - out of message buffers | |
93 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
93 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
94 | * |
|
94 | * | |
95 | */ |
|
95 | */ | |
96 |
|
96 | |||
97 | rtems_status_code status; |
|
97 | rtems_status_code status; | |
98 | Packet_TM_LFR_TC_EXE_INCONSISTENT_t TM; |
|
98 | Packet_TM_LFR_TC_EXE_INCONSISTENT_t TM; | |
99 | unsigned char messageSize; |
|
99 | unsigned char messageSize; | |
100 |
|
100 | |||
101 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
101 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
102 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
102 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
103 | TM.reserved = DEFAULT_RESERVED; |
|
103 | TM.reserved = DEFAULT_RESERVED; | |
104 | TM.userApplication = CCSDS_USER_APP; |
|
104 | TM.userApplication = CCSDS_USER_APP; | |
105 | // PACKET HEADER |
|
105 | // PACKET HEADER | |
106 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
106 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
107 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
107 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
108 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
108 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
109 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); |
|
109 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8); | |
110 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); |
|
110 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT ); | |
111 | // DATA FIELD HEADER |
|
111 | // DATA FIELD HEADER | |
112 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
112 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
113 | TM.serviceType = TM_TYPE_TC_EXE; |
|
113 | TM.serviceType = TM_TYPE_TC_EXE; | |
114 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
114 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
115 | TM.destinationID = TC->sourceID; |
|
115 | TM.destinationID = TC->sourceID; | |
116 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
116 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
117 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
117 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
118 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
118 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
119 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
119 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
120 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
120 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
121 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
121 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
122 | // |
|
122 | // | |
123 | TM.tc_failure_code[0] = (char) (WRONG_APP_DATA >> 8); |
|
123 | TM.tc_failure_code[0] = (char) (WRONG_APP_DATA >> 8); | |
124 | TM.tc_failure_code[1] = (char) (WRONG_APP_DATA ); |
|
124 | TM.tc_failure_code[1] = (char) (WRONG_APP_DATA ); | |
125 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
125 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
126 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
126 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
127 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
127 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
128 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
128 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
129 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
129 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
130 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
130 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
131 | TM.byte_position = byte_position; |
|
131 | TM.byte_position = byte_position; | |
132 | TM.rcv_value = rcv_value; |
|
132 | TM.rcv_value = rcv_value; | |
133 |
|
133 | |||
134 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
134 | messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
135 |
|
135 | |||
136 | // SEND DATA |
|
136 | // SEND DATA | |
137 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
137 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
138 | if (status != RTEMS_SUCCESSFUL) { |
|
138 | if (status != RTEMS_SUCCESSFUL) { | |
139 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") |
|
139 | PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n") | |
140 | } |
|
140 | } | |
141 |
|
141 | |||
142 | return status; |
|
142 | return status; | |
143 | } |
|
143 | } | |
144 |
|
144 | |||
145 | int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
145 | int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
146 | { |
|
146 | { | |
147 | /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue. |
|
147 | /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue. | |
148 | * |
|
148 | * | |
149 | * @param TC points to the TeleCommand packet that is being processed |
|
149 | * @param TC points to the TeleCommand packet that is being processed | |
150 | * @param queue_id is the id of the queue which handles TM |
|
150 | * @param queue_id is the id of the queue which handles TM | |
151 | * |
|
151 | * | |
152 | * @return RTEMS directive status code: |
|
152 | * @return RTEMS directive status code: | |
153 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
153 | * - RTEMS_SUCCESSFUL - message sent successfully | |
154 | * - RTEMS_INVALID_ID - invalid queue id |
|
154 | * - RTEMS_INVALID_ID - invalid queue id | |
155 | * - RTEMS_INVALID_SIZE - invalid message size |
|
155 | * - RTEMS_INVALID_SIZE - invalid message size | |
156 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
156 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
157 | * - RTEMS_UNSATISFIED - out of message buffers |
|
157 | * - RTEMS_UNSATISFIED - out of message buffers | |
158 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
158 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
159 | * |
|
159 | * | |
160 | */ |
|
160 | */ | |
161 |
|
161 | |||
162 | rtems_status_code status; |
|
162 | rtems_status_code status; | |
163 | Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t TM; |
|
163 | Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t TM; | |
164 | unsigned char messageSize; |
|
164 | unsigned char messageSize; | |
165 |
|
165 | |||
166 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
166 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
167 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
167 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
168 | TM.reserved = DEFAULT_RESERVED; |
|
168 | TM.reserved = DEFAULT_RESERVED; | |
169 | TM.userApplication = CCSDS_USER_APP; |
|
169 | TM.userApplication = CCSDS_USER_APP; | |
170 | // PACKET HEADER |
|
170 | // PACKET HEADER | |
171 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
171 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
172 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
172 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
173 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
173 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
174 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); |
|
174 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8); | |
175 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); |
|
175 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE ); | |
176 | // DATA FIELD HEADER |
|
176 | // DATA FIELD HEADER | |
177 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
177 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
178 | TM.serviceType = TM_TYPE_TC_EXE; |
|
178 | TM.serviceType = TM_TYPE_TC_EXE; | |
179 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
179 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
180 | TM.destinationID = TC->sourceID; // default destination id |
|
180 | TM.destinationID = TC->sourceID; // default destination id | |
181 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
181 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
182 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
182 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
183 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
183 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
184 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
184 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
185 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
185 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
186 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
186 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
187 | // |
|
187 | // | |
188 | TM.tc_failure_code[0] = (char) (TC_NOT_EXE >> 8); |
|
188 | TM.tc_failure_code[0] = (char) (TC_NOT_EXE >> 8); | |
189 | TM.tc_failure_code[1] = (char) (TC_NOT_EXE ); |
|
189 | TM.tc_failure_code[1] = (char) (TC_NOT_EXE ); | |
190 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
190 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
191 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
191 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
192 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
192 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
193 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
193 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
194 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
194 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
195 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
195 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
196 | TM.lfr_status_word[0] = housekeeping_packet.lfr_status_word[0]; |
|
196 | TM.lfr_status_word[0] = housekeeping_packet.lfr_status_word[0]; | |
197 | TM.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1]; |
|
197 | TM.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1]; | |
198 |
|
198 | |||
199 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
199 | messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
200 |
|
200 | |||
201 | // SEND DATA |
|
201 | // SEND DATA | |
202 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
202 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
203 | if (status != RTEMS_SUCCESSFUL) { |
|
203 | if (status != RTEMS_SUCCESSFUL) { | |
204 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") |
|
204 | PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n") | |
205 | } |
|
205 | } | |
206 |
|
206 | |||
207 | return status; |
|
207 | return status; | |
208 | } |
|
208 | } | |
209 |
|
209 | |||
210 | int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
210 | int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
211 | { |
|
211 | { | |
212 | /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue. |
|
212 | /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue. | |
213 | * |
|
213 | * | |
214 | * @param TC points to the TeleCommand packet that is being processed |
|
214 | * @param TC points to the TeleCommand packet that is being processed | |
215 | * @param queue_id is the id of the queue which handles TM |
|
215 | * @param queue_id is the id of the queue which handles TM | |
216 | * |
|
216 | * | |
217 | * @return RTEMS directive status code: |
|
217 | * @return RTEMS directive status code: | |
218 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
218 | * - RTEMS_SUCCESSFUL - message sent successfully | |
219 | * - RTEMS_INVALID_ID - invalid queue id |
|
219 | * - RTEMS_INVALID_ID - invalid queue id | |
220 | * - RTEMS_INVALID_SIZE - invalid message size |
|
220 | * - RTEMS_INVALID_SIZE - invalid message size | |
221 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
221 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
222 | * - RTEMS_UNSATISFIED - out of message buffers |
|
222 | * - RTEMS_UNSATISFIED - out of message buffers | |
223 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
223 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
224 | * |
|
224 | * | |
225 | */ |
|
225 | */ | |
226 |
|
226 | |||
227 | rtems_status_code status; |
|
227 | rtems_status_code status; | |
228 | Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t TM; |
|
228 | Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t TM; | |
229 | unsigned char messageSize; |
|
229 | unsigned char messageSize; | |
230 |
|
230 | |||
231 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
231 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
232 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
232 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
233 | TM.reserved = DEFAULT_RESERVED; |
|
233 | TM.reserved = DEFAULT_RESERVED; | |
234 | TM.userApplication = CCSDS_USER_APP; |
|
234 | TM.userApplication = CCSDS_USER_APP; | |
235 | // PACKET HEADER |
|
235 | // PACKET HEADER | |
236 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
236 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
237 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
237 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
238 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
238 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
239 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); |
|
239 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8); | |
240 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); |
|
240 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED ); | |
241 | // DATA FIELD HEADER |
|
241 | // DATA FIELD HEADER | |
242 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
242 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
243 | TM.serviceType = TM_TYPE_TC_EXE; |
|
243 | TM.serviceType = TM_TYPE_TC_EXE; | |
244 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
244 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
245 | TM.destinationID = TC->sourceID; // default destination id |
|
245 | TM.destinationID = TC->sourceID; // default destination id | |
246 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
246 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
247 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
247 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
248 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
248 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
249 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
249 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
250 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
250 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
251 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
251 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
252 | // |
|
252 | // | |
253 | TM.tc_failure_code[0] = (char) (FUNCT_NOT_IMPL >> 8); |
|
253 | TM.tc_failure_code[0] = (char) (FUNCT_NOT_IMPL >> 8); | |
254 | TM.tc_failure_code[1] = (char) (FUNCT_NOT_IMPL ); |
|
254 | TM.tc_failure_code[1] = (char) (FUNCT_NOT_IMPL ); | |
255 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
255 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
256 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
256 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
257 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
257 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
258 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
258 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
259 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
259 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
260 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
260 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
261 |
|
261 | |||
262 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
262 | messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
263 |
|
263 | |||
264 | // SEND DATA |
|
264 | // SEND DATA | |
265 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
265 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
266 | if (status != RTEMS_SUCCESSFUL) { |
|
266 | if (status != RTEMS_SUCCESSFUL) { | |
267 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") |
|
267 | PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n") | |
268 | } |
|
268 | } | |
269 |
|
269 | |||
270 | return status; |
|
270 | return status; | |
271 | } |
|
271 | } | |
272 |
|
272 | |||
273 | int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
273 | int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
274 | { |
|
274 | { | |
275 | /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue. |
|
275 | /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue. | |
276 | * |
|
276 | * | |
277 | * @param TC points to the TeleCommand packet that is being processed |
|
277 | * @param TC points to the TeleCommand packet that is being processed | |
278 | * @param queue_id is the id of the queue which handles TM |
|
278 | * @param queue_id is the id of the queue which handles TM | |
279 | * |
|
279 | * | |
280 | * @return RTEMS directive status code: |
|
280 | * @return RTEMS directive status code: | |
281 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
281 | * - RTEMS_SUCCESSFUL - message sent successfully | |
282 | * - RTEMS_INVALID_ID - invalid queue id |
|
282 | * - RTEMS_INVALID_ID - invalid queue id | |
283 | * - RTEMS_INVALID_SIZE - invalid message size |
|
283 | * - RTEMS_INVALID_SIZE - invalid message size | |
284 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
284 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
285 | * - RTEMS_UNSATISFIED - out of message buffers |
|
285 | * - RTEMS_UNSATISFIED - out of message buffers | |
286 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
286 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
287 | * |
|
287 | * | |
288 | */ |
|
288 | */ | |
289 |
|
289 | |||
290 | rtems_status_code status; |
|
290 | rtems_status_code status; | |
291 | Packet_TM_LFR_TC_EXE_ERROR_t TM; |
|
291 | Packet_TM_LFR_TC_EXE_ERROR_t TM; | |
292 | unsigned char messageSize; |
|
292 | unsigned char messageSize; | |
293 |
|
293 | |||
294 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
294 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
295 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
295 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
296 | TM.reserved = DEFAULT_RESERVED; |
|
296 | TM.reserved = DEFAULT_RESERVED; | |
297 | TM.userApplication = CCSDS_USER_APP; |
|
297 | TM.userApplication = CCSDS_USER_APP; | |
298 | // PACKET HEADER |
|
298 | // PACKET HEADER | |
299 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
299 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
300 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
300 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
301 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
301 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
302 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); |
|
302 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8); | |
303 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); |
|
303 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR ); | |
304 | // DATA FIELD HEADER |
|
304 | // DATA FIELD HEADER | |
305 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
305 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
306 | TM.serviceType = TM_TYPE_TC_EXE; |
|
306 | TM.serviceType = TM_TYPE_TC_EXE; | |
307 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
307 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
308 | TM.destinationID = TC->sourceID; // default destination id |
|
308 | TM.destinationID = TC->sourceID; // default destination id | |
309 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
309 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
310 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
310 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
311 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
311 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
312 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
312 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
313 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
313 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
314 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
314 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
315 | // |
|
315 | // | |
316 | TM.tc_failure_code[0] = (char) (FAIL_DETECTED >> 8); |
|
316 | TM.tc_failure_code[0] = (char) (FAIL_DETECTED >> 8); | |
317 | TM.tc_failure_code[1] = (char) (FAIL_DETECTED ); |
|
317 | TM.tc_failure_code[1] = (char) (FAIL_DETECTED ); | |
318 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
318 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
319 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
319 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
320 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
320 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
321 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
321 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
322 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
322 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
323 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
323 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
324 |
|
324 | |||
325 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
325 | messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
326 |
|
326 | |||
327 | // SEND DATA |
|
327 | // SEND DATA | |
328 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
328 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
329 | if (status != RTEMS_SUCCESSFUL) { |
|
329 | if (status != RTEMS_SUCCESSFUL) { | |
330 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
330 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
331 | } |
|
331 | } | |
332 |
|
332 | |||
333 | return status; |
|
333 | return status; | |
334 | } |
|
334 | } | |
335 |
|
335 | |||
336 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, |
|
336 | int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, | |
337 |
unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV |
|
337 | unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, | |
|
338 | unsigned char destinationID) | |||
338 | { |
|
339 | { | |
339 | /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue. |
|
340 | /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue. | |
340 | * |
|
341 | * | |
341 | * @param TC points to the TeleCommand packet that is being processed |
|
342 | * @param TC points to the TeleCommand packet that is being processed | |
342 | * @param queue_id is the id of the queue which handles TM |
|
343 | * @param queue_id is the id of the queue which handles TM | |
343 | * @param computed_CRC points to a buffer of two bytes containing the CRC computed during the parsing of the TeleCommand |
|
344 | * @param computed_CRC points to a buffer of two bytes containing the CRC computed during the parsing of the TeleCommand | |
344 | * @param currentTC_LEN_RCV points to a buffer of two bytes containing a packet size field computed on the received data |
|
345 | * @param currentTC_LEN_RCV points to a buffer of two bytes containing a packet size field computed on the received data | |
345 | * |
|
346 | * | |
346 | * @return RTEMS directive status code: |
|
347 | * @return RTEMS directive status code: | |
347 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
348 | * - RTEMS_SUCCESSFUL - message sent successfully | |
348 | * - RTEMS_INVALID_ID - invalid queue id |
|
349 | * - RTEMS_INVALID_ID - invalid queue id | |
349 | * - RTEMS_INVALID_SIZE - invalid message size |
|
350 | * - RTEMS_INVALID_SIZE - invalid message size | |
350 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
351 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
351 | * - RTEMS_UNSATISFIED - out of message buffers |
|
352 | * - RTEMS_UNSATISFIED - out of message buffers | |
352 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
353 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
353 | * |
|
354 | * | |
354 | */ |
|
355 | */ | |
355 |
|
356 | |||
356 | rtems_status_code status; |
|
357 | rtems_status_code status; | |
357 | Packet_TM_LFR_TC_EXE_CORRUPTED_t TM; |
|
358 | Packet_TM_LFR_TC_EXE_CORRUPTED_t TM; | |
358 | unsigned char messageSize; |
|
359 | unsigned char messageSize; | |
359 | unsigned int packetLength; |
|
360 | unsigned int packetLength; | |
360 | unsigned char *packetDataField; |
|
361 | unsigned char *packetDataField; | |
361 |
|
362 | |||
362 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; // compute the packet length parameter |
|
363 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; // compute the packet length parameter | |
363 | packetDataField = (unsigned char *) &TC->headerFlag_pusVersion_Ack; // get the beginning of the data field |
|
364 | packetDataField = (unsigned char *) &TC->headerFlag_pusVersion_Ack; // get the beginning of the data field | |
364 |
|
365 | |||
365 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
366 | TM.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
366 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
367 | TM.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
367 | TM.reserved = DEFAULT_RESERVED; |
|
368 | TM.reserved = DEFAULT_RESERVED; | |
368 | TM.userApplication = CCSDS_USER_APP; |
|
369 | TM.userApplication = CCSDS_USER_APP; | |
369 | // PACKET HEADER |
|
370 | // PACKET HEADER | |
370 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); |
|
371 | TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8); | |
371 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); |
|
372 | TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE ); | |
372 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); |
|
373 | increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID ); | |
373 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); |
|
374 | TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8); | |
374 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); |
|
375 | TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED ); | |
375 | // DATA FIELD HEADER |
|
376 | // DATA FIELD HEADER | |
376 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
377 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
377 | TM.serviceType = TM_TYPE_TC_EXE; |
|
378 | TM.serviceType = TM_TYPE_TC_EXE; | |
378 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; |
|
379 | TM.serviceSubType = TM_SUBTYPE_EXE_NOK; | |
379 |
TM.destinationID = |
|
380 | TM.destinationID = destinationID; | |
380 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
381 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
381 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
382 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
382 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
383 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
383 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
384 | TM.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
384 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
385 | TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
385 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
386 | TM.time[5] = (unsigned char) (time_management_regs->fine_time); | |
386 | // |
|
387 | // | |
387 | TM.tc_failure_code[0] = (unsigned char) (CORRUPTED >> 8); |
|
388 | TM.tc_failure_code[0] = (unsigned char) (CORRUPTED >> 8); | |
388 | TM.tc_failure_code[1] = (unsigned char) (CORRUPTED ); |
|
389 | TM.tc_failure_code[1] = (unsigned char) (CORRUPTED ); | |
389 | TM.telecommand_pkt_id[0] = TC->packetID[0]; |
|
390 | TM.telecommand_pkt_id[0] = TC->packetID[0]; | |
390 | TM.telecommand_pkt_id[1] = TC->packetID[1]; |
|
391 | TM.telecommand_pkt_id[1] = TC->packetID[1]; | |
391 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; |
|
392 | TM.pkt_seq_control[0] = TC->packetSequenceControl[0]; | |
392 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; |
|
393 | TM.pkt_seq_control[1] = TC->packetSequenceControl[1]; | |
393 | TM.tc_service = TC->serviceType; // type of the rejected TC |
|
394 | TM.tc_service = TC->serviceType; // type of the rejected TC | |
394 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC |
|
395 | TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC | |
395 | TM.pkt_len_rcv_value[0] = TC->packetLength[0]; |
|
396 | TM.pkt_len_rcv_value[0] = TC->packetLength[0]; | |
396 | TM.pkt_len_rcv_value[1] = TC->packetLength[1]; |
|
397 | TM.pkt_len_rcv_value[1] = TC->packetLength[1]; | |
397 | TM.pkt_datafieldsize_cnt[0] = currentTC_LEN_RCV[0]; |
|
398 | TM.pkt_datafieldsize_cnt[0] = currentTC_LEN_RCV[0]; | |
398 | TM.pkt_datafieldsize_cnt[1] = currentTC_LEN_RCV[1]; |
|
399 | TM.pkt_datafieldsize_cnt[1] = currentTC_LEN_RCV[1]; | |
399 | TM.rcv_crc[0] = packetDataField[ packetLength - 1 ]; |
|
400 | TM.rcv_crc[0] = packetDataField[ packetLength - 1 ]; | |
400 | TM.rcv_crc[1] = packetDataField[ packetLength ]; |
|
401 | TM.rcv_crc[1] = packetDataField[ packetLength ]; | |
401 | TM.computed_crc[0] = computed_CRC[0]; |
|
402 | TM.computed_crc[0] = computed_CRC[0]; | |
402 | TM.computed_crc[1] = computed_CRC[1]; |
|
403 | TM.computed_crc[1] = computed_CRC[1]; | |
403 |
|
404 | |||
404 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
405 | messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
405 |
|
406 | |||
406 | // SEND DATA |
|
407 | // SEND DATA | |
407 | status = rtems_message_queue_send( queue_id, &TM, messageSize); |
|
408 | status = rtems_message_queue_send( queue_id, &TM, messageSize); | |
408 | if (status != RTEMS_SUCCESSFUL) { |
|
409 | if (status != RTEMS_SUCCESSFUL) { | |
409 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") |
|
410 | PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n") | |
410 | } |
|
411 | } | |
411 |
|
412 | |||
412 | return status; |
|
413 | return status; | |
413 | } |
|
414 | } | |
414 |
|
415 | |||
415 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) |
|
416 | void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id ) | |
416 | { |
|
417 | { | |
417 | unsigned short sequence_cnt; |
|
418 | unsigned short sequence_cnt; | |
418 | unsigned short segmentation_grouping_flag; |
|
419 | unsigned short segmentation_grouping_flag; | |
419 | unsigned short new_packet_sequence_control; |
|
420 | unsigned short new_packet_sequence_control; | |
420 | unsigned char i; |
|
421 | unsigned char i; | |
421 |
|
422 | |||
422 | switch (destination_id) |
|
423 | switch (destination_id) | |
423 | { |
|
424 | { | |
424 | case SID_TC_GROUND: |
|
425 | case SID_TC_GROUND: | |
425 | i = GROUND; |
|
426 | i = GROUND; | |
426 | break; |
|
427 | break; | |
427 | case SID_TC_MISSION_TIMELINE: |
|
428 | case SID_TC_MISSION_TIMELINE: | |
428 | i = MISSION_TIMELINE; |
|
429 | i = MISSION_TIMELINE; | |
429 | break; |
|
430 | break; | |
430 | case SID_TC_TC_SEQUENCES: |
|
431 | case SID_TC_TC_SEQUENCES: | |
431 | i = TC_SEQUENCES; |
|
432 | i = TC_SEQUENCES; | |
432 | break; |
|
433 | break; | |
433 | case SID_TC_RECOVERY_ACTION_CMD: |
|
434 | case SID_TC_RECOVERY_ACTION_CMD: | |
434 | i = RECOVERY_ACTION_CMD; |
|
435 | i = RECOVERY_ACTION_CMD; | |
435 | break; |
|
436 | break; | |
436 | case SID_TC_BACKUP_MISSION_TIMELINE: |
|
437 | case SID_TC_BACKUP_MISSION_TIMELINE: | |
437 | i = BACKUP_MISSION_TIMELINE; |
|
438 | i = BACKUP_MISSION_TIMELINE; | |
438 | break; |
|
439 | break; | |
439 | case SID_TC_DIRECT_CMD: |
|
440 | case SID_TC_DIRECT_CMD: | |
440 | i = DIRECT_CMD; |
|
441 | i = DIRECT_CMD; | |
441 | break; |
|
442 | break; | |
442 | case SID_TC_SPARE_GRD_SRC1: |
|
443 | case SID_TC_SPARE_GRD_SRC1: | |
443 | i = SPARE_GRD_SRC1; |
|
444 | i = SPARE_GRD_SRC1; | |
444 | break; |
|
445 | break; | |
445 | case SID_TC_SPARE_GRD_SRC2: |
|
446 | case SID_TC_SPARE_GRD_SRC2: | |
446 | i = SPARE_GRD_SRC2; |
|
447 | i = SPARE_GRD_SRC2; | |
447 | break; |
|
448 | break; | |
448 | case SID_TC_OBCP: |
|
449 | case SID_TC_OBCP: | |
449 | i = OBCP; |
|
450 | i = OBCP; | |
450 | break; |
|
451 | break; | |
451 | case SID_TC_SYSTEM_CONTROL: |
|
452 | case SID_TC_SYSTEM_CONTROL: | |
452 | i = SYSTEM_CONTROL; |
|
453 | i = SYSTEM_CONTROL; | |
453 | break; |
|
454 | break; | |
454 | case SID_TC_AOCS: |
|
455 | case SID_TC_AOCS: | |
455 | i = AOCS; |
|
456 | i = AOCS; | |
456 | break; |
|
457 | break; | |
457 | case SID_TC_RPW_INTERNAL: |
|
458 | case SID_TC_RPW_INTERNAL: | |
458 | i = RPW_INTERNAL; |
|
459 | i = RPW_INTERNAL; | |
459 | break; |
|
460 | break; | |
460 | default: |
|
461 | default: | |
461 | i = UNKNOWN; |
|
462 | i = UNKNOWN; | |
462 | break; |
|
463 | break; | |
463 | } |
|
464 | } | |
464 |
|
465 | |||
465 | if (i != UNKNOWN) |
|
466 | if (i != UNKNOWN) | |
466 | { |
|
467 | { | |
467 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; |
|
468 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
468 | sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff; |
|
469 | sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff; | |
469 |
|
470 | |||
470 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; |
|
471 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; | |
471 |
|
472 | |||
472 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); |
|
473 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |
473 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); |
|
474 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |
474 |
|
475 | |||
475 | // increment the sequence counter for the next packet |
|
476 | // increment the sequence counter for the next packet | |
476 | if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX) |
|
477 | if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX) | |
477 | { |
|
478 | { | |
478 | sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1; |
|
479 | sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1; | |
479 | } |
|
480 | } | |
480 | else |
|
481 | else | |
481 | { |
|
482 | { | |
482 | sequenceCounters_TC_EXE[ i ] = 0; |
|
483 | sequenceCounters_TC_EXE[ i ] = 0; | |
483 | } |
|
484 | } | |
484 | } |
|
485 | } | |
485 | else |
|
486 | else | |
486 | { |
|
487 | { | |
487 | DEBUG_PRINTF1("in increment_seq_counter_destination_id *** ERR destination ID %d not known\n", destination_id) |
|
488 | DEBUG_PRINTF1("in increment_seq_counter_destination_id *** ERR destination ID %d not known\n", destination_id) | |
488 | } |
|
489 | } | |
489 |
|
490 | |||
490 | } |
|
491 | } |
General Comments 0
You need to be logged in to leave comments.
Login now