1553.c 4.34 KB
Newer Older
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/*
Code automatically generated by asn1scc tool
Date was: 1/24/2011
Time was: 20:29:04
*/
#include <string.h>
#include <math.h>
#include "1553.h"


#ifndef _MSC_VER
#endif

void __po_hi_c_Node_Addr_T_Initialize(__po_hi_c_Node_Addr_T* pVal)
{
	*pVal = 0;
}


flag __po_hi_c_Node_Addr_T_IsConstraintValid(const __po_hi_c_Node_Addr_T* pVal, int* pErrCode) 
{
	if ( !(((*pVal>=0) && (*pVal<=31))) ) {
		*pErrCode = ERR___po_hi_c_Node_Addr_T;
		return FALSE;
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Node_Addr_T_Equal(const __po_hi_c_Node_Addr_T* pVal1, const __po_hi_c_Node_Addr_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_Standard_T_Initialize(__po_hi_c_Standard_T* pVal)
{
	*pVal = __po_hi_c_mil1553a;
}


flag __po_hi_c_Standard_T_IsConstraintValid(const __po_hi_c_Standard_T* pVal, int* pErrCode) 
{
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Standard_T_Equal(const __po_hi_c_Standard_T* pVal1, const __po_hi_c_Standard_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_Mode_T_Initialize(__po_hi_c_Mode_T* pVal)
{
	*pVal = __po_hi_c_controller;
}


flag __po_hi_c_Mode_T_IsConstraintValid(const __po_hi_c_Mode_T* pVal, int* pErrCode) 
{
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Mode_T_Equal(const __po_hi_c_Mode_T* pVal1, const __po_hi_c_Mode_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_Bus_T_Initialize(__po_hi_c_Bus_T* pVal)
{
	*pVal = __po_hi_c_none;
}


flag __po_hi_c_Bus_T_IsConstraintValid(const __po_hi_c_Bus_T* pVal, int* pErrCode) 
{
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Bus_T_Equal(const __po_hi_c_Bus_T* pVal1, const __po_hi_c_Bus_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_mil_1553_conf_t_Initialize(__po_hi_c_mil_1553_conf_t* pVal)
{
	memset(pVal->devname, 0x0, 21);
	__po_hi_c_Standard_T_Initialize(&pVal->standard);
	__po_hi_c_Mode_T_Initialize(&pVal->mode);
	__po_hi_c_Bus_T_Initialize(&pVal->bus);
	pVal->termaddr = 0;
	pVal->broadcast = FALSE;
	pVal->rxblock = FALSE;
	pVal->txblock = FALSE;
}


flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t* pVal, int* pErrCode) 
{
	if ( !(((strlen(pVal->devname)>=1) && (strlen(pVal->devname)<=20))) ) {
		*pErrCode = ERR___po_hi_c_mil_1553_conf_t_devname;
		return FALSE;
	}
	if ( !__po_hi_c_Standard_T_IsConstraintValid(&pVal->standard, pErrCode)) 
		return FALSE;

	if ( !__po_hi_c_Mode_T_IsConstraintValid(&pVal->mode, pErrCode)) 
		return FALSE;

	if ( !__po_hi_c_Bus_T_IsConstraintValid(&pVal->bus, pErrCode)) 
		return FALSE;

	if ( !__po_hi_c_Node_Addr_T_IsConstraintValid(&pVal->termaddr, pErrCode)) 
		return FALSE;


	if (pVal->exist.rxblock) {
	}
	if (pVal->exist.txblock) {
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_mil_1553_conf_t_Equal(const __po_hi_c_mil_1553_conf_t* pVal1, const __po_hi_c_mil_1553_conf_t* pVal2) 
{
	if (strcmp(pVal1->devname, pVal2->devname) !=0)
		return FALSE;
	if (!__po_hi_c_Standard_T_Equal(&pVal1->standard, &pVal2->standard))
		return FALSE;
	if (!__po_hi_c_Mode_T_Equal(&pVal1->mode, &pVal2->mode))
		return FALSE;
	if (!__po_hi_c_Bus_T_Equal(&pVal1->bus, &pVal2->bus))
		return FALSE;
	if (!__po_hi_c_Node_Addr_T_Equal(&pVal1->termaddr, &pVal2->termaddr))
		return FALSE;
	if ( (pVal1->broadcast && !pVal2->broadcast) || (!pVal1->broadcast && pVal2->broadcast))
		return FALSE;
	if (pVal1->exist.rxblock != pVal2->exist.rxblock)
		return FALSE;
	if (pVal1->exist.rxblock) {
		if ( (pVal1->rxblock && !pVal2->rxblock) || (!pVal1->rxblock && pVal2->rxblock))
			return FALSE;
	}
	if (pVal1->exist.txblock != pVal2->exist.txblock)
		return FALSE;
	if (pVal1->exist.txblock) {
		if ( (pVal1->txblock && !pVal2->txblock) || (!pVal1->txblock && pVal2->txblock))
			return FALSE;
	}
	return TRUE;
}