versadac  1
versadac - Scalable Recorder Firmware
cmdev.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 : CMDEV managment */
15 /* $Workfile:: cmdev.h $*/
16 /* $Revision:: 2 $*/
17 /* $Date:: 9/22/09 6:01p $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* Cmdev managment */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 #ifndef _CMDEV_H
26 #define _CMDEV_H
27 
28 APP_DWORD APP_FAR cm_init_req(LPST_MSG* ppMsg);
29 APP_DWORD APP_FAR rm_connect_ind(LPST_MSG* ppMsg);
30 APP_DWORD APP_FAR cm_connect_rsp_pos (LPST_MSG* ppMsg);
31 APP_DWORD APP_FAR cm_connect_rsp_neg (LPST_MSG* ppMsg);
32 APP_DWORD APP_FAR rm_write_ind(LPST_MSG* ppMsg);
33 APP_DWORD APP_FAR cm_write_cnf_pos (LPST_MSG* ppMsg);
34 APP_DWORD APP_FAR cm_write_cnf_neg (LPST_MSG* ppMsg);
35 APP_DWORD APP_FAR rm_read_ind(LPST_MSG* ppMsg);
36 APP_DWORD APP_FAR cm_read_rsp_pos(LPST_MSG* ppMsg);
37 APP_DWORD APP_FAR cm_read_rsp_neg(LPST_MSG* ppMsg);
38 APP_DWORD APP_FAR rm_dcontrol_ind (LPST_MSG* ppMsg);
39 APP_DWORD APP_FAR cm_dcontrol_rsp_pos(LPST_MSG* ppMsg);
40 APP_DWORD APP_FAR cm_dcontrol_rsp_neg(LPST_MSG* ppMsg);
41 APP_DWORD APP_FAR rm_release_ind(LPST_MSG* ppMsg);
42 APP_DWORD APP_FAR cm_release_rsp_pos(LPST_MSG* ppMsg);
43 APP_DWORD APP_FAR cm_release_rsp_neg(LPST_MSG* ppMsg);
44 APP_DWORD APP_FAR cm_ccontrol_req(LPST_MSG* ppMsg);
45 APP_DWORD APP_FAR rm_ccontrol_cnf_pos(LPST_MSG* ppMsg);
46 APP_DWORD APP_FAR rm_ccontrol_cnf_neg(LPST_MSG* ppMsg);
47 APP_DWORD APP_FAR cm_set_prov_status_req(LPST_MSG* ppMsg);
48 APP_DWORD APP_FAR ppm_activate_cnf(LPST_MSG* ppMsg);
49 APP_DWORD APP_FAR alpmi_activate_cnf_pos(LPST_MSG* ppMsg);
50 APP_DWORD APP_FAR alpmi_activate_cnf_neg(LPST_MSG* ppMsg);
51 APP_DWORD APP_FAR cm_abort_req(LPST_MSG* ppMsg);
52 APP_DWORD APP_FAR cpm_stop_ind(LPST_MSG* ppMsg);
53 APP_DWORD APP_FAR cpm_new_cons_data_ind(LPST_MSG* ppMsg);
54 APP_DWORD APP_FAR ppm_error_ind(LPST_MSG* ppMsg);
55 APP_DWORD APP_FAR alpmi_error_ind(LPST_MSG* ppMsg);
56 APP_DWORD APP_FAR alpmr_error_ind(LPST_MSG* ppMsg);
57 APP_DWORD APP_FAR cpm_activate_cnf(LPST_MSG* ppMsg);
58 APP_DWORD APP_FAR cpm_close_cnf(LPST_MSG* ppMsg);
59 APP_DWORD APP_FAR ppm_close_cnf(LPST_MSG* ppMsg);
60 APP_DWORD APP_FAR alpmi_close_cnf_pos(LPST_MSG* ppMsg);
61 APP_DWORD APP_FAR alpmi_close_cnf_neg(LPST_MSG* ppMsg);
62 APP_DWORD APP_FAR ppm_set_prov_status_cnf_pos(LPST_MSG* ppMsg);
63 APP_DWORD APP_FAR ppm_set_prov_status_cnf_neg(LPST_MSG* ppMsg);
64 APP_DWORD APP_FAR cmdev_Timeout(LPST_MSG* ppMsg);
65 APP_DWORD APP_FAR rm_abort_cnf(LPST_MSG* ppMsg);
66 APP_DWORD APP_FAR alpmr_activate_cnf_pos(LPST_MSG* ppMsg);
67 APP_DWORD APP_FAR alpmr_activate_cnf_neg(LPST_MSG* ppMsg);
68 APP_DWORD APP_FAR alpmr_close_cnf_pos(LPST_MSG* ppMsg);
69 
70 APP_WORD RemoveConsumer ( LPST_AREP lpArep , LPST_CREP lpCrepConsumer );
71 APP_WORD RemoveProvider ( LPST_AREP lpArep , LPST_CREP lpCrepProvider );
72 APP_BOOL ConsumingStopped ( LPST_AREP lpArep , APP_LPVOID lpContext );
73 APP_BOOL ProvidingStopped ( LPST_AREP lpArep , APP_LPVOID lpContext );
74 APP_VOID AlarmStopped ( LPST_AREP lpArep , APP_LPVOID lpContext, APP_BOOL bALPMR, APP_WORD wPrio);
75 
76 
77 #ifdef TEST_TIMER_PRECISION_WSE
78 APP_WORD timer_precision_wse (APP_LPVOID lpData, APP_WORD wDummy);
79 #endif
80 
81 /* STATE */
82 #define CMDEV_STATE_POWER_ON 0
83 #define CMDEV_STATE_W_CIND 1
84 #define CMDEV_STATE_W_CRES 2
85 #define CMDEV_STATE_W_PPM_O 3
86 #define CMDEV_STATE_W_ALPM_O 4
87 #define CMDEV_STATE_W_PIND 4
88 #define CMDEV_STATE_W_ACTC_1 6
89 #define CMDEV_STATE_W_ACTC_2 7
90 #define CMDEV_STATE_W_PRES 8
91 #define CMDEV_STATE_W_ERES 9
92 #define CMDEV_STATE_W_ARDY 10
93 #define CMDEV_STATE_W_RDYC 11
94 #define CMDEV_STATE_DATA 12
95 #define CMDEV_STATE_W_ALPM_O_H 13
96 #define CMDEV_STATE_ABORT 14
97 #define CMDEV_STATE_ABORT_H 15
98 #define CMDEV_STATE_W_PM_O 16
99 
100 #define CMDEV_INIT_REQ OS_SEND_MESSAGE_CMDEV(ID_CMDEV_INIT_REQ)
101 
102 
103 #define RETURN_RMPM_ABORT_REQ (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_ABORT_REQ; return SEND_MESSAGE
104 
105 #define RETURN_FSPMDEV_CONNECT_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_CONNECT_IND; return SEND_MESSAGE
106 #define RETURN_RMPM_CONNET_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_CONNECT_RSP_POS; return SEND_MESSAGE
107 #define RETURN_RMPM_CONNET_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_CONNECT_RSP_NEG; return SEND_MESSAGE
108 
109 #define RETURN_FSPMDEV_WRITE_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CM_WRITE_IND; return SEND_MESSAGE
110 #define RETURN_RMPM_WRITE_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_WRITE_RSP_POS; return SEND_MESSAGE
111 #define RETURN_RMPM_WRITE_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_WRITE_RSP_NEG; return SEND_MESSAGE
112 
113 #define RETURN_FSPMDEV_READ_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CM_READ_IND; return SEND_MESSAGE
114 #define RETURN_RMPM_READ_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_READ_RSP_POS; return SEND_MESSAGE
115 #define RETURN_RMPM_READ_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_READ_RSP_NEG; return SEND_MESSAGE
116 
117 #define RETURN_FSPMDEV_DCONTROL_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_DCONTROL_IND; return SEND_MESSAGE
118 #define RETURN_RMPM_DCONTROL_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_DCONTROL_RSP_POS; return SEND_MESSAGE
119 #define RETURN_RMPM_DCONTROL_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_DCONTROL_RSP_NEG; return SEND_MESSAGE
120 
121 #define RETURN_FSPMDEV_RELEASE_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_RELEASE_IND; return SEND_MESSAGE
122 #define RETURN_RMPM_RELEASE_RPS_POS (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_RELEASE_RSP_POS; return SEND_MESSAGE
123 #define RETURN_RMPM_RELEASE_RPS_NEG (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_RELEASE_RSP_NEG; return SEND_MESSAGE
124 
125 #define RETURN_RMPM_CCONTROL_REQ (*ppMsg)->dwQueue = ID_QUEUE_RMPM; (*ppMsg)->wCodeFnct = ID_RMPM_CCONTROL_REQ; return SEND_MESSAGE
126 #define RETURN_FSPMDEV_CCONTROL_CNF_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_CCONTROL_CNF_POS; return SEND_MESSAGE
127 #define RETURN_FSPMDEV_CCONTROL_CNF_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_CCONTROL_CNF_NEG; return SEND_MESSAGE
128 
129 /* #define RETURN_FSPMDEV_INIT_CNF_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RMPM_INIT_CNF_POS; return SEND_MESSAGE*/
130 #define RETURN_FSPMDEV_INIT_CNF_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_FSPMDEV_RMPM_INIT_CNF_NEG; return SEND_MESSAGE
131 
132 #define RETURN_PPM_SET_PROV_STATUS_REQ (*ppMsg)->dwQueue = ID_QUEUE_PPM; (*ppMsg)->wCodeFnct = ID_PPM_SET_PROV_STATUS_REQ; return SEND_MESSAGE
133 
134 
135 #define RETURN_FSPMDEV_IN_DATA_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_IN_DATA_IND; return SEND_MESSAGE
136 #define RETURN_FSPMDEV_NEW_DATA_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_NEW_OUTPUT_IND; return SEND_MESSAGE
137 
138 #define RETURN_FSPMDEV_ABORT_IND (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CMDEV_ABORT_IND; return SEND_MESSAGE
139 
140 #define RETURN_CMDEV_INIT_CNF_POS (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CM_INIT_CNF_POS; return SEND_MESSAGE
141 #define RETURN_CMDEV_INIT_CNF_NEG (*ppMsg)->dwQueue = ID_QUEUE_FSPMDEV; (*ppMsg)->wCodeFnct = ID_CM_INIT_CNF_NEG; return SEND_MESSAGE
142 
143 /***********/
144 #define RETURN_ALPMI_ACTIVATE_REQ (*ppMsg)->dwQueue = ID_QUEUE_ALM; (*ppMsg)->wCodeFnct = ID_ALPMI_ACTIVE_REQ; return SEND_MESSAGE
145 #define RETURN_ALPMR_ACTIVATE_REQ (*ppMsg)->dwQueue = ID_QUEUE_ALM; (*ppMsg)->wCodeFnct = ID_ALPMR_ACTIVE_REQ; return SEND_MESSAGE
146 
147 #define ALPMI_ACTIVATE_REQ OS_SEND_MESSAGE_ALM (ID_ALPMI_ACTIVE_REQ)
148 #define ALPMR_ACTIVATE_REQ OS_SEND_MESSAGE_ALM (ID_ALPMR_ACTIVE_REQ)
149 #define ALPMI_CLOSE_REQ OS_SEND_MESSAGE_ALM (ID_ALPMI_CLOSE_REQ)
150 #define ALPMR_CLOSE_REQ OS_SEND_MESSAGE_ALM (ID_ALPMR_CLOSE_REQ)
151 #endif
152 
Definition: message.h:1163