cipioconnection.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*******************************************************************************
  2. * Copyright (c) 2011, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. /**
  7. * @file cipioconnection.h
  8. * CIP I/O Connection implementation
  9. * =================================
  10. *
  11. *
  12. * I/O Connection Object State Transition Diagram
  13. * ----------------------------------------------
  14. * @dot
  15. * digraph IOConnectionObjectStateTransition {
  16. * A[label="Any State"]
  17. * N[label="Non-existent"]
  18. * C[label="Configuring"]
  19. * E[label="Established"]
  20. * W[label="Waiting for Connection ID"]
  21. * T[label="Timed Out"]
  22. *
  23. * A->N [label="Delete"]
  24. * N->C [label="Create"]
  25. * C->C [label="Get/Set/Apply Attribute"]
  26. * C->W [label="Apply Attribute"]
  27. * W->W [label="Get/Set Attribute"]
  28. * C->E [label="Apply Attribute"]
  29. * E->E [label="Get/Set/Apply Attribute, Reset, Message Produced/Consumed"]
  30. * W->E [label="Apply Attribute"]
  31. * E->T [label="Inactivity/Watchdog"]
  32. * T->E [label="Reset"]
  33. * T->N [label="Delete"]
  34. * }
  35. * @enddot
  36. *
  37. */
  38. #ifndef OPENER_CIPIOCONNECTION_H_
  39. #define OPENER_CIPIOCONNECTION_H_
  40. #include "opener_api.h"
  41. #include "cipconnectionmanager.h"
  42. #include "cipconnectionobject.h"
  43. /** @brief Setup all data in order to establish an IO connection
  44. *
  45. * This function can be called after all data has been parsed from the forward open request
  46. * @param connection_object pointer to the connection object structure holding the parsed data from the forward open request
  47. * @param extended_error the extended error code in case an error happened
  48. * @return general status on the establishment
  49. * - EIP_OK ... on success
  50. * - On an error the general status code to be put into the response
  51. */
  52. CipError EstablishIoConnection(
  53. CipConnectionObject *RESTRICT const connection_object,
  54. EipUint16 *const extended_error);
  55. /** @brief Take the data given in the connection object structure and open the necessary communication channels
  56. *
  57. * This function will use the g_stCPFDataItem!
  58. * @param connection_object pointer to the connection object data
  59. * @return general status on the open process
  60. * - EIP_OK ... on success
  61. * - On an error the general status code to be put into the response
  62. */
  63. CipError OpenCommunicationChannels(CipConnectionObject *connection_object);
  64. /** @brief close the communication channels of the given connection and remove it
  65. * from the active connections list.
  66. *
  67. * @param connection_object pointer to the connection object data
  68. */
  69. void CloseCommunicationChannelsAndRemoveFromActiveConnectionsList(
  70. CipConnectionObject *connection_object);
  71. extern EipUint8 *g_config_data_buffer;
  72. extern unsigned int g_config_data_length;
  73. #endif /* OPENER_CIPIOCONNECTION_H_ */