opener_api.h 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  1. /*******************************************************************************
  2. * Copyright (c) 2009, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_OPENER_API_H_
  7. #define OPENER_OPENER_API_H_
  8. #include <assert.h>
  9. #include <stdbool.h>
  10. #include "typedefs.h"
  11. #include "ciptypes.h"
  12. #include "ciperror.h"
  13. #if defined(HPMICRO) /** HPMICRO target -> uses a struct for the network interface */
  14. #define TcpIpInterface struct netif
  15. #else /** other targets -> string for the network interface */
  16. #define TcpIpInterface const char
  17. #endif /** other targets */
  18. /** @defgroup CIP_API OpENer User interface
  19. * @brief This is the public interface of the OpENer. It provides all function
  20. * needed to implement an EtherNet/IP enabled slave-device.
  21. */
  22. /** @ingroup CIP_API
  23. * @brief Read network configuration data from specified hardware interface
  24. *
  25. * @param iface address specifying the network interface
  26. * @param iface_cfg address of interface configuration structure
  27. * @return kEipStatusOk on success,
  28. * kEipStatusError on error with @p errno set
  29. *
  30. * This function reads all information needed to fill the iface_cfg structure
  31. * of type @ref CipTcpIpInterfaceConfiguration from the hardware interface
  32. * specified by the iface string.
  33. *
  34. */
  35. EipStatus IfaceGetConfiguration(TcpIpInterface *iface,
  36. CipTcpIpInterfaceConfiguration *iface_cfg);
  37. /** @ingroup CIP_API
  38. * @brief Read and return the MAC address of the Ethernet interface
  39. *
  40. * @param iface address specifying the network interface
  41. * @param physical_address hardware MAC address of the network interface
  42. * @return kEipStatusOk: all fine
  43. * kEipStatusError: failure, errno set
  44. */
  45. EipStatus IfaceGetMacAddress(TcpIpInterface *iface,
  46. uint8_t *const physical_address);
  47. /** @ingroup CIP_API
  48. * @brief Wait for the network interface having an IP address
  49. *
  50. * @param iface address specifying the network interface
  51. * @param timeout in seconds; max: INT_MAX/10, -1: wait for ever
  52. * @param abort_wait stop waiting if this parameter becomes zero
  53. * @return kEipStatusOk on success,
  54. * kEipStatusError on error with @p errno set
  55. *
  56. * This function waits for the network interface getting an IP address but
  57. * only @p timeout seconds (set to -1 to wait for ever).
  58. * The polling wait process can be aborted by setting @p abort_wait to
  59. * a non zero value from another thread.
  60. */
  61. EipStatus IfaceWaitForIp(TcpIpInterface *const iface,
  62. int timeout,
  63. volatile int *const abort_wait);
  64. #if defined(HPMICRO) /** HPMICRO target, the hostname is linked to the network interface */
  65. /** @ingroup CIP_API
  66. * @brief Get host name from platform
  67. *
  68. * @param iface address specifying the network interface
  69. * @param hostname address of CipString destination structure
  70. *
  71. * This function reads the host name from the platform and returns it
  72. * via the hostname parameter.
  73. */
  74. void GetHostName(TcpIpInterface *iface,
  75. CipString *hostname);
  76. #else /** other targets */
  77. /** @ingroup CIP_API
  78. * @brief Get host name from platform
  79. *
  80. * @param hostname address of CipString destination structure
  81. *
  82. * This function reads the host name from the platform and returns it
  83. * via the hostname parameter.
  84. */
  85. void GetHostName(CipString *hostname);
  86. #endif /** other targets */
  87. /** @ingroup CIP_API
  88. * @brief Set the CIP revision of the device's identity object.
  89. *
  90. * @param major unsigned 8 bit major revision
  91. * @param minor unsigned 8 bit minor revision
  92. */
  93. void SetDeviceRevision(EipUint8 major,
  94. EipUint8 minor);
  95. /** @ingroup CIP_API
  96. * @brief Set the serial number of the device's identity object.
  97. *
  98. * @param serial_number unique 32 bit number identifying the device
  99. */
  100. void SetDeviceSerialNumber(const EipUint32 serial_number);
  101. /** @ingroup CIP_API
  102. * @brief Set the DeviceType of the device's identity object.
  103. *
  104. * @param type 16 bit unsigned number representing the CIP device type
  105. */
  106. void SetDeviceType(const EipUint16 type);
  107. /** @ingroup CIP_API
  108. * @brief Set the ProductCode of the device's identity object.
  109. *
  110. * @param type 16 bit unsigned number representing the product code
  111. */
  112. void SetDeviceProductCode(const EipUint16 code);
  113. /** @ingroup CIP_API
  114. * @brief Set the device's Status word also updating the Extended Device Status
  115. *
  116. * @param status complete Identity Object's Status word content
  117. *
  118. * This function sets the status flags and the internal state of the Extended
  119. * Device Status field in Identity object's ext_status member.
  120. */
  121. void SetDeviceStatus(const CipWord status);
  122. /** @ingroup CIP_API
  123. * @breif Set device's CIP VendorId
  124. *
  125. * @param vendor_id vendor ID, can be zero
  126. *
  127. * When OpENer is used as a library, multiple CIP adapters may use it
  128. * and may want to set the VendorId. Note: some applications allow
  129. * the use of VendorId 0.
  130. */
  131. void SetDeviceVendorId(CipUint vendor_id);
  132. /** @ingroup CIP_API
  133. * @brief Get device's CIP VendorId
  134. *
  135. * @returns the currently used VendorId
  136. */
  137. CipUint GetDeviceVendorId(void);
  138. /** @ingroup CIP_API
  139. * @breif Set device's CIP ProductName
  140. *
  141. * @param product_name C-string to use as ProducName
  142. *
  143. * When OpENer is used as a library, multiple CIP adapters may use it
  144. * and will need to change the product name.
  145. */
  146. void SetDeviceProductName(const char *product_name);
  147. /** @ingroup CIP_API
  148. * @brief Get device's current CIP ProductName
  149. *
  150. * Hint, use GetCstrFromCipShortString() to get a printable/logable C
  151. * string, since CipShortString's aren't NUL terminated.
  152. *
  153. * @returns the CipShortString for the product name
  154. */
  155. CipShortString *GetDeviceProductName(void);
  156. /** @ingroup CIP_API
  157. * @brief Initialize and setup the CIP-stack
  158. *
  159. * @param unique_connection_id value passed to Connection_Manager_Init() to form
  160. * a "per boot" unique connection ID.
  161. */
  162. EipStatus CipStackInit(const EipUint16 unique_connection_id);
  163. /** @ingroup CIP_API
  164. * @brief Shutdown of the CIP stack
  165. *
  166. * This will
  167. * - close all open I/O connections,
  168. * - close all open explicit connections, and
  169. * - free all memory allocated by the stack.
  170. *
  171. * Memory allocated by the application will not be freed. This has to be done
  172. * by the application!
  173. */
  174. void ShutdownCipStack(void);
  175. /** @ingroup CIP_API
  176. * @brief Enable the Run/Idle header for consumed (O->T) cyclic data
  177. * @param onoff if set (default), OpENer expects 4 byte Run/Idle header from scanner
  178. */
  179. void CipRunIdleHeaderSetO2T(bool onoff);
  180. /** @ingroup CIP_API
  181. * @brief Get current setting of the O->T Run/Idle header
  182. * @return current setting of the O->T Run/Idle header
  183. */
  184. bool CipRunIdleHeaderGetO2T(void);
  185. /** @ingroup CIP_API
  186. * @brief Enable the Run/Idle header for produced (T->O) cyclic data
  187. * @param onoff if set (not default), OpENer includes a 4 byte Run/Idle header in responses to scanner
  188. */
  189. void CipRunIdleHeaderSetT2O(bool onoff);
  190. /** @ingroup CIP_API
  191. * @brief Get current setting of the T->O Run/Idle header
  192. * @return current setting of the T->O Run/Idle header
  193. */
  194. bool CipRunIdleHeaderGetT2O(void);
  195. /** @ingroup CIP_API
  196. * @brief Get a pointer to a CIP object with given class code
  197. *
  198. * @param class_code class code of the object to retrieve
  199. * @return pointer to CIP Object
  200. * 0 if object is not present in the stack
  201. */
  202. CipClass *GetCipClass(const CipUdint class_code);
  203. /** @ingroup CIP_API
  204. * @brief Get a pointer to an instance
  205. *
  206. * @param cip_object pointer to the object the instance belongs to
  207. * @param instance_number number of the instance to retrieve
  208. * @return pointer to CIP Instance
  209. * 0 if instance is not in the object
  210. */
  211. CipInstance *GetCipInstance(const CipClass *RESTRICT const cip_object,
  212. const CipInstanceNum instance_number);
  213. /** @ingroup CIP_API
  214. * @brief Get a pointer to an instance's attribute
  215. *
  216. * As instances and objects are selfsimilar this function can also be used
  217. * to retrieve the attribute of an object.
  218. * @param cip_instance pointer to the instance the attribute belongs to
  219. * @param attribute_number number of the attribute to retrieve
  220. * @return pointer to attribute
  221. * 0 if instance is not in the object
  222. */
  223. CipAttributeStruct *GetCipAttribute(const CipInstance *const cip_instance,
  224. const EipUint16 attribute_number);
  225. typedef void (*InitializeCipClass)(CipClass *); /**< Initializer function for CIP class initialization */
  226. /** @ingroup CIP_API
  227. * @brief Allocate memory for new CIP Class and attributes
  228. *
  229. * The new CIP class will be registered at the stack to be able
  230. * for receiving explicit messages.
  231. *
  232. * @param class_code class code of the new class
  233. * @param number_of_class_attributes number of class attributes
  234. * @param highest_class_attribute_number Highest attribute number from the set of implemented class attributes
  235. * @param number_of_class_services number of class services
  236. * @param number_of_instance_attributes Number of implemented instance attributes
  237. * @param highest_instance_attribute_number Highest attribute number from the set of implemented instance attributes
  238. * @param number_of_instance_services number of instance services
  239. * @param number_of_instances number of initial instances to create
  240. * @param name class name (for debugging class structure)
  241. * @param revision class revision
  242. * @param initializer For non-standard implementation of
  243. * class attributes, function realizes specific implementation
  244. * @return pointer to new class object
  245. * 0 on error
  246. */
  247. CipClass *CreateCipClass(const CipUdint class_code,
  248. const int number_of_class_attributes,
  249. const EipUint32 highest_class_attribute_number,
  250. const int number_of_class_services,
  251. const int number_of_instance_attributes,
  252. const EipUint32 highest_instance_attribute_number,
  253. const int number_of_instance_services,
  254. const CipInstanceNum number_of_instances,
  255. const char *const name,
  256. const EipUint16 revision,
  257. InitializeCipClass initializer);
  258. /** @ingroup CIP_API
  259. * @brief Add a number of CIP instances to a given CIP class
  260. *
  261. * The required number of instances are attached to the class as a linked list.
  262. *
  263. * The instances are numbered sequentially -- i.e. the first node in the chain
  264. * is instance 1, the second is 2, and so on.
  265. * You can add new instances at any time (you do not have to create all the
  266. * instances of a class at the same time) deleting instances once they have
  267. * been created is not supported out-of-order instance numbers are not
  268. * supported running out of memory while creating new instances causes an
  269. * assert.
  270. *
  271. * @param cip_object_to_add_instances CIP object the instances should be added
  272. * @param number_of_instances number of instances to be generated.
  273. * @return pointer to the first of the new instances
  274. * 0 on error
  275. */
  276. CipInstance *AddCipInstances(
  277. CipClass *RESTRICT const cip_object_to_add_instances,
  278. const CipInstanceNum number_of_instances);
  279. /** @ingroup CIP_API
  280. * @brief Create one instance of a given class with a certain instance number
  281. *
  282. * This function can be used for creating out of order instance numbers
  283. * @param cip_class_to_add_instance the class the instance should be created for
  284. * @param instance_id the instance id of the created instance
  285. * @return pointer to the created instance, if an instance with the given id
  286. * already exists the existing is returned an no new instance is created
  287. *
  288. */
  289. CipInstance *AddCipInstance(CipClass *RESTRICT const cip_class_to_add_instance,
  290. const CipInstanceNum instance_id);
  291. /** @ingroup CIP_API
  292. * @brief Insert an attribute in an instance of a CIP class
  293. *
  294. * Note that attributes are stored in an array pointer in the instance
  295. * the attributes array is not expandable if you insert an attributes that has
  296. * already been defined, the previous attributes will be replaced
  297. *
  298. * @param cip_instance Pointer to CIP class instance (Instance 0)
  299. * @param attribute_number Number of attribute to be inserted.
  300. * @param cip_data_type Type of attribute to be inserted.
  301. * @param encode_function Function pointer to the encoding function
  302. * @param decode_function Function pointer to the decoding function
  303. * @param cip_data Pointer to data of attribute.
  304. * @param cip_flags Flags to indicate set-ability and get-ability of attribute.
  305. */
  306. void InsertAttribute(CipInstance *const instance,
  307. const EipUint16 attribute_number,
  308. const EipUint8 cip_type,
  309. CipAttributeEncodeInMessage encode_function,
  310. CipAttributeDecodeFromMessage decode_function,
  311. void *const data,
  312. const EipByte cip_flags);
  313. /** @ingroup CIP_API
  314. * @brief Allocates Attribute bitmasks
  315. *
  316. * @param target_class Class, in which the bitmasks will be inserted.
  317. *
  318. */
  319. void AllocateAttributeMasks(CipClass *target_class);
  320. /** @ingroup CIP_API
  321. * @brief Calculates Byte-Index of Attribute
  322. *
  323. * @param attribute_number Attribute number.
  324. *
  325. */
  326. size_t CalculateIndex(EipUint16 attribute_number);
  327. /** @ingroup CIP_API
  328. * @brief Insert a service in an instance of a CIP object
  329. *
  330. * Note that services are stored in an array pointer in the class object
  331. * the service array is not expandable if you insert a service that has
  332. * already been defined, the previous service will be replaced
  333. *
  334. * @param cip_class pointer to CIP object. (may be also
  335. * instance# 0)
  336. * @param service_code service code of service to be inserted.
  337. * @param service_function pointer to function which represents the service.
  338. * @param service_name name of the service
  339. */
  340. void InsertService(const CipClass *const cip_class,
  341. const EipUint8 service_code,
  342. const CipServiceFunction service_function,
  343. char *const service_name);
  344. /** @ingroup CIP_API
  345. * @brief Insert a Get or Set callback for a CIP class
  346. *
  347. * @param cip_class pointer to the target CIP object
  348. * @param callback_function the callback function to insert
  349. * @param callbacks_to_install flags to select the affected callbacks
  350. *
  351. * This function inserts the provided @p callback_function into selected
  352. * callback function entries of the CIP class @p cip_class.
  353. * The callback targets are selected by @p callbacks_to_install that may
  354. * be an ORed mask of kPreGetFunc, kPostGetFunc, kPreSetFunc, kPostSetFunc
  355. * and kNvDataFunc.
  356. * If either the kPostSetFunc or kNvDataFunc is set the same function
  357. * pointer CipClass::PostSetCallback will be called.
  358. */
  359. void InsertGetSetCallback(CipClass *const cip_class,
  360. CipGetSetCallback callback_function,
  361. CIPAttributeFlag callbacks_to_install);
  362. //TODO: Update documentation
  363. /** @ingroup CIP_API
  364. * @brief Produce the data according to CIP encoding onto the message buffer.
  365. *
  366. * This function may be used in own services for sending data back to the
  367. * requester (e.g., getAttributeSingle for special structs).
  368. * @param cip_data_type the cip type to encode
  369. * @param cip_data pointer to data value.
  370. * @param message_router_response The message router response construct
  371. */
  372. void EncodeCipBool(const void *const data,
  373. ENIPMessage *const outgoing_message);
  374. void EncodeCipByte(const void *const data,
  375. ENIPMessage *const outgoing_message);
  376. void EncodeCipWord(const void *const data,
  377. ENIPMessage *const outgoing_message);
  378. void EncodeCipDword(const void *const data,
  379. ENIPMessage *const outgoing_message);
  380. void EncodeCipLword(const void *const data,
  381. ENIPMessage *const outgoing_message);
  382. void EncodeCipUsint(const void *const data,
  383. ENIPMessage *const outgoing_message);
  384. void EncodeCipUint(const void *const data,
  385. ENIPMessage *const outgoing_message);
  386. void EncodeCipUdint(const void *const data,
  387. ENIPMessage *const outgoing_message);
  388. void EncodeCipUlint(const void *const data,
  389. ENIPMessage *const outgoing_message);
  390. void EncodeCipSint(const void *const data,
  391. ENIPMessage *const outgoing_message);
  392. void EncodeCipInt(const void *const data,
  393. ENIPMessage *const outgoing_message);
  394. void EncodeCipDint(const void *const data,
  395. ENIPMessage *const outgoing_message);
  396. void EncodeCipLint(const void *const data,
  397. ENIPMessage *const outgoing_message);
  398. void EncodeCipReal(const void *const data,
  399. ENIPMessage *const outgoing_message);
  400. void EncodeCipLreal(const void *const data,
  401. ENIPMessage *const outgoing_message);
  402. void EncodeCipShortString(const void *const data,
  403. ENIPMessage *const outgoing_message);
  404. void EncodeCipString(const void *const data,
  405. ENIPMessage *const outgoing_message);
  406. void EncodeCipString2(const void *const data,
  407. ENIPMessage *const outgoing_message);
  408. void EncodeCipStringN(const void *const data,
  409. ENIPMessage *const outgoing_message);
  410. void EncodeCipStringI(const void *const data,
  411. ENIPMessage *const outgoing_message);
  412. void EncodeCipByteArray(const void *const data,
  413. ENIPMessage *const outgoing_message);
  414. void EncodeCipEPath(const void *const data,
  415. ENIPMessage *const outgoing_message); //path_size UINT
  416. void EncodeEPath(const void *const data,
  417. ENIPMessage *const outgoing_message); //path_size not encoded
  418. void EncodeCipEthernetLinkPhyisicalAddress(const void *const data,
  419. ENIPMessage *const outgoing_message);
  420. /** @ingroup CIP_API
  421. * @brief Retrieve the given data according to CIP encoding from the message
  422. * buffer.
  423. *
  424. * This function may be used in own services for handling data from the
  425. * requester (e.g., setAttributeSingle).
  426. * @param data pointer to value to be written.
  427. * @param message_router_request pointer to the request where the data should be taken from
  428. * @param message_router_response pointer to the response where status should be set
  429. * @return length of taken bytes
  430. * -1 .. error
  431. */
  432. int DecodeCipBool(CipBool *const data,
  433. CipMessageRouterRequest *const message_router_request,
  434. CipMessageRouterResponse *const message_router_response);
  435. int DecodeCipByte(CipByte *const data,
  436. CipMessageRouterRequest *const message_router_request,
  437. CipMessageRouterResponse *const message_router_response);
  438. int DecodeCipByteArray(CipByteArray *const data,
  439. const CipMessageRouterRequest *const message_router_request,
  440. CipMessageRouterResponse *const message_router_response);
  441. int DecodeCipWord(CipWord *const data,
  442. CipMessageRouterRequest *const message_router_request,
  443. CipMessageRouterResponse *const message_router_response);
  444. int DecodeCipDword(CipDword *const data,
  445. CipMessageRouterRequest *const message_router_request,
  446. CipMessageRouterResponse *const message_router_response);
  447. int DecodeCipLword(CipLword *const data,
  448. CipMessageRouterRequest *const message_router_request,
  449. CipMessageRouterResponse *const message_router_response);
  450. int DecodeCipUsint(CipUsint *const data,
  451. CipMessageRouterRequest *const message_router_request,
  452. CipMessageRouterResponse *const message_router_response);
  453. int DecodeCipUint(CipUint *const data,
  454. CipMessageRouterRequest *const message_router_request,
  455. CipMessageRouterResponse *const message_router_response);
  456. int DecodeCipUdint(CipUdint *const data,
  457. CipMessageRouterRequest *const message_router_request,
  458. CipMessageRouterResponse *const message_router_response);
  459. int DecodeCipUlint(CipUlint *const data,
  460. CipMessageRouterRequest *const message_router_request,
  461. CipMessageRouterResponse *const message_router_response);
  462. int DecodeCipSint(CipSint *const data,
  463. CipMessageRouterRequest *const message_router_request,
  464. CipMessageRouterResponse *const message_router_response);
  465. int DecodeCipInt(CipInt *const data,
  466. CipMessageRouterRequest *const message_router_request,
  467. CipMessageRouterResponse *const message_router_response);
  468. int DecodeCipDint(CipDint *const data,
  469. CipMessageRouterRequest *const message_router_request,
  470. CipMessageRouterResponse *const message_router_response);
  471. int DecodeCipLint(CipLint *const data,
  472. CipMessageRouterRequest *const message_router_request,
  473. CipMessageRouterResponse *const message_router_response);
  474. int DecodeCipReal(CipReal *const data,
  475. CipMessageRouterRequest *const message_router_request,
  476. CipMessageRouterResponse *const message_router_response);
  477. int DecodeCipLreal(CipLreal *const data,
  478. CipMessageRouterRequest *const message_router_request,
  479. CipMessageRouterResponse *const message_router_response);
  480. int DecodeCipString(CipString *const data,
  481. CipMessageRouterRequest *const message_router_request,
  482. CipMessageRouterResponse *const message_router_response);
  483. int DecodeCipShortString(CipShortString *const data,
  484. CipMessageRouterRequest *const message_router_request,
  485. CipMessageRouterResponse *const message_router_response);
  486. /** @ingroup CIP_API
  487. * @brief Create an instance of an assembly object
  488. *
  489. * @param instance_number instance number of the assembly object to create
  490. * @param data pointer to the data the assembly object should contain
  491. * @param data_length length of the assembly object's data
  492. * @return pointer to the instance of the created assembly object. NULL on error
  493. *
  494. * Assembly Objects for Configuration Data:
  495. *
  496. * The CIP stack treats configuration assembly objects the same way as any other
  497. * assembly object.
  498. * In order to support a configuration assembly object it has to be created with
  499. * this function.
  500. * The notification on received configuration data is handled with the
  501. * AfterAssemblyDataReceived.
  502. */
  503. CipInstance *CreateAssemblyObject(const CipInstanceNum instance_number,
  504. EipByte *const data,
  505. const EipUint16 data_length);
  506. typedef struct cip_connection_object CipConnectionObject;
  507. /** @ingroup CIP_API
  508. * @brief Function prototype for handling the opening of connections
  509. *
  510. * @param connection_object The connection object which is opening the
  511. * connection
  512. * @param extended_error_code The returned error code of the connection object
  513. *
  514. * @return CIP error code
  515. */
  516. typedef CipError (*OpenConnectionFunction)(
  517. CipConnectionObject *RESTRICT const connection_object,
  518. EipUint16 *const extended_error_code);
  519. /** @ingroup CIP_API
  520. * @brief Function prototype for handling the closing of connections
  521. *
  522. * @param connection_object The connection object which is closing the
  523. * connection
  524. */
  525. typedef void (*ConnectionCloseFunction)(CipConnectionObject *RESTRICT
  526. connection_object);
  527. /** @ingroup CIP_API
  528. * @brief Function prototype for handling the timeout of connections
  529. *
  530. * @param connection_object The connection object which connection timed out
  531. */
  532. typedef void (*ConnectionTimeoutFunction)(
  533. CipConnectionObject *connection_object);
  534. /** @ingroup CIP_API
  535. * @brief Function prototype for sending data via a connection
  536. *
  537. * @param connection_object The connection object which connection timed out
  538. *
  539. * @return EIP stack status
  540. */
  541. typedef EipStatus (*ConnectionSendDataFunction)(CipConnectionObject *
  542. connection_object);
  543. /** @ingroup CIP_API
  544. * @brief Function prototype for receiving data via a connection
  545. *
  546. * @param connection_object The connection object which connection timed out
  547. * @param data The payload of the CIP message
  548. * @param data_length Length of the payload
  549. *
  550. * @return Stack status
  551. */
  552. typedef EipStatus (*ConnectionReceiveDataFunction)(CipConnectionObject *
  553. connection_object,
  554. const EipUint8 *data,
  555. const EipUint16 data_length);
  556. /** @ingroup CIP_API
  557. * @brief Function pointer for timeout checker functions
  558. *
  559. * @param elapsed_time elapsed time since last check
  560. */
  561. typedef void (*TimeoutCheckerFunction)(const MilliSeconds elapsed_time);
  562. /** @ingroup CIP_API
  563. * @brief register open functions for an specific object.
  564. *
  565. * With this function any object can be enabled to be a target for forward
  566. * open/close request.
  567. * @param class_code The class code
  568. * @param open_connection_function Pointer to the function handling the open
  569. * process
  570. * @return EIP_OK on success
  571. */
  572. EipStatus
  573. AddConnectableObject(const CipUdint class_code,
  574. OpenConnectionFunction open_connection_function);
  575. /** @ingroup CIP_API
  576. * @brief Configures the connection point for an exclusive owner connection.
  577. *
  578. * @param connection_number The number of the exclusive owner connection. The
  579. * enumeration starts with 0. Has to be smaller than
  580. * OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS.
  581. * @param output_assembly_id ID of the O-to-T point to be used for this
  582. * connection
  583. * @param input_assembly_id ID of the T-to-O point to be used for this
  584. * connection
  585. * @param configuration_assembly_id ID of the configuration point to be used for
  586. * this connection
  587. */
  588. void ConfigureExclusiveOwnerConnectionPoint(
  589. const unsigned int connection_number,
  590. const unsigned int output_assembly_id,
  591. const unsigned int input_assembly_id,
  592. const unsigned int configuration_assembly_id);
  593. /** @ingroup CIP_API
  594. * @brief Configures the connection point for an input only connection.
  595. *
  596. * @param connection_number The number of the input only connection. The
  597. * enumeration starts with 0. Has to be smaller than
  598. * OPENER_CIP_NUM_INPUT_ONLY_CONNS.
  599. * @param output_assembly_id ID of the O-to-T point to be used for this
  600. * connection
  601. * @param input_assembly_id ID of the T-to-O point to be used for this
  602. * connection
  603. * @param configuration_assembly_id ID of the configuration point to be used for
  604. * this connection
  605. */
  606. void ConfigureInputOnlyConnectionPoint(const unsigned int connection_number,
  607. const unsigned int output_assembly_id,
  608. const unsigned int input_assembly_id,
  609. const unsigned int configuration_assembly_id);
  610. /** \ingroup CIP_API
  611. * \brief Configures the connection point for a listen only connection.
  612. *
  613. * @param connection_number The number of the input only connection. The
  614. * enumeration starts with 0. Has to be smaller than
  615. * OPENER_CIP_NUM_LISTEN_ONLY_CONNS.
  616. * @param output_assembly_id ID of the O-to-T point to be used for this
  617. * connection
  618. * @param input_assembly_id ID of the T-to-O point to be used for this
  619. * connection
  620. * @param configuration_assembly_id ID of the configuration point to be used for
  621. * this connection
  622. */
  623. void ConfigureListenOnlyConnectionPoint(const unsigned int connection_number,
  624. const unsigned int output_assembly_id,
  625. const unsigned int input_assembly_id,
  626. const unsigned int configuration_assembly_id);
  627. /** @ingroup CIP_API
  628. * @brief Notify the encapsulation layer that an explicit message has been
  629. * received via TCP.
  630. *
  631. * @param socket_handle Socket handle from which data is received.
  632. * @param buffer Buffer that contains the received data. This buffer will also
  633. * contain the response if one is to be sent.
  634. * @param length Length of the data in buffer.
  635. * @param number_of_remaining_bytes Return how many bytes of the input are left
  636. * over after we're done here
  637. * @param originator_address Address struct of the message originator
  638. * @param outgoing_message The outgoing ENIP message
  639. * @return kEipStatusOkSend: a response needs to be sent, others: EIP stack status
  640. */
  641. EipStatus HandleReceivedExplictTcpData(int socket_handle,
  642. EipUint8 *buffer,
  643. size_t length,
  644. int *number_of_remaining_bytes,
  645. struct sockaddr *originator_address,
  646. ENIPMessage *const outgoing_message);
  647. /** @ingroup CIP_API
  648. * @brief Notify the encapsulation layer that an explicit message has been
  649. * received via UDP.
  650. *
  651. * @param socket_handle socket handle from which data is received.
  652. * @param from_address remote address from which the data is received.
  653. * @param buffer buffer that contains the received data. This buffer will also
  654. * contain the response if one is to be sent.
  655. * @param buffer_length length of the data in buffer.
  656. * @param number_of_remaining_bytes return how many bytes of the input are left
  657. * over after we're done here
  658. * @param unicast Was the data received as unicast message?
  659. * @param outgoing_message Outgoing ENIP message
  660. * @return kEipStatusOkSend: a response needs to be sent, others: EIP stack status
  661. */
  662. EipStatus HandleReceivedExplictUdpData(const int socket_handle,
  663. const struct sockaddr_in *from_address,
  664. const EipUint8 *buffer,
  665. const size_t buffer_length,
  666. int *number_of_remaining_bytes,
  667. bool unicast,
  668. ENIPMessage *const outgoing_message);
  669. /** @ingroup CIP_API
  670. * @brief Notify the connection manager that data for a connection has been
  671. * received.
  672. *
  673. * This function should be invoked by the network layer.
  674. * @param received_data pointer to the buffer of data that has been received
  675. * @param received_data_length number of bytes in the data buffer
  676. * @param from_address address from which the data has been received. Only
  677. * data from the connections originator may be accepted. Avoids
  678. * connection hijacking
  679. * @return EIP_OK on success
  680. */
  681. EipStatus HandleReceivedConnectedData(const EipUint8 *const received_data,
  682. int received_data_length,
  683. struct sockaddr_in *from_address);
  684. /** @ingroup CIP_API
  685. * @brief Check if any of the connection timers (TransmissionTrigger or
  686. * WatchdogTimeout) have timed out.
  687. *
  688. * If the a timeout occurs the function performs the necessary action. This
  689. * function should be called periodically once every @ref kOpenerTimerTickInMilliSeconds
  690. * milliseconds. In order to simplify the algorithm if more time was lapsed, the elapsed
  691. * time since the last call of the function is given as a parameter.
  692. *
  693. * @param elapsed_time Elapsed time in milliseconds since the last call of ManageConnections
  694. *
  695. * @return EIP_OK on success
  696. */
  697. EipStatus ManageConnections(MilliSeconds elapsed_time);
  698. /** @ingroup CIP_API
  699. * @brief Trigger the production of an application triggered connection.
  700. *
  701. * This will issue the production of the specified connection at the next
  702. * possible occasion. Depending on the values for the RPI and the production
  703. * inhibit timer. The application is informed via the
  704. * EIP_BOOL8 BeforeAssemblyDataSend(S_CIP_Instance *pa_pstInstance)
  705. * callback function when the production will happen. This function should only
  706. * be invoked from void HandleApplication(void).
  707. *
  708. * The connection can only be triggered if the application is established and it
  709. * is of application application triggered type.
  710. *
  711. * @param output_assembly_id the output assembly connection point of the
  712. * connection
  713. * @param input_assembly_id the input assembly connection point of the
  714. * connection
  715. * @return EIP_OK on success
  716. */
  717. EipStatus TriggerConnections(unsigned int output_assembly_id,
  718. unsigned int input_assembly_id);
  719. /** @ingroup CIP_API
  720. * @brief Inform the encapsulation layer that the remote host has closed the
  721. * connection.
  722. *
  723. * According to the specifications that will clean up and close the session in
  724. * the encapsulation layer.
  725. * @param socket_handle the handler to the socket of the closed connection
  726. */
  727. void CloseSession(int socket_handle);
  728. /** @defgroup CIP_CALLBACK_API Callback Functions Demanded by OpENer
  729. * @ingroup CIP_API
  730. *
  731. * @brief These functions have to implemented in order to give the OpENer a
  732. * method to inform the application on certain state changes.
  733. */
  734. /** @ingroup CIP_CALLBACK_API
  735. * @brief Callback for the application initialization
  736. *
  737. * This function will be called by the CIP stack after it has finished its
  738. * initialization. In this function the user can setup all CIP objects she
  739. * likes to have.
  740. *
  741. * This function is provided for convenience reasons. After the void
  742. * CipStackInit(void)
  743. * function has finished it is okay to also generate your CIP objects.
  744. * return status EIP_ERROR .. error
  745. * EIP_OK ... successful finish
  746. */
  747. EipStatus ApplicationInitialization(void);
  748. /** @ingroup CIP_CALLBACK_API
  749. * @brief Allow the device specific application to perform its execution
  750. *
  751. * This function will be executed by the stack at the beginning of each
  752. * execution of EIP_STATUS ManageConnections(void). It allows to implement
  753. * device specific application functions. Execution within this function should
  754. * be short.
  755. */
  756. void HandleApplication(void);
  757. /** @ingroup CIP_CALLBACK_API
  758. * @brief Inform the application on changes occurred for a connection
  759. *
  760. * @param output_assembly_id the output assembly connection point of the
  761. * connection
  762. * @param input_assembly_id the input assembly connection point of the
  763. * connection
  764. * @param io_connection_event information on the change occurred
  765. */
  766. void CheckIoConnectionEvent(unsigned int output_assembly_id,
  767. unsigned int input_assembly_id,
  768. IoConnectionEvent io_connection_event);
  769. /** @ingroup CIP_CALLBACK_API
  770. * @brief Call back function to inform application on received data for an
  771. * assembly object.
  772. *
  773. * This function has to be implemented by the user of the CIP-stack.
  774. * @param instance pointer to the assembly object data was received for
  775. * @return Information if the data could be processed
  776. * - EIP_OK the received data was ok
  777. * - EIP_ERROR the received data was wrong (especially needed for
  778. * configuration data assembly objects)
  779. *
  780. * Assembly Objects for Configuration Data:
  781. * The CIP-stack uses this function to inform on received configuration data.
  782. * The length of the data is already checked within the stack. Therefore the
  783. * user only has to check if the data is valid.
  784. */
  785. EipStatus AfterAssemblyDataReceived(CipInstance *instance);
  786. /** @ingroup CIP_CALLBACK_API
  787. * @brief Inform the application that the data of an assembly
  788. * object will be sent.
  789. *
  790. * Within this function the user can update the data of the assembly object
  791. * before it gets sent. The application can inform the application if data has
  792. * changed.
  793. * @param instance instance of assembly object that should send data.
  794. * @return data has changed:
  795. * - true assembly data has changed
  796. * - false assembly data has not changed
  797. */
  798. EipBool8 BeforeAssemblyDataSend(CipInstance *instance);
  799. /** @ingroup CIP_CALLBACK_API
  800. * @brief Emulate as close a possible a power cycle of the device
  801. *
  802. * @return if the service is supported the function will not return.
  803. * EIP_ERROR if this service is not supported
  804. */
  805. EipStatus ResetDevice(void);
  806. /** @ingroup CIP_CALLBACK_API
  807. * @brief Reset the device to the initial configuration and emulate as close as
  808. * possible a power cycle of the device
  809. *
  810. * @return if the service is supported the function will not return.
  811. * EIP_ERROR if this service is not supported
  812. */
  813. EipStatus ResetDeviceToInitialConfiguration(void);
  814. /** @ingroup CIP_CALLBACK_API
  815. * @brief Allocate memory for the CIP stack
  816. *
  817. * emulate the common c-library function calloc
  818. * In OpENer allocation only happens on application startup and on
  819. * class/instance creation and configuration not on during operation
  820. * (processing messages).
  821. * @param number_of_elements number of elements to allocate
  822. * @param size_of_element size in bytes of one element
  823. * @return pointer to the allocated memory, 0 on error
  824. */
  825. void *CipCalloc(size_t number_of_elements,
  826. size_t size_of_element);
  827. /** @ingroup CIP_CALLBACK_API
  828. * @brief Free memory allocated by the OpENer
  829. *
  830. * emulate the common c-library function free
  831. * @param data pointer to the allocated memory
  832. */
  833. void CipFree(void *data);
  834. /** @ingroup CIP_CALLBACK_API
  835. * @brief Inform the application that the Run/Idle State has been changed
  836. * by the originator.
  837. *
  838. * @param run_idle_value the current value of the run/idle flag according to CIP
  839. * spec Vol 1 3-6.5
  840. */
  841. void RunIdleChanged(EipUint32 run_idle_value);
  842. /** @ingroup CIP_CALLBACK_API
  843. * @brief Create the UDP socket for the implicit IO messaging,
  844. * one socket handles all connections
  845. * @return the socket handle if successful, else kEipInvalidSocket
  846. */
  847. int CreateUdpSocket(void);
  848. /** @ingroup CIP_CALLBACK_API
  849. * @brief Sends the data for the implicit IO messaging via UDP socket
  850. * @param socket_data Address message to be sent
  851. * @param outgoing message The constructed outgoing message
  852. * @return kEipStatusOk on success
  853. */
  854. EipStatus SendUdpData(const struct sockaddr_in *const socket_data,
  855. const ENIPMessage *const outgoing_message);
  856. /** @ingroup CIP_CALLBACK_API
  857. * @brief Close the given socket and clean up the stack
  858. *
  859. * @param socket_handle socket descriptor to close
  860. */
  861. void CloseSocket(const int socket_handle);
  862. /** @ingroup CIP_CALLBACK_API
  863. * @brief Register function pointer in timeout_checker_array
  864. *
  865. * @param timeout_checker_function pointer to object specific timeout checker function
  866. */
  867. void RegisterTimeoutChecker(TimeoutCheckerFunction timeout_checker_function);
  868. /** @mainpage OpENer - Open Source EtherNet/IP(TM) Communication Stack
  869. * Documentation
  870. *
  871. * EtherNet/IP stack for adapter devices (connection target); supports multiple
  872. * I/O and explicit connections; includes features and objects required by the
  873. * CIP specification to enable devices to comply with ODVA's conformance/
  874. * interoperability tests.
  875. *
  876. * @section intro_sec Introduction
  877. *
  878. * This is the introduction.
  879. *
  880. * @section install_sec Building
  881. * How to compile, install and run OpENer on a specific platform.
  882. *
  883. * @subsection build_req_sec Requirements
  884. * OpENer has been developed to be highly portable. The default version targets
  885. * PCs with a POSIX operating system and a BSD-socket network interface. To
  886. * test this version we recommend a Linux PC or Windows with Cygwin installed.
  887. * You will need to have the following installed:
  888. * - gcc, make, binutils, etc.
  889. *
  890. * for normal building. These should be installed on most Linux installations
  891. * and are part of the development packages of Cygwin.
  892. *
  893. * For the development itself we recommend the use of Eclipse with the CDT
  894. * plugin. For your convenience OpENer already comes with an Eclipse project
  895. * file. This allows to just import the OpENer source tree into Eclipse.
  896. *
  897. * @subsection compile_pcs_sec Compile for PCs
  898. * -# Directly in the shell
  899. * -# Go into the bin/pc directory
  900. * -# Invoke make
  901. * -# For invoking opener type:\n
  902. * ./opener ipaddress subnetmask gateway domainname hostaddress
  903. * macaddress\n
  904. * e.g., ./opener 192.168.0.2 255.255.255.0 192.168.0.1 test.com
  905. * testdevice 00 15 C5 BF D0 87
  906. * -# Within Eclipse
  907. * -# Import the project
  908. * -# Go to the bin/pc folder in the make targets view
  909. * -# Choose all from the make targets
  910. * -# The resulting executable will be in the directory
  911. * ./bin/pc
  912. * -# The command line parameters can be set in the run configuration
  913. * dialog of Eclipse
  914. *
  915. * @section further_reading_sec Further Topics
  916. * - @ref porting
  917. * - @ref extending
  918. * - @ref license
  919. *
  920. * @page porting Porting OpENer
  921. * @section gen_config_section General Stack Configuration
  922. * The general stack properties have to be defined prior to building your
  923. * production. This is done by providing a file called opener_user_conf.h. An
  924. * example file can be found in the src/ports/POSIX or src/ports/WIN32 directory.
  925. * The documentation of the example file for the necessary configuration options:
  926. * opener_user_conf.h
  927. *
  928. * @copydoc ./ports/POSIX/sample_application/opener_user_conf.h
  929. *
  930. * @section startup_sec Startup Sequence
  931. * During startup of your EtherNet/IP(TM) device the following steps have to be
  932. * performed:
  933. * -# Configure the network properties:\n
  934. * With the following functions the network interface of OpENer is
  935. * configured:
  936. * - EIP_STATUS ConfigureNetworkInterface(const char *ip_address,
  937. * const char *subnet_mask, const char *gateway_address)
  938. * - void ConfigureMACAddress(const EIP_UINT8 *mac_address)
  939. * - void ConfigureDomainName(const char *domain_name)
  940. * - void ConfigureHostName(const char *host_name)
  941. * .
  942. * Depending on your platform these data can come from a configuration
  943. * file or from operating system functions. If these values should be
  944. * setable remotely via explicit messages the SetAttributeSingle functions
  945. * of the EtherNetLink and the TCPIPInterface object have to be adapted.
  946. * -# Set the device's serial number\n
  947. * According to the CIP specification a device vendor has to ensure that
  948. * each of its devices has a unique 32Bit device id. You can set it with
  949. * the function:
  950. * - void setDeviceSerialNumber(EIP_UINT32 serial_number)
  951. * -# Initialize OpENer: \n
  952. * With the function CipStackInit(EIP_UINT16 unique_connection_id) the
  953. * internal data structures of opener are correctly setup. After this
  954. * step own CIP objects and Assembly objects instances may be created. For
  955. * your convenience we provide the call-back function
  956. * ApplicationInitialization. This call back function is called when the
  957. * stack is ready to receive application specific CIP objects.
  958. * -# Create Application Specific CIP Objects:\n
  959. * Within the call-back function ApplicationInitialization(void) or
  960. * after CipStackInit(void) has finished you may create and configure any
  961. * CIP object or Assembly object instances. See the module @ref CIP_API
  962. * for available functions. Currently no functions are available to
  963. * remove any created objects or instances. This is planned
  964. * for future versions.
  965. * -# Setup the listening TCP and UDP port:\n
  966. * THE ETHERNET/IP SPECIFICATION demands from devices to listen to TCP
  967. * connections and UDP datagrams on the port AF12hex for explicit messages.
  968. * Therefore before going into normal operation you need to configure your
  969. * network library so that TCP and UDP messages on this port will be
  970. * received and can be hand over to the Ethernet encapsulation layer.
  971. *
  972. * @section normal_op_sec Normal Operation
  973. * During normal operation the following tasks have to be done by the platform
  974. * specific code:
  975. * - Establish connections requested on TCP port AF12hex
  976. * - Receive explicit message data on connected TCP sockets and the UPD socket
  977. * for port AF12hex. The received data has to be hand over to Ethernet
  978. * encapsulation layer with the functions: \n
  979. * int HandleReceivedExplictTCPData(int socket_handle, EIP_UINT8* buffer, int
  980. * buffer_length, int *number_of_remaining_bytes),\n
  981. * int HandleReceivedExplictUDPData(int socket_handle, struct sockaddr_in
  982. * *from_address, EIP_UINT8* buffer, unsigned int buffer_length, int
  983. * *number_of_remaining_bytes).\n
  984. * Depending if the data has been received from a TCP or from a UDP socket.
  985. * As a result of this function a response may have to be sent. The data to
  986. * be sent is in the given buffer pa_buf.
  987. * - Create UDP sending and receiving sockets for implicit connected
  988. * messages\n
  989. * OpENer will use to call-back function int CreateUdpSocket(
  990. * UdpCommuncationDirection connection_direction,
  991. * struct sockaddr_in *pa_pstAddr)
  992. * for informing the platform specific code that a new connection is
  993. * established and new sockets are necessary
  994. * - Receive implicit connected data on a receiving UDP socket\n
  995. * The received data has to be hand over to the Connection Manager Object
  996. * with the function EIP_STATUS HandleReceivedConnectedData(EIP_UINT8
  997. * *data, int data_length)
  998. * - Close UDP and TCP sockets:
  999. * -# Requested by OpENer through the call back function: void
  1000. * CloseSocket(int socket_handle)
  1001. * -# For TCP connection when the peer closed the connection OpENer needs
  1002. * to be informed to clean up internal data structures. This is done
  1003. * with
  1004. * the function void CloseSession(int socket_handle).
  1005. * .
  1006. * - Cyclically update the connection status:\n
  1007. * In order that OpENer can determine when to produce new data on
  1008. * connections or that a connection timed out every @ref kOpenerTimerTickInMilliSeconds
  1009. * milliseconds the
  1010. * function EIP_STATUS ManageConnections(void) has to be called.
  1011. *
  1012. * @section callback_funcs_sec Callback Functions
  1013. * In order to make OpENer more platform independent and in order to inform the
  1014. * application on certain state changes and actions within the stack a set of
  1015. * call-back functions is provided. These call-back functions are declared in
  1016. * the file opener_api.h and have to be implemented by the application specific
  1017. * code. An overview and explanation of OpENer's call-back API may be found in
  1018. * the module @ref CIP_CALLBACK_API.
  1019. *
  1020. * @page extending Extending OpENer
  1021. * OpENer provides an API for adding own CIP objects and instances with
  1022. * specific services and attributes. Therefore OpENer can be easily adapted to
  1023. * support different device profiles and specific CIP objects needed for your
  1024. * device. The functions to be used are:
  1025. * - CipClass *CreateCipClass( const CipUdint class_code,
  1026. const int number_of_class_attributes,
  1027. const EipUint32 highest_class_attribute_number,
  1028. const int number_of_class_services,
  1029. const int number_of_instance_attributes,
  1030. const EipUint32 highest_instance_attribute_number,
  1031. const int number_of_instance_services,
  1032. const int number_of_instances,
  1033. char *name,
  1034. const EipUint16 revision,
  1035. InitializeCipClass initializer );
  1036. * - CipInstance *AddCipInstances(CipClass *RESTRICT const cip_class,
  1037. const int number_of_instances)
  1038. * - CipInstance *AddCipInstance(CipClass *RESTRICT const class,
  1039. const EipUint32 instance_id)
  1040. * - void InsertAttribute(CipInstance *const cip_instance,
  1041. const EipUint16 attribute_number,
  1042. const EipUint8 cip_data_type,
  1043. void *const cip_data,
  1044. const EipByte cip_flags);
  1045. * - void InsertService(const CipClass *const cip_class_to_add_service,
  1046. const EipUint8 service_code,
  1047. const CipServiceFunction service_function,
  1048. char *const service_name);
  1049. *
  1050. * @page license OpENer Open Source License
  1051. * The OpENer Open Source License is an adapted BSD style license. The
  1052. * adaptations include the use of the term EtherNet/IP(TM) and the necessary
  1053. * guarding conditions for using OpENer in own products. For this please look
  1054. * in license text as shown below:
  1055. *
  1056. * @include "../license.txt"
  1057. *
  1058. */
  1059. #endif /*OPENER_OPENER_API_H_*/