-
Notifications
You must be signed in to change notification settings - Fork 40
/
to_lab_msg.h
148 lines (124 loc) · 4.46 KB
/
to_lab_msg.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 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://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
* Define TO Lab Messages and info
*/
#ifndef TO_LAB_MSG_H
#define TO_LAB_MSG_H
#define TO_LAB_NOOP_CC 0 /* no-op command */
#define TO_LAB_RESET_STATUS_CC 1 /* reset status */
#define TO_LAB_ADD_PKT_CC 2 /* add packet */
#define TO_LAB_SEND_DATA_TYPES_CC 3 /* send data types */
#define TO_LAB_REMOVE_PKT_CC 4 /* remove packet */
#define TO_LAB_REMOVE_ALL_PKT_CC 5 /* remove all packet */
#define TO_LAB_OUTPUT_ENABLE_CC 6 /* output enable */
/******************************************************************************/
typedef struct
{
uint8 CommandCounter;
uint8 CommandErrorCounter;
uint8 spareToAlign[2];
} TO_LAB_HkTlm_Payload_t;
typedef struct
{
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
TO_LAB_HkTlm_Payload_t Payload; /**< \brief Telemetry payload */
} TO_LAB_HkTlm_t;
/******************************************************************************/
typedef struct
{
uint16 synch;
#if 0
bit_field bit1:1;
bit_field bit2:1;
bit_field bit34:2;
bit_field bit56:2;
bit_field bit78:2;
bit_field nibble1:4;
bit_field nibble2:4;
#endif
uint8 bl1, bl2; /* boolean */
int8 b1, b2, b3, b4;
int16 w1, w2;
int32 dw1, dw2;
float f1, f2;
double df1, df2;
char str[10];
} TO_LAB_DataTypes_Payload_t;
typedef struct
{
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
TO_LAB_DataTypes_Payload_t Payload; /**< \brief Telemetry payload */
} TO_LAB_DataTypesTlm_t;
/******************************************************************************/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeade; /**< \brief Command header */
} TO_LAB_NoArgsCmd_t;
/*
* The following commands do not have any payload,
* but should still "reserve" a unique structure type to
* employ a consistent handler pattern.
*
* This matches the pattern in CFE core and other modules.
*/
typedef TO_LAB_NoArgsCmd_t TO_LAB_NoopCmd_t;
typedef TO_LAB_NoArgsCmd_t TO_LAB_ResetCountersCmd_t;
typedef TO_LAB_NoArgsCmd_t TO_LAB_RemoveAllCmd_t;
typedef TO_LAB_NoArgsCmd_t TO_LAB_SendDataTypesCmd_t;
typedef struct
{
CFE_SB_MsgId_t Stream;
CFE_SB_Qos_t Flags;
uint8 BufLimit;
} TO_LAB_AddPacket_Payload_t;
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
TO_LAB_AddPacket_Payload_t Payload; /**< \brief Command payload */
} TO_LAB_AddPacketCmd_t;
/*****************************************************************************/
typedef struct
{
CFE_SB_MsgId_t Stream;
CFE_SB_Qos_t Flags;
uint16 BufLimit;
} TO_LAB_subscription_t;
/******************************************************************************/
typedef struct
{
CFE_SB_MsgId_t Stream;
} TO_LAB_RemovePacket_Payload_t;
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
TO_LAB_RemovePacket_Payload_t Payload; /**< \brief Command payload */
} TO_LAB_RemovePacketCmd_t;
/******************************************************************************/
typedef struct
{
char dest_IP[16];
} TO_LAB_EnableOutput_Payload_t;
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */
TO_LAB_EnableOutput_Payload_t Payload; /**< \brief Command payload */
} TO_LAB_EnableOutputCmd_t;
/******************************************************************************/
#endif