lib60870_config.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * lib60870_config.h
  3. */
  4. #ifndef CONFIG_LIB60870_CONFIG_H_
  5. #define CONFIG_LIB60870_CONFIG_H_
  6. /* print debugging information with printf if set to 1 */
  7. #define CONFIG_DEBUG_OUTPUT 0
  8. /**
  9. * Define the maximum slave message queue size (for CS 101)
  10. *
  11. * When set to -1 the message queue size is not limited can be set by the application
  12. */
  13. #define CONFIG_SLAVE_MESSAGE_QUEUE_SIZE -1
  14. /**
  15. * Define the default size for the slave (outstation) message queue. This is used also
  16. * to buffer ASDUs in the case when the connection is lost.
  17. *
  18. * For each queued message a maximum of 256 bytes of memory are required. Usually messages are
  19. * smaller so more then thus number of messages can be stored in the message queue
  20. */
  21. #define CONFIG_CS104_MESSAGE_QUEUE_SIZE 100
  22. /**
  23. * This is a connection specific ASDU queue for the slave (outstation). It is used for connection
  24. * specific ASDUs like those that are automatically generated by the stack or created in
  25. * the slave side callback. The messages in the queue are removed when the connection is lost.
  26. *
  27. * For each queued message about 256 bytes of memory are required.
  28. */
  29. #define CONFIG_CS104_MESSAGE_QUEUE_HIGH_PRIO_SIZE 50
  30. /**
  31. * Compile the library to use threads. This will require semaphore support
  32. */
  33. #define CONFIG_USE_THREADS 1
  34. /**
  35. * Compile the library using semaphore to protect critical objects.
  36. * Required when CONFIG_USE_THREADS = 1.
  37. */
  38. #define CONFIG_USE_SEMAPHORES 1
  39. /**
  40. * Compile library with support for SINGLE_REDUNDANCY_GROUP server mode (only CS104 server)
  41. */
  42. #define CONFIG_CS104_SUPPORT_SERVER_MODE_SINGLE_REDUNDANCY_GROUP 1
  43. /**
  44. * Compile library with support for MULTIPLE_REDUNDANCY_GROUPS server mode (only CS104 server)
  45. */
  46. #define CONFIG_CS104_SUPPORT_SERVER_MODE_MULTIPLE_REDUNDANCY_GROUPS 1
  47. /**
  48. * Compile library with support for CONNECTION_IS_REDUNDANCY_GROUP server mode (only CS104 server)
  49. */
  50. #define CONFIG_CS104_SUPPORT_SERVER_MODE_CONNECTION_IS_REDUNDANCY_GROUP 1
  51. /**
  52. * Set the maximum number of client connections
  53. */
  54. #define CONFIG_CS104_MAX_CLIENT_CONNECTIONS 100
  55. /* activate TCP keep alive mechanism. 1 -> activate */
  56. #define CONFIG_ACTIVATE_TCP_KEEPALIVE 0
  57. /* time (in s) between last message and first keepalive message */
  58. #define CONFIG_TCP_KEEPALIVE_IDLE 5
  59. /* time between subsequent keepalive messages if no ack received */
  60. #define CONFIG_TCP_KEEPALIVE_INTERVAL 2
  61. /* number of not missing keepalive responses until socket is considered dead */
  62. #define CONFIG_TCP_KEEPALIVE_CNT 2
  63. /* test command without timestamp is not allowed for CS104. Set to 1 to enable it anyway. */
  64. #define CONFIG_ALLOW_C_TS_NA_1_FOR_CS104 0
  65. #endif /* CONFIG_LIB60870_CONFIG_H_ */