1553.c 3.06 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
3
4
5
/*
 * This is a part of PolyORB-HI-C distribution, a minimal
 * middleware written for generated code from AADL models.
 * You should use it with the Ocarina toolsuite.
 *
yoogx's avatar
yoogx committed
6
 * For more informations, please visit http://taste.tuxfamily.org/wiki
yoogx's avatar
yoogx committed
7
8
9
10
 *
 * Copyright (C) 2014 ESA & ISAE.
 */

11
#if (defined (__PO_HI_NEED_DRIVER_1553_RASTA))\n
12
13
/*
Code automatically generated by asn1scc tool
14
15
Date was: 2/7/2012
Time was: 15:35:34
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
*/
#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;
}




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;
}




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;
}




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;
}




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;
}





138
\n#endif