cipclass3connection.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*******************************************************************************
  2. * Copyright (c) 2011, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_CIPCLASS3CONNECTION_H_
  7. #define OPENER_CIPCLASS3CONNECTION_H_
  8. /** @file cipclass3connection.h
  9. * @brief CIP Class 3 connection
  10. * * Explicit Connection Object State Transition Diagram
  11. * ----------------------------------------------
  12. * @dot
  13. * digraph ExplicitConnectionObjectStateTransition {
  14. * A[label="Any State"]
  15. * N[label="Non-existent"]
  16. * D[label="Deferred Delete"]
  17. * E[label="Established"]
  18. *
  19. * A->N [label="Delete"]
  20. * N->E [label="Open Explicit Messaging Connection Response"]
  21. * E->N [label="Delete or inactivity time-out"]
  22. * E->E [label="Get/Set/Apply Attribute, Reset, Message Produced/Consumed"]
  23. * E->D [label="Inactivity time-out and deferred delete set"]
  24. * D->N [label="Delete"]
  25. * }
  26. * @enddot
  27. */
  28. #include "opener_api.h"
  29. #include "cipconnectionmanager.h"
  30. #include "cipconnectionobject.h"
  31. typedef EipStatus (*CipConnectionStateHandler)(CipConnectionObject *RESTRICT
  32. const connection_object,
  33. ConnectionObjectState new_state);
  34. EipStatus CipClass3ConnectionObjectStateEstablishedHandler(
  35. CipConnectionObject *RESTRICT const connection_object,
  36. ConnectionObjectState new_state);
  37. /** @brief Check if Class3 connection is available and if yes setup all data.
  38. *
  39. * This function can be called after all data has been parsed from the forward open request
  40. * @param connection_object pointer to the connection object structure holding the parsed data from the forward open request
  41. * @param extended_error the extended error code in case an error happened
  42. * @return general status on the establishment
  43. * - kEipStatusOk ... on success
  44. * - On an error the general status code to be put into the response
  45. */
  46. CipError EstablishClass3Connection(
  47. CipConnectionObject *RESTRICT const connection_object,
  48. EipUint16 *const extended_error);
  49. /** @brief Initializes the explicit connections mechanism
  50. *
  51. * Prepares the available explicit connection slots for use at the start of the OpENer
  52. */
  53. void InitializeClass3ConnectionData(void);
  54. #endif /* OPENER_CIPCLASS3CONNECTION_H_ */