OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
opener_api.h File Reference
#include <assert.h>
#include <stdbool.h>
#include "typedefs.h"
#include "ciptypes.h"
#include "ciperror.h"
#include "opener_user_conf.h"
Include dependency graph for opener_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct
cip_connection_object 
CipConnectionObject
 
typedef void(* ConnectionCloseFunction )(CipConnectionObject *connection_object)
 Function prototype for handling the closing of connections. More...
 
typedef EipStatus(* ConnectionReceiveDataFunction )(CipConnectionObject *connection_object, const EipUint8 *data, const EipUint16 data_length)
 Function prototype for receiving data via a connection. More...
 
typedef EipStatus(* ConnectionSendDataFunction )(CipConnectionObject *connection_object)
 Function prototype for sending data via a connection. More...
 
typedef void(* ConnectionTimeoutFunction )(CipConnectionObject *connection_object)
 Function prototype for handling the timeout of connections. More...
 
typedef void(* InitializeCipClass )(CipClass *)
 
typedef EipStatus(* OpenConnectionFunction )(CipConnectionObject *RESTRICT const connection_object, EipUint16 *const extended_error_code)
 Function prototype for handling the opening of connections. More...
 

Functions

CipInstanceAddCIPInstance (CipClass *RESTRICT const cip_class_to_add_instance, const EipUint32 instance_id)
 Create one instance of a given class with a certain instance number. More...
 
CipInstanceAddCipInstances (CipClass *RESTRICT const cip_object_to_add_instances, const int number_of_instances)
 Add a number of CIP instances to a given CIP class. More...
 
EipStatus AddConnectableObject (const EipUint32 class_id, OpenConnectionFunction open_connection_function)
 register open functions for an specific object. More...
 
EipStatus AfterAssemblyDataReceived (CipInstance *instance)
 Call back function to inform application on received data for an assembly object. More...
 
void AllocateAttributeMasks (CipClass *target_class)
 Allocates Attribute bitmasks. More...
 
EipStatus ApplicationInitialization (void)
 Callback for the application initialization. More...
 
EipBool8 BeforeAssemblyDataSend (CipInstance *instance)
 Inform the application that the data of an assembly object will be sent. More...
 
size_t CalculateIndex (EipUint16 attribute_number)
 Calculates Byte-Index of Attribute. More...
 
void CheckIoConnectionEvent (unsigned int output_assembly_id, unsigned int input_assembly_id, IoConnectionEvent io_connection_event)
 Inform the application on changes occurred for a connection. More...
 
void * CipCalloc (size_t number_of_elements, size_t size_of_element)
 Allocate memory for the CIP stack. More...
 
void CipFree (void *data)
 Free memory allocated by the OpENer. More...
 
void CipStackInit (const EipUint16 unique_connection_id)
 Initialize and setup the CIP-stack. More...
 
void CloseSession (int socket_handle)
 Inform the encapsulation layer that the remote host has closed the connection. More...
 
void CloseSocket (const int socket_handle)
 Close the given socket and clean up the stack. More...
 
void ConfigureDomainName (void)
 Configure the domain name of the device. More...
 
void ConfigureExclusiveOwnerConnectionPoint (const unsigned int connection_number, const unsigned int output_assembly_id, const unsigned int input_assembly_id, const unsigned int configuration_assembly_id)
 Configures the connection point for an exclusive owner connection. More...
 
void ConfigureHostName (void)
 Configure the host name of the device. More...
 
void ConfigureInputOnlyConnectionPoint (const unsigned int connection_number, const unsigned int output_assembly_id, const unsigned int input_assembly_id, const unsigned int configuration_assembly_id)
 Configures the connection point for an input only connection. More...
 
void ConfigureListenOnlyConnectionPoint (const unsigned int connection_number, const unsigned int output_assembly_id, const unsigned int input_assembly_id, const unsigned int configuration_assembly_id)
 Configures the connection point for a listen only connection. More...
 
void ConfigureMacAddress (const char *network_interface)
 Configure the MAC address of the device. More...
 
EipStatus ConfigureNetworkInterface (const char *const network_interface)
 Configure the data of the network interface of the device. More...
 
CipInstanceCreateAssemblyObject (const EipUint32 instance_number, EipByte *const data, const EipUint16 data_length)
 Create an instance of an assembly object. More...
 
CipClassCreateCipClass (const EipUint32 class_id, const int number_of_class_attributes, const EipUint32 highest_class_attribute_number, const int number_of_class_services, const int number_of_instance_attributes, const EipUint32 highest_instance_attribute_number, const int number_of_instance_services, const int number_of_instances, char *name, const EipUint16 revision, InitializeCipClass initializer)
 Allocate memory for new CIP Class and attributes. More...
 
int CreateUdpSocket (UdpCommuncationDirection communication_direction, struct sockaddr_in *socket_data, CipUsint qos_for_socket)
 create a producing or consuming UDP socket More...
 
int DecodeData (const EipUint8 cip_data_type, void *const cip_data, const EipUint8 **const cip_message)
 Retrieve the given data according to CIP encoding from the message buffer. More...
 
int EncodeData (const EipUint8 cip_data_type, const void *const cip_data, EipUint8 **cip_message)
 Produce the data according to CIP encoding onto the message buffer. More...
 
CipAttributeStructGetCipAttribute (const CipInstance *const cip_instance, const EipUint16 attribute_number)
 Get a pointer to an instance's attribute. More...
 
CipClassGetCipClass (const EipUint32 class_id)
 Get a pointer to a CIP object with given class code. More...
 
CipInstanceGetCipInstance (const CipClass *RESTRICT const cip_object, const EipUint32 instance_number)
 Get a pointer to an instance. More...
 
void HandleApplication (void)
 Allow the device specific application to perform its execution. More...
 
EipStatus HandleReceivedConnectedData (const EipUint8 *const received_data, int received_data_length, struct sockaddr_in *from_address)
 Notify the connection manager that data for a connection has been received. More...
 
int HandleReceivedExplictTcpData (int socket_handle, EipUint8 *buffer, size_t length, int *number_of_remaining_bytes, struct sockaddr *originator_address, ENIPMessage *const outgoing_message)
 Notify the encapsulation layer that an explicit message has been received via TCP. More...
 
int HandleReceivedExplictUdpData (const int socket_handle, const struct sockaddr_in *from_address, const EipUint8 *buffer, const size_t buffer_length, int *number_of_remaining_bytes, bool unicast, ENIPMessage *const outgoing_message)
 Notify the encapsulation layer that an explicit message has been received via UDP. More...
 
void InsertAttribute (CipInstance *const cip_instance, const EipUint16 attribute_number, const EipUint8 cip_data_type, void *const cip_data, const EipByte cip_flags)
 Insert an attribute in an instance of a CIP class. More...
 
void InsertService (const CipClass *const cip_class_to_add_service, const EipUint8 service_code, const CipServiceFunction service_function, char *const service_name)
 Insert a service in an instance of a CIP object. More...
 
EipStatus ManageConnections (MilliSeconds elapsed_time)
 Check if any of the connection timers (TransmissionTrigger or WatchdogTimeout) have timed out. More...
 
EipStatus ResetDevice (void)
 Emulate as close a possible a power cycle of the device. More...
 
EipStatus ResetDeviceToInitialConfiguration (void)
 Reset the device to the initial configuration and emulate as close as possible a power cycle of the device. More...
 
void RunIdleChanged (EipUint32 run_idle_value)
 Inform the application that the Run/Idle State has been changed by the originator. More...
 
EipStatus SendUdpData (struct sockaddr_in *socket_data, int socket_handle, EipUint8 *data, EipUint16 data_length)
 Create a producing or consuming UDP socket. More...
 
void SetDeviceSerialNumber (const EipUint32 serial_number)
 Set the serial number of the device's identity object. More...
 
void SetDeviceStatus (const EipUint16 device_status)
 Set the current status of the device. More...
 
void ShutdownCipStack (void)
 Shutdown of the CIP stack. More...
 
EipStatus TriggerConnections (unsigned int output_assembly_id, unsigned int input_assembly_id)
 Trigger the production of an application triggered connection. More...
 

Typedef Documentation

Definition at line 299 of file opener_api.h.

typedef void(* InitializeCipClass)(CipClass *)

Initializer function for CIP class initialization

Definition at line 122 of file opener_api.h.