versadac  1
versadac - Scalable Recorder Firmware
sttup.h
1 /*---------------------------------------------------------------------------*/
2 /* Copyright (C) 2006 Woodhead Software & Electonics. All rights reserved. */
3 /*---------------------------------------------------------------------------*/
4 /* This program is protected by international copyright. */
5 /* */
6 /* The use of this software including but not limited to its Source Code */
7 /* is subject to restrictions as agreed in the license agreement between */
8 /* you and Woodhead. */
9 /* Copying or distribution is not allowed unless expressly permitted */
10 /* according to your license agreement with Woodhead. */
11 /*---------------------------------------------------------------------------*/
12 /* */
13 /* Project : STACK PROFINET device */
14 /* Component : sttup header */
15 /* $Workfile:: sttup.h $*/
16 /* $Revision:: 6 $*/
17 /* $Date:: 13/07/11 13:57 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* start up state machine header */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 
26 #ifndef _STTUP_H
27 #define _STTUP_H
28 
29 
30 #define PNI_STAT_OK 0x80 /* the GOOD value of an IOXS*/
31 /* Submodule management */
32 
33 /*Submodule plug state*/
34 #define PLUG_IDLE 0
35 #define PLUG_WFPRMIND 1
36 #define PLUG_WFUSRRES 2
37 #define PLUG_WFDATAUPDATE 3
38 #define PLUG_WFAPLRDYCNF 4
39 #define PLUG_WFALCNF 5
40 #define PLUG_WFNEWDATA 6
41 
42 /* submodule Type */
43 #define SUB_MODULE_TYPE_PLUG 0
44 #define SUB_MODULE_TYPE_RELEASE 1
45 #define SUB_MODULE_TYPE_RETURN 2
46 #define SUB_MODULE_TYPE_WRONG 3
47 
48 
49 /*Submodule pull state*/
50 #define PULL_IDLE 0
51 #define PULL_WFALCNF 1
52 
53 
54 APP_WORD msg_ase_task(APP_LPVOID pStart);
55 
56 APP_DWORD APP_FAR fspmdev_dcp_set_name_ind(LPST_MSG* ppMsg);
57 APP_DWORD APP_FAR fspmdev_dcp_set_ip_ind(LPST_MSG* ppMsg);
58 APP_DWORD APP_FAR fspmdev_dcp_set_blink_ind(LPST_MSG* ppMsg);
59 APP_DWORD APP_FAR fspmdev_connect_ind(LPST_MSG* ppMsg);
60 APP_DWORD APP_FAR fspmdev_write_ind(LPST_MSG* ppMsg);
61 APP_DWORD APP_FAR fspmdev_read_ind(LPST_MSG* ppMsg);
62 APP_DWORD APP_FAR fspmdev_dcontrol_ind(LPST_MSG* ppMsg);
63 APP_DWORD APP_FAR fspmdev_ccontrol_rsp_neg(LPST_MSG* ppMsg);
64 APP_DWORD APP_FAR fspmdev_ccontrol_rsp_pos(LPST_MSG* ppMsg);
65 APP_DWORD APP_FAR fspmdev_release_ind(LPST_MSG* ppMsg);
66 APP_DWORD APP_FAR stackdev_ccontrol_req(LPST_MSG* ppMsg);
67 APP_DWORD APP_FAR fspmdev_abort_ind(LPST_MSG* ppMsg);
68 APP_DWORD APP_FAR fspmdev_dcp_set_reset_factory_ind(LPST_MSG* ppMsg);
69 APP_DWORD APP_FAR fspmdev_alarm_notification_cnf_pos(LPST_MSG* ppMsg);
70 APP_DWORD APP_FAR fspmdev_alarm_notification_cnf_neg(LPST_MSG* ppMsg);
71 APP_DWORD APP_FAR fspmdev_alarm_ack_ind(LPST_MSG* ppMsg);
72 
73 APP_DWORD APP_FAR stackdev_plug_req(LPST_MSG* ppMsg);
74 APP_DWORD APP_FAR stackdev_pull_req(LPST_MSG* ppMsg);
75 
76 APP_DWORD APP_FAR stackdev_get_input_req(LPST_MSG* ppMsg);
77 APP_DWORD APP_FAR stackdev_set_output_req(LPST_MSG* ppMsg);
78 APP_DWORD APP_FAR stackdev_set_input_iocs_req(LPST_MSG* ppMsg);
79 APP_DWORD APP_FAR stackdev_get_output_iocs_req(LPST_MSG* ppMsg);
80 APP_DWORD APP_FAR stackdev_set_output_APDU_req(LPST_MSG* ppMsg);
81 APP_DWORD APP_FAR stackdev_alarm_req(LPST_MSG* ppMsg);
82 
83 
84 APP_DWORD APP_FAR ppm_set_input_cnf_neg (LPST_MSG* ppMsg);
85 APP_DWORD APP_FAR ppm_set_input_cnf_pos (LPST_MSG* ppMsg);
86 APP_DWORD APP_FAR cpm_get_output_cnf_neg (LPST_MSG* ppMsg);
87 APP_DWORD APP_FAR cpm_get_output_cnf_pos (LPST_MSG* ppMsg);
88 APP_DWORD APP_FAR cpm_set_output_apdu_cnf_pos (LPST_MSG* ppMsg);
89 APP_DWORD APP_FAR cpm_set_output_apdu_cnf_neg (LPST_MSG* ppMsg);
90 APP_DWORD APP_FAR cpm_get_output_iocs_cnf_neg (LPST_MSG* ppMsg);
91 APP_DWORD APP_FAR cpm_get_output_iocs_cnf_pos (LPST_MSG* ppMsg);
92 APP_DWORD APP_FAR stackdev_ctrl_alarm_ack (LPST_MSG* ppMsg);
93 APP_DWORD APP_FAR fspmdev_alarm_ctrl_ind (LPST_MSG* ppMsg);
94 APP_DWORD APP_FAR stackdev_sttup_init (LPST_MSG* ppMsg);
95 APP_DWORD APP_FAR fspmdev_init_cnf_pos (LPST_MSG* ppMsg);
96 APP_DWORD APP_FAR fspmdev_init_cnf_neg (LPST_MSG* ppMsg);
97 APP_DWORD APP_FAR stackdev_get_input_apdu_status(LPST_MSG* ppMsg);
98 APP_DWORD APP_FAR stackdev_sttup_stop (LPST_MSG* ppMsg);
99 APP_DWORD APP_FAR stackdev_hello_configuration (LPST_MSG* ppMsg);
100 
101 
102 #ifdef NEW_INPUT_DATA_MODE
103  APP_DWORD APP_FAR fspmdev_new_data_ind (LPST_MSG* ppMsg);
104 #endif
105 
106 #ifdef DHCP_ACTIVATE
107  APP_DWORD APP_FAR fspmdev_set_dhcp_ind (LPST_MSG* ppMsg);
108 #endif /* DHCP_ACTIVATE */
109 
110 APP_WORD freeEC(LPST_AREP lpArep, LPST_POOL lpstPoolIocr, LPST_POOL lpstPoolUsi, LPST_POOL lpstPoolEc);
111 
112 #define RETURN_FSPMDEV_CONNECT_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_CONNECT_RSP_POS; return SEND_MESSAGE
113 #define RETURN_FSPMDEV_CONNECT_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_CONNECT_RSP_NEG; return SEND_MESSAGE
114 
115 #define RETURN_FSPMDEV_WRITE_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_WRITE_RSP_POS; return SEND_MESSAGE
116 #define RETURN_FSPMDEV_WRITE_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_WRITE_RSP_NEG; return SEND_MESSAGE
117 
118 #define RETURN_FSPMDEV_READ_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_READ_RSP_POS; return SEND_MESSAGE
119 #define RETURN_FSPMDEV_READ_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_READ_RSP_NEG; return SEND_MESSAGE
120 
121 #define RETURN_FSPMDEV_DCONTROL_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCONTROL_RSP_POS; return SEND_MESSAGE
122 #define RETURN_FSPMDEV_DCONTROL_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCONTROL_RSP_NEG; return SEND_MESSAGE
123 
124 #define RETURN_FSPMDEV_RELEASE_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RELEASE_RSP_POS; return SEND_MESSAGE
125 #define RETURN_FSPMDEV_RELEASE_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RELEASE_RSP_NEG; return SEND_MESSAGE
126 
127 #define RETURN_FSPMDEV_CCONTROL_REQ (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_CCONTROL_REQ; return SEND_MESSAGE
128 
129 
130 #define RETURN_FSPMDEV_SET_NAME_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_NAME_CNF_POS; return SEND_MESSAGE
131 #define RETURN_FSPMDEV_SET_NAME_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_NAME_CNF_NEG; return SEND_MESSAGE
132 
133 #define RETURN_FSPMDEV_SET_IP_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_IP_CNF_POS; return SEND_MESSAGE
134 #define RETURN_FSPMDEV_SET_IP_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_IP_CNF_NEG; return SEND_MESSAGE
135 
136 #define RETURN_FSPMDEV_SET_BLINK_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_BLINK_CNF_POS; return SEND_MESSAGE
137 
138 #define RETURN_FSPMDEV_SET_FACT_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_RESET_FACTORY_CNF_POS; return SEND_MESSAGE
139 #define RETURN_FSPMDEV_SET_FACT_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_RESET_FACTORY_CNF_NEG; return SEND_MESSAGE
140 
141 #define RETURN_FSPMDEV_SET_DHCP_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_DHCP_CNF_POS; return SEND_MESSAGE
142 #define RETURN_FSPMDEV_SET_DHCP_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_DCP_SET_DHCP_CNF_NEG; return SEND_MESSAGE
143 
144 #define RETURN_FSPMDEV_ALARM_REQ (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_ALARM_REQ; return SEND_MESSAGE
145 #define RETURN_FSPMDEV_CTRL_ALARM_ACK (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_ALARM_ACK_REQ; return SEND_MESSAGE
146 
147 
148 
149 #define RETURN_PPM_SET_PROV_STATUS_REQ (*ppMsg)->dwQueue = ID_QUEUE_PPM; (*ppMsg)->wCodeFnct = ID_PPM_SET_PROV_STATUS_REQ; return SEND_MESSAGE
150 
151 
152 
153 #define SEND_FSPMDEV_POOL_UNLOCK(lpMsg)\
154  lpMsg->dwQueue = ID_QUEUE_FSPMDEV;\
155  lpMsg->wCodeFnct = ID_POOL_UNLOCK_REQ;\
156  OsSendMessagePtr(gdwTaskID[ID_QUEUE_FSPMDEV],&lpMsg,MSG_PRIO_NORMAL)\
157 
158 
159 #define RETURN_CPM_GET_CONS_STATUS_REQ (*ppMsg)->dwQueue = ID_QUEUE_CPM; (*ppMsg)->wCodeFnct = ID_CPM_GET_CONS_STATUS_REQ; return SEND_MESSAGE
160 #define RETURN_CPM_GET_CONS_DATA_REQ (*ppMsg)->dwQueue = ID_QUEUE_CPM; (*ppMsg)->wCodeFnct = ID_CPM_GET_CONS_DATA_REQ; return SEND_MESSAGE
161 
162 #define RETURN_CPM_SET_PROV_DATA_REQ (*ppMsg)->dwQueue = ID_QUEUE_PPM; (*ppMsg)->wCodeFnct = ID_PPM_SET_PROV_DATA_REQ; return SEND_MESSAGE
163 
164 
165 #endif
166 
Definition: message.h:1163