cipassembly.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*******************************************************************************
  2. * Copyright (c) 2009, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_CIPASSEMBLY_H_
  7. #define OPENER_CIPASSEMBLY_H_
  8. #include "typedefs.h"
  9. #include "ciptypes.h"
  10. /** @brief Assembly class code */
  11. static const CipUint kCipAssemblyClassCode = 0x04U;
  12. /** @brief Assembly object instance attribute IDs.
  13. *
  14. * Reference:
  15. * \cite CipVol1, Table 5-5.4
  16. */
  17. typedef enum {
  18. kAssemblyObjectInstanceAttributeIdData = 3
  19. } AssemblyObjectInstanceAttributeId;
  20. /* public functions */
  21. /** @brief Setup the Assembly object
  22. *
  23. * Creates the Assembly Class with zero instances and sets up all services.
  24. *
  25. * @return Returns kEipStatusOk if assembly object was successfully created, otherwise kEipStatusError
  26. */
  27. EipStatus CipAssemblyInitialize(void);
  28. /** @brief clean up the data allocated in the assembly object instances
  29. *
  30. * Assembly object instances allocate per instance data to store attribute 3.
  31. * This will be freed here. The assembly object data given by the application
  32. * is not freed neither the assembly object instances. These are handled in the
  33. * main shutdown function.
  34. */
  35. void ShutdownAssemblies(void);
  36. /** @brief notify an Assembly object that data has been received for it.
  37. *
  38. * The data will be copied into the assembly objects attribute 3 and
  39. * the application will be informed with the AfterAssemblyDataReceived function.
  40. *
  41. * @param instance the assembly object instance for which the data was received
  42. * @param data pointer to the data received
  43. * @param data_length number of bytes received
  44. * @return
  45. * - kEipStatusOk the received data was okay
  46. * - kEipStatusError the received data was wrong
  47. */
  48. EipStatus NotifyAssemblyConnectedDataReceived(CipInstance *const instance,
  49. const EipUint8 *const data,
  50. const size_t data_length);
  51. #endif /* OPENER_CIPASSEMBLY_H_ */