OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
opener_user_conf.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 #ifndef OPENER_USER_CONF_H_
7 #define OPENER_USER_CONF_H_
8 
24 #include <netinet/in.h>
25 #include <sys/socket.h>
26 #include <arpa/inet.h>
27 #include <sys/select.h>
28 #include <assert.h>
29 
30 #include "typedefs.h"
31 
33 #include "devicedata.h"
34 
41 #define OPENER_CIP_NUM_APPLICATION_SPECIFIC_CONNECTABLE_OBJECTS 1
42 
46 #define OPENER_CIP_NUM_EXPLICIT_CONNS 6
47 
53 #define OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS 1
54 
60 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS 1
61 
64 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS_PER_CON_PATH 3
65 
71 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS 1
72 
75 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH 3
76 
82 #define OPENER_MESSAGE_DATA_REPLY_BUFFER 100
83 
86 #define OPENER_NUMBER_OF_SUPPORTED_SESSIONS 20
87 
90 static const MilliSeconds kOpenerTimerTickInMilliSeconds = 10;
91 
92 #ifdef OPENER_WITH_TRACES
93 /* If we have tracing enabled provide print tracing macro */
94 #include <stdio.h>
95 
96 #define LOG_TRACE(...) fprintf(stderr,__VA_ARGS__)
97 
98 /*#define PRINT_TRACE(args...) fprintf(stderr,args);*/
99 
103 #ifdef IDLING_ASSERT
104 #define OPENER_ASSERT(assertion) \
105  do { \
106  if( !(assertion) ) { \
107  LOG_TRACE("Assertion \"%s\" failed: file \"%s\", line %d\n", \
108  # assertion, \
109  __FILE__, \
110  __LINE__); \
111  while(1) { } \
112  } \
113  } while(0);
114 
115 /* else use standard assert() */
116 //#include <assert.h>
117 //#include <stdio.h>
118 //#define OPENER_ASSERT(assertion) assert(assertion)
119 #else
120 #define OPENER_ASSERT(assertion) assert(assertion);
121 #endif
122 #else
123 
124 /* for release builds remove assertion */
125 #define OPENER_ASSERT(assertion)
126 
127 /* if there are any strange timing issues, you can try the version below, where the assertion is performed but the assert
128  * function is not used
129  */
130 //#define OPENER_ASSERT(assertion) (assertion)
131 /* else if you still want assertions to stop execution but without tracing, use the following */
132 //#define OPENER_ASSERT(assertion) do { if(!(assertion)) { while(1){;} } } while (0)
133 /* else use standard assert() */
134 //#include <assert.h>
135 //#include <stdio.h>
136 //#define OPENER_ASSERT(assertion) assert(assertion)
137 
138 #endif
139 
147 #define PC_OPENER_ETHERNET_BUFFER_SIZE 512
148 
149 #endif /*OPENER_USER_CONF_H_*/
unsigned long MilliSeconds
Definition: typedefs.h:68