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 
25  #include "typedefs.h"
26 
27 typedef unsigned short in_port_t;
28 
30 #include "devicedata.h"
31 
38 #define OPENER_CIP_NUM_APPLICATION_SPECIFIC_CONNECTABLE_OBJECTS 1
39 
43 #define OPENER_CIP_NUM_EXPLICIT_CONNS 6
44 
50 #define OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS 1
51 
57 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS 1
58 
61 #define OPENER_CIP_NUM_INPUT_ONLY_CONNS_PER_CON_PATH 3
62 
68 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS 1
69 
72 #define OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH 3
73 
79 #define OPENER_MESSAGE_DATA_REPLY_BUFFER 100
80 
83 #define OPENER_NUMBER_OF_SUPPORTED_SESSIONS 20
84 
87 static const int kOpenerTimerTickInMilliSeconds = 10;
88 
91 static const int kOpenerConsumedDataHasRunIdleHeader = 1;
92 
97 static const int kOpenerProducedDataHasRunIdleHeader = 0;
98 
99 #ifdef OPENER_WITH_TRACES
100 /* If we have tracing enabled provide print tracing macro */
101 #include <stdio.h>
102 
103 #define LOG_TRACE(...) fprintf(stderr,__VA_ARGS__)
104 
105 /*#define PRINT_TRACE(args...) fprintf(stderr,args);*/
106 
110 #define OPENER_ASSERT(assertion) \
111  do { \
112  if( !(assertion) ) { \
113  LOG_TRACE("Assertion \"%s\" failed: file \"%s\", line %d\n", \
114  # assertion, \
115  __FILE__, \
116  __LINE__); \
117  while(1) {;} \
118  } \
119  } while(0);
120 
121 /* else use standard assert() */
122 //#include <assert.h>
123 //#include <stdio.h>
124 //#define OPENER_ASSERT(assertion) assert(assertion)
125 #else
126 
127 /* for release builds execute the assertion, but don't test it */
128 //#define OPENER_ASSERT(assertion) (assertion)
129 
130 /* the above may result in "statement with no effect" warnings.
131  * If you do not use assert()s to run functions, the an empty
132  * macro can be used as below
133  */
134 #define OPENER_ASSERT(assertion)
135 /* else if you still want assertions to stop execution but without tracing, use the following */
136 //#define OPENER_ASSERT(assertion) do { if(!(assertion)) { while(1){;} } } while (0)
137 /* else use standard assert() */
138 //#include <assert.h>
139 //#include <stdio.h>
140 //#define OPENER_ASSERT(assertion) assert(assertion)
141 
142 #endif
143 
151 #define PC_OPENER_ETHERNET_BUFFER_SIZE 512
152 
153 #endif /*OPENER_USER_CONF_H_*/
unsigned short in_port_t