versadac  1
versadac - Scalable Recorder Firmware
pnlog.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 Controller */
14 /* Component : */
15 /* $Workfile:: pnlog.h $*/
16 /* $Revision:: 5 $*/
17 /* $Date:: 28/02/12 15:56 $*/
18 /* */
19 /*---------------------------------------------------------------------------*/
20 /* */
21 /* D e s c r i p t i o n : */
22 /* Global managment function of the stack */
23 /* */
24 /*---------------------------------------------------------------------------*/
25 
26 #ifndef __PN_LOG_H__
27 #define __PN_LOG_H__
28 
29  #ifdef ACTIVATE_LOG_EVENT
30 
31  #include "os_pck.h"
32 
33  struct _ST_PN_LOGGER_STRUCTURE {
34  APP_DWORD dwTimeStamp1; /*Always 0 for us */
35  APP_DWORD dwTimeStamp2; /*OsGetTime_ms */
36  ST_CLR_RPC_UUID ARUUID; /*Param; or null */
37  ST_PNIO_STATUS PNIOStatus; /*Err1 Err2 .... */
38  APP_DWORD EntryDetail; /*__LINE__ __FILE__ */
39  }STRUCT_ALIGNEMENT;
40  typedef struct _ST_PN_LOGGER_STRUCTURE PACK_ALIGNEMENT(ST_PN_LOGGER_STRUCTURE), APP_FAR * LPST_PN_LOGGER_STRUCTURE;
41 
42  #include "os_unpck.h"
43 
44 
45  extern APP_DWORD gdwLogNumber;
46 
47  extern ST_PN_LOGGER_STRUCTURE gArrayOFLogEvent[];
48  extern APP_WORD gwCurrentLog;
49  extern APP_WORD gwNbLog;
50 
51 
52  APP_VOID addLogEvent(APP_LPBYTE lpbyARUUID,
53  APP_BYTE errCode,
54  APP_BYTE errDecode,
55  APP_BYTE errCode1,
56  APP_BYTE errCode2,
57  APP_DWORD dwDetails);
58 
59 
60 
61  #ifdef ACTIVATE_LOG_L2_EVENT
62 
63  APP_VOID logL2Event(APP_DWORD dwDetails);
64 
65  #define LOG_L2_EVENT(details) logL2Event(details)
66 
67  #define PNIO_DV_LOG_L2_UNKNOW 0x1 /* Event unknow */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
68  #define PNIO_DV_LOG_L2_DCP_REQ_UC 0x2 /* Unicast request */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
69  #define PNIO_DV_LOG_L2_DCP_REQ_MC 0x3 /* Multicast request */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
70  #define PNIO_DV_LOG_L2_DCP_RES_UC 0x4 /* Unicast response */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
71  #define PNIO_DV_LOG_L2_DCP_RES_MC 0x5 /* Multicast response */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
72  #define PNIO_DV_LOG_L2_DCP_ALM 0x6 /* Alarm High */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
73  #define PNIO_DV_LOG_L2_OTHER_PROFINET 0x7 /* unknow profinet */ /* In additioabn with ERR_USER_SPECIFIC_CODE2_L2_EVNT */
74 
75  #else
76 
77  #define LOG_L2_EVENT(details)
78 
79  #endif /* ACTIVATE_LOG_L2_EVENT */
80 
81  #ifdef ACTIVATE_LOG_CBF_EVENT
82 
83  APP_VOID logCbfEvent(APP_DWORD dwDetails);
84 
85  #define LOG_CBF_EVENT(details) logCbfEvent(details)
86 
87  #define PNIO_DV_LOG_CB_SET_NAME 1
88  #define PNIO_DV_LOG_CB_FACTORY_RESET 2
89  #define PNIO_DV_LOG_CB_SET_IP 3
90  #define PNIO_DV_LOG_CB_SET_DHCP 4
91  #define PNIO_DV_LOG_CB_SET_BLINK 5
92  #define PNIO_DV_LOG_CB_START_CNF_POS 6
93  #define PNIO_DV_LOG_CB_START_CNF_NEG 7
94  #define PNIO_DV_LOG_CB_AR_CHECK 8
95  #define PNIO_DV_LOG_CB_PARAM_END 9
96  #define PNIO_DV_LOG_CB_APP_RDY_POS 10
97  #define PNIO_DV_LOG_CB_APP_RDY_NEG 11
98  #define PNIO_DV_LOG_CB_RELEASE 12
99  #define PNIO_DV_LOG_CB_AR_CLOSE 13
100  #define PNIO_DV_LOG_CB_WRITE 14
101  #define PNIO_DV_LOG_CB_READ 15
102  #define PNIO_DV_LOG_CB_ALM_ACK 16
103  #define PNIO_DV_LOG_CB_ALM_IND 17
104  #define PNIO_DV_LOG_CB_PLUG_SM_CNF_POS 18
105  #define PNIO_DV_LOG_CB_PLUG_SM_CNF_NEG 19
106  #define PNIO_DV_LOG_CB_PULL_SM_CNF_POS 20
107  #define PNIO_DV_LOG_CB_PULL_SM_CNF_NEG 21
108  #define PNIO_DV_LOG_CB_AR_OPEN 22
109  #define PNIO_DV_LOG_CB_MODULE_DIFF 23
110 
111  #else
112 
113  #define LOG_CBF_EVENT(details)
114 
115  #endif /* ACTIVATE_LOG_CBF_EVENT */
116 
117  #ifdef ACTIVATE_LOG_CBFIO_EVENT
118 
119 
120  #define LOG_CBFIO_EVENT(details) logCbfEvent(details)
121 
122  #define PNIO_DV_LOG_CB_GET_INPUT_CNF_POS 24
123  #define PNIO_DV_LOG_CB_GET_INPUT_CNF_NEG 25
124  #define PNIO_DV_LOG_CB_SET_OUTPUT_CNF_POS 26
125  #define PNIO_DV_LOG_CB_SET_OUTPUT_CNF_NEG 27
126  #define PNIO_DV_LOG_CB_SET_INPUT_IOCS_CNF_POS 28
127  #define PNIO_DV_LOG_CB_SET_INPUT_IOCS_CNF_NEG 29
128  #define PNIO_DV_LOG_CB_GET_OUTPUT_IOCS_CNF_POS 30
129  #define PNIO_DV_LOG_CB_GET_OUTPUT_IOCS_CNF_NEG 31
130  #define PNIO_DV_LOG_CB_SET_OUTPUT_APDU_CNF_POS 32
131  #define PNIO_DV_LOG_CB_SET_OUTPUT_APDU_CNF_NEG 33
132  #define PNIO_DV_LOG_CB_GET_INPUT_APDU_CNF_POS 34
133  #define PNIO_DV_LOG_CB_GET_INPUT_APDU_CNF_NEG 35
134 
135 
136  #else
137 
138  #define LOG_CBFIO_EVENT(details)
139 
140  #endif
141 
142 
143  #endif /* ACTIVATE_LOG_EVENT */
144 
145  #ifndef ACTIVATE_LOG_EVENT
146 
147  #define LOG_L2_EVENT(details)
148  #define LOG_CBF_EVENT(details)
149  #define LOG_CBFIO_EVENT(details)
150  #endif
151 
152 #endif