-
Notifications
You must be signed in to change notification settings - Fork 42
/
sample_app.h
126 lines (106 loc) · 3.55 KB
/
sample_app.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*******************************************************************************
**
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http:https://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app.h
**
** Purpose:
** This file is main hdr file for the SAMPLE application.
**
**
*******************************************************************************/
#ifndef _sample_app_h_
#define _sample_app_h_
/*
** Required header files.
*/
#include "cfe.h"
#include "cfe_error.h"
#include "cfe_evs.h"
#include "cfe_sb.h"
#include "cfe_es.h"
#include "sample_app_perfids.h"
#include "sample_app_msgids.h"
#include "sample_app_msg.h"
#include "sample_app_cmds.h"
#include "sample_app_utils.h"
/***********************************************************************/
#define SAMPLE_PIPE_DEPTH 32 /* Depth of the Command Pipe for Application */
#define SAMPLE_NUMBER_OF_TABLES 1 /* Number of Table(s) */
/* Define filenames of default data images for tables */
#define SAMPLE_TABLE_FILE "/cf/sample_table.tbl"
#define SAMPLE_TABLE_OUT_OF_RANGE_ERR_CODE -1
#define SAMPLE_TBL_ELEMENT_1_MAX 10
/************************************************************************
** Type Definitions
*************************************************************************/
/*
* Buffer to hold telemetry data prior to sending
* Defined as a union to ensure proper alignment for a CFE_SB_Msg_t type
*/
typedef union
{
CFE_SB_Msg_t MsgHdr;
SAMPLE_HkTlm_t HkTlm;
} SAMPLE_HkBuffer_t;
/*
** Global Data
*/
typedef struct
{
/*
** Command interface counters...
*/
uint8 CmdCounter;
uint8 ErrCounter;
/*
** Housekeeping telemetry packet...
*/
SAMPLE_HkBuffer_t HkBuf;
/*
** Run Status variable used in the main processing loop
*/
uint32 RunStatus;
/*
** Operational data (not reported in housekeeping)...
*/
CFE_SB_PipeId_t CommandPipe;
CFE_SB_MsgPtr_t MsgPtr;
/*
** Initialization data (not reported in housekeeping)...
*/
char PipeName[16];
uint16 PipeDepth;
CFE_EVS_BinFilter_t EventFilters[SAMPLE_EVENT_COUNTS];
CFE_TBL_Handle_t TblHandles[SAMPLE_NUMBER_OF_TABLES];
} SAMPLE_AppData_t;
extern SAMPLE_AppData_t SAMPLE_AppData;
/****************************************************************************/
/*
** Local function prototypes.
**
** Note: Except for the entry point (SAMPLE_AppMain), these
** functions are not called from any other source module.
*/
void SAMPLE_AppMain(void);
int32 SAMPLE_AppInit(void);
void SAMPLE_ProcessCommandPacket(CFE_SB_MsgPtr_t Msg);
void SAMPLE_ProcessGroundCommand(CFE_SB_MsgPtr_t Msg);
int32 SAMPLE_ReportHousekeeping(const CCSDS_CommandPacket_t *Msg);
#endif /* _sample_app_h_ */