CORDET Framework - C2 Implementation
CrPsDpServHk.h
Go to the documentation of this file.
1 
23 #ifndef CRPSDPSERVHK_H_
24 #define CRPSDPSERVHK_H_
25 
26 #include <CrPsUserConstants.h>
27 #include <CrFwUserConstants.h>
28 
32 typedef struct {
37  CrPsAddr_t debugVarAddr[HK_N_DEBUG_VAR];
47  CrPsFlag_t isEnabled[HK_N_REP_DEF];
51  CrPsPeriod_t period[HK_N_REP_DEF];
56  CrPsSid_t sid[HK_N_REP_DEF]; /* TODO hier war uint16_t ???*/
58 
62 typedef struct {
67  CrFwCounterU4_t cycleCnt[HK_N_REP_DEF];
72  CrPsValueU4_t debugVar[HK_N_DEBUG_VAR];
76  CrPsParamId_t lstId[HK_N_REP_DEF*HK_MAX_N_ITEMS];
80  CrPsNumberU2_t lstNSampRep[HK_N_REP_DEF*HK_MAX_N_GR];
84  CrPsRepetition_t lstSampleRep[HK_N_REP_DEF*HK_MAX_N_GR];
88  CrPsNumberU2_t nSimple[HK_N_REP_DEF];
95 
96 extern DpServHkParams_t dpServHkParams;
97 extern DpServHkVars_t dpServHkVars;
98 
99 /*Sampling Buffer
100 
101 first 1 bis HK_N_SAMP_BUFFER
102 second 2 max nr of groups HK_MAX_N_GR
103 third max nr of items in a group HK_MAX_N_REP
104 fourth max nr of sc values HK_MAX_REP
105 
106 */
107 extern uint32_t SampleBuffer[HK_MAX_REP][HK_MAX_N_REP][HK_MAX_N_GR][HK_N_SAMP_BUF];
108 
112 void initDpServHk(void);
113 
118 static inline uint32_t getDpBufferElement(uint32_t i, uint32_t j, uint32_t k, uint32_t l)
119 {
120  return SampleBuffer[i][j][k][l];
121 }
122 
127 static inline void setDpBufferElement(uint32_t i, uint32_t j, uint32_t k, uint32_t l, uint32_t t)
128 {
129  SampleBuffer[i][j][k][l] = t;
130 }
131 
132 
133 static inline uint16_t getDplstSampleRepItem(int i);
134 
140 static inline CrFwCounterU4_t getNFA(int i)
141 {
142  int k;
143  uint32_t curSCSampleRepNum;
144 
145  for (k=0; k<HK_MAX_N_GR; k++)
146  {
147  curSCSampleRepNum = getDplstSampleRepItem(i*HK_MAX_N_GR+k);
148  if (curSCSampleRepNum == 0)
149  break;
150  }
151 
152  return k;
153 }
154 
159 static inline CrPsAddr_t* getDpdebugVarAddrArray()
160 {
161  return &dpServHkParams.debugVarAddr[0];
162 }
163 
169 static inline CrPsAddr_t getDpdebugVarAddrItem(int i)
170 {
171  return dpServHkParams.debugVarAddr[i];
172 }
173 
180 static inline void setDpdebugVarAddrItem(int i, CrPsAddr_t debugVarAddr)
181 {
182  dpServHkParams.debugVarAddr[i] = debugVarAddr;
183 }
184 
190 {
191  return &dpServHkParams.dest[0];
192 }
193 
199 static inline CrPsDestSrc_t getDpdestItem(int i)
200 {
201  return dpServHkParams.dest[i];
202 }
203 
210 static inline void setDpdestItem(int i, CrPsDestSrc_t dest)
211 {
212  dpServHkParams.dest[i] = dest;
213 }
214 
219 static inline CrPsFlag_t* getDpisEnabledArray()
220 {
221  return &dpServHkParams.isEnabled[0];
222 }
223 
229 static inline CrPsFlag_t getDpisEnabledItem(int i)
230 {
231  return dpServHkParams.isEnabled[i];
232 }
233 
240 static inline void setDpisEnabledItem(int i, CrPsFlag_t isEnabled)
241 {
242  dpServHkParams.isEnabled[i] = isEnabled;
243 }
244 
249 static inline CrPsPeriod_t* getDpperiodArray()
250 {
251  return &dpServHkParams.period[0];
252 }
253 
259 static inline CrPsPeriod_t getDpperiodItem(int i)
260 {
261  return dpServHkParams.period[i];
262 }
263 
270 static inline void setDpperiodItem(int i, CrPsPeriod_t period)
271 {
272  dpServHkParams.period[i] = period;
273 }
274 
279 static inline CrPsSid_t* getDpsidArray()
280 {
281  return &dpServHkParams.sid[0];
282 }
283 
289 static inline CrPsSid_t getDpsidItem(int i) /* TODO sid war hier auch uint16 */
290 {
291  return dpServHkParams.sid[i];
292 }
293 
300 static inline void setDpsidItem(int i, CrPsSid_t sid) /* TODO sid war hier auch uint16 */
301 {
302  dpServHkParams.sid[i] = sid;
303 }
304 
309 static inline CrFwCounterU4_t* getDpcycleCntArray()
310 {
311  return &dpServHkVars.cycleCnt[0];
312 }
313 
319 static inline CrFwCounterU4_t getDpcycleCntItem(int i)
320 {
321  return dpServHkVars.cycleCnt[i];
322 }
323 
330 static inline void setDpcycleCntItem(int i, CrFwCounterU4_t cycleCnt)
331 {
332  dpServHkVars.cycleCnt[i] = cycleCnt;
333 }
334 
339 static inline CrPsValueU4_t* getDpdebugVarArray()
340 {
341  return &dpServHkVars.debugVar[0];
342 }
343 
349 static inline CrPsValueU4_t getDpdebugVarItem(int i)
350 {
351  return dpServHkVars.debugVar[i];
352 }
353 
360 static inline void setDpdebugVarItem(int i, CrPsValueU4_t debugVar)
361 {
362  dpServHkVars.debugVar[i] = debugVar;
363 }
364 
370 {
371  return &dpServHkVars.lstId[0];
372 }
373 
379 static inline CrPsParamId_t getDplstIdItem(int i)
380 {
381  return dpServHkVars.lstId[i];
382 }
383 
390 static inline void setDplstIdItem(int i, CrPsParamId_t lstId)
391 {
392  dpServHkVars.lstId[i] = lstId;
393 }
394 
399 static inline CrPsNumberU2_t* getDplstNSampRepArray()
400 {
401  return &dpServHkVars.lstNSampRep[0];
402 }
403 
409 static inline CrPsNumberU2_t getDplstNSampRepItem(int i)
410 {
411  return dpServHkVars.lstNSampRep[i];
412 }
413 
420 static inline void setDplstNSampRepItem(int i, CrPsNumberU2_t lstNSampRep)
421 {
422  dpServHkVars.lstNSampRep[i] = lstNSampRep;
423 }
424 
429 static inline CrPsRepetition_t* getDplstSampleRepArray()
430 {
431  return &dpServHkVars.lstSampleRep[0];
432 }
433 
439 static inline CrPsRepetition_t getDplstSampleRepItem(int i)
440 {
441  return dpServHkVars.lstSampleRep[i];
442 }
443 
450 static inline void setDplstSampleRepItem(int i, CrPsRepetition_t lstSampleRep)
451 {
452  dpServHkVars.lstSampleRep[i] = lstSampleRep;
453 }
454 
459 static inline CrPsNumberU2_t* getDpnSimpleArray()
460 {
461  return &dpServHkVars.nSimple[0];
462 }
463 
469 static inline CrPsNumberU2_t getDpnSimpleItem(int i)
470 {
471  return dpServHkVars.nSimple[i];
472 }
473 
480 static inline void setDpnSimpleItem(int i, CrPsNumberU2_t nSimple)
481 {
482  dpServHkVars.nSimple[i] = nSimple;
483 }
484 
490 {
491  return &dpServHkVars.sampleBufId[0];
492 }
493 
500 {
501  return dpServHkVars.sampleBufId[i];
502 }
503 
510 static inline void setDpsampleBufIdItem(int i, CrPsParamId_t sampleBufId)
511 {
512  dpServHkVars.sampleBufId[i] = sampleBufId;
513 }
514 
515 
516 /*----------------------------------------------------------------------------*/
517 #endif /* CRPSDPSERVHK_H */
static CrPsPeriod_t getDpperiodItem(int i)
Gets the value of the i-th element in the datapool array period.
Definition: CrPsDpServHk.h:259
CrFwCounterU4_t i
CrPsCmd5EidStart function definitions.
static CrPsAddr_t getDpdebugVarAddrItem(int i)
Gets the value of the i-th element in the datapool array debugVarAddr.
Definition: CrPsDpServHk.h:169
static void setDpBufferElement(uint32_t i, uint32_t j, uint32_t k, uint32_t l, uint32_t t)
Sets a Datapool Buffer Element.
Definition: CrPsDpServHk.h:127
static void setDpdebugVarAddrItem(int i, CrPsAddr_t debugVarAddr)
Sets the value of the i-th element in the datapool array debugVarAddr.
Definition: CrPsDpServHk.h:180
Header file to define all user-configurable constants and types for the IASW Application.
CrPsSid_t sid[HK_N_REP_DEF]
Array of HK_N_REP_DEF elements.
Definition: CrPsDpServHk.h:56
uint16_t CrPsParamId_t
Type used for the Parameter ID of a packet.
static CrPsFlag_t getDpisEnabledItem(int i)
Gets the value of the i-th element in the datapool array isEnabled.
Definition: CrPsDpServHk.h:229
static CrPsParamId_t * getDplstIdArray()
Gets the datapool array lstId.
Definition: CrPsDpServHk.h:369
static CrPsAddr_t * getDpdebugVarAddrArray()
Gets the datapool array debugVarAddr.
Definition: CrPsDpServHk.h:159
static CrPsSid_t * getDpsidArray()
Gets the datapool array sid.
Definition: CrPsDpServHk.h:279
Type description.
Definition: CrPsDpServHk.h:62
#define HK_MAX_N_REP
Maximum number of data items in a super-commutated groups in a housekeeping/diagnostic report...
uint16_t CrPsDestSrc_t
Type used for the Destination or Source of a packet.
static void setDpdestItem(int i, CrPsDestSrc_t dest)
Sets the value of the i-th element in the datapool array dest.
Definition: CrPsDpServHk.h:210
CrPsAddr_t debugVarAddr[HK_N_DEBUG_VAR]
Array of HK_N_DEBUG_VAR elements.
Definition: CrPsDpServHk.h:37
CrPsNumberU2_t nSimple[HK_N_REP_DEF]
max ximple
Definition: CrPsDpServHk.h:88
static CrPsValueU4_t getDpdebugVarItem(int i)
Gets the value of the i-th element in the datapool array debugVar.
Definition: CrPsDpServHk.h:349
static uint32_t getDpBufferElement(uint32_t i, uint32_t j, uint32_t k, uint32_t l)
Gets a Datapool Buffer Element.
Definition: CrPsDpServHk.h:118
static void setDplstNSampRepItem(int i, CrPsNumberU2_t lstNSampRep)
Sets the value of the i-th element in the datapool array lstNSampRep.
Definition: CrPsDpServHk.h:420
static CrPsSid_t getDpsidItem(int i)
Gets the value of the i-th element in the datapool array sid.
Definition: CrPsDpServHk.h:289
static void setDpsidItem(int i, CrPsSid_t sid)
Sets the value of the i-th element in the datapool array sid.
Definition: CrPsDpServHk.h:300
static void setDpcycleCntItem(int i, CrFwCounterU4_t cycleCnt)
Sets the value of the i-th element in the datapool array cycleCnt.
Definition: CrPsDpServHk.h:330
static void setDpisEnabledItem(int i, CrPsFlag_t isEnabled)
Sets the value of the i-th element in the datapool array isEnabled.
Definition: CrPsDpServHk.h:240
CrPsFlag_t isEnabled[HK_N_REP_DEF]
Array of HK_N_REP_DEF elements.
Definition: CrPsDpServHk.h:47
static void setDplstSampleRepItem(int i, CrPsRepetition_t lstSampleRep)
Sets the value of the i-th element in the datapool array lstSampleRep.
Definition: CrPsDpServHk.h:450
static CrFwCounterU4_t getNFA(int i)
Gets the number of super-commutated groups (NFA) from number of sample repetition numbers (rep[]) ...
Definition: CrPsDpServHk.h:140
#define HK_MAX_REP
Maximum value of the repetition number of a super- commutated group in a housekeeping/diagnostic repo...
static CrPsNumberU2_t * getDpnSimpleArray()
Gets the datapool array nSimple.
Definition: CrPsDpServHk.h:459
void initDpServHk(void)
Initialises ServHk.
Definition: CrPsDpServHk.c:31
CrPsRepetition_t lstSampleRep[HK_N_REP_DEF *HK_MAX_N_GR]
max N group; rep[1..nGroup]
Definition: CrPsDpServHk.h:84
CrPsNumberU2_t lstNSampRep[HK_N_REP_DEF *HK_MAX_N_GR]
Max N rep; nRep[1..nGroup].
Definition: CrPsDpServHk.h:80
static void setDpnSimpleItem(int i, CrPsNumberU2_t nSimple)
Sets the value of the i-th element in the datapool array nSimple.
Definition: CrPsDpServHk.h:480
CrFwCounterU4_t cycleCnt[HK_N_REP_DEF]
Array of HK_N_REP_DEF elements.
Definition: CrPsDpServHk.h:67
static void setDpsampleBufIdItem(int i, CrPsParamId_t sampleBufId)
Sets the value of the i-th element in the datapool array sampleBufId.
Definition: CrPsDpServHk.h:510
static CrPsNumberU2_t * getDplstNSampRepArray()
Gets the datapool array lstNSampRep.
Definition: CrPsDpServHk.h:399
static CrPsValueU4_t * getDpdebugVarArray()
Gets the datapool array debugVar.
Definition: CrPsDpServHk.h:339
static CrPsNumberU2_t getDplstNSampRepItem(int i)
Gets the value of the i-th element in the datapool array lstNSampRep.
Definition: CrPsDpServHk.h:409
static CrFwDestSrc_t dest
Destination.
CrPsPeriod_t period[HK_N_REP_DEF]
Collection period in units of HK_COLLECT_PER.
Definition: CrPsDpServHk.h:51
#define HK_N_REP_DEF
Number of Report Definitions in the Report Definition List (maximum number of housekeeping/diagnostic...
static CrFwCounterU4_t * getDpcycleCntArray()
Gets the datapool array cycleCnt.
Definition: CrPsDpServHk.h:309
uint8_t CrPsSid_t
Type used for the Parameter Report Structure ID of a packet.
static void setDpperiodItem(int i, CrPsPeriod_t period)
Sets the value of the i-th element in the datapool array period.
Definition: CrPsDpServHk.h:270
static CrPsParamId_t getDpsampleBufIdItem(int i)
Gets the value of the i-th element in the datapool array sampleBufId.
Definition: CrPsDpServHk.h:499
static CrPsPeriod_t * getDpperiodArray()
Gets the datapool array period.
Definition: CrPsDpServHk.h:249
CrPsValueU4_t debugVar[HK_N_DEBUG_VAR]
Array of HK_N_DEBUG_VAR elements.
Definition: CrPsDpServHk.h:72
#define HK_MAX_N_GR
Maximum number of super-commutated groups in a house- keeping/diagnostic report.
static CrFwCounterU4_t getDpcycleCntItem(int i)
Gets the value of the i-th element in the datapool array cycleCnt.
Definition: CrPsDpServHk.h:319
Type description.
Definition: CrPsDpServHk.h:32
static CrPsDestSrc_t * getDpdestArray()
Gets the datapool array dest.
Definition: CrPsDpServHk.h:189
static uint16_t getDplstSampleRepItem(int i)
Gets the value of the i-th element in the datapool array lstSampleRep.
Definition: CrPsDpServHk.h:439
static CrPsDestSrc_t getDpdestItem(int i)
Gets the value of the i-th element in the datapool array dest.
Definition: CrPsDpServHk.h:199
CrPsParamId_t lstId[HK_N_REP_DEF *HK_MAX_N_ITEMS]
Max N Items.
Definition: CrPsDpServHk.h:76
CrPsDestSrc_t dest[HK_N_REP_DEF]
Array of HK_N_REP_DEF elements.
Definition: CrPsDpServHk.h:42
static void setDplstIdItem(int i, CrPsParamId_t lstId)
Sets the value of the i-th element in the datapool array lstId.
Definition: CrPsDpServHk.h:390
static CrPsFlag_t * getDpisEnabledArray()
Gets the datapool array isEnabled.
Definition: CrPsDpServHk.h:219
static CrPsParamId_t getDplstIdItem(int i)
Gets the value of the i-th element in the datapool array lstId.
Definition: CrPsDpServHk.h:379
#define HK_N_SAMP_BUF
Number of service 3 Sampling Buffers.
static CrPsParamId_t * getDpsampleBufIdArray()
Gets the datapool array sampleBufId.
Definition: CrPsDpServHk.h:489
static CrPsRepetition_t * getDplstSampleRepArray()
Gets the datapool array lstSampleRep.
Definition: CrPsDpServHk.h:429
CrPsParamId_t sampleBufId[HK_N_REP_DEF]
Array of HK_N_REP_DEF elements.
Definition: CrPsDpServHk.h:93
static CrPsNumberU2_t getDpnSimpleItem(int i)
Gets the value of the i-th element in the datapool array nSimple.
Definition: CrPsDpServHk.h:469
static void setDpdebugVarItem(int i, CrPsValueU4_t debugVar)
Sets the value of the i-th element in the datapool array debugVar.
Definition: CrPsDpServHk.h:360
#define HK_N_DEBUG_VAR
Number of debug variables.
P&P Software GmbH, Copyright 2012-2013, All Rights Reserved