OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipidentity.c File Reference
#include <string.h>
#include "cipidentity.h"
#include "opener_user_conf.h"
#include "cipcommon.h"
#include "cipmessagerouter.h"
#include "ciperror.h"
#include "endianconv.h"
#include "opener_api.h"
#include "trace.h"
Include dependency graph for cipidentity.c:

Go to the source code of this file.

Functions

EipStatus CipIdentityInit ()
 CIP Identity object constructor. More...
 
 CipIdentitySetExtendedDeviceStatus (CipIdentityExtendedStatus extended_status)
 
void InitializeCipIdentiy (CipClass *class)
 
void SetDeviceSerialNumber (const EipUint32 serial_number)
 Set the serial number of the device's identity object. More...
 
void SetDeviceStatus (const EipUint16 status)
 Private function, sets the devices status. More...
 

Variables

CipUint device_type_ = OPENER_DEVICE_TYPE
 
CipUint product_code_ = OPENER_DEVICE_PRODUCT_CODE
 
CipShortString product_name_
 
CipRevision revision_
 
CipUdint serial_number_ = 0
 
CipWord status_ = 0
 
CipUint vendor_id_ = OPENER_DEVICE_VENDOR_ID
 

Detailed Description

CIP Identity Object

Implemented Attributes

  • Attribute 1: VendorID
  • Attribute 2: Device Type
  • Attribute 3: Product Code
  • Attribute 4: Revision
  • Attribute 5: Status
  • Attribute 6: Serial Number
  • Attribute 7: Product Name

Implemented Services

Definition in file cipidentity.c.

Function Documentation

EipStatus CipIdentityInit ( void  )

CIP Identity object constructor.

Returns
kEipStatusError if the class could not be created, otherwise kEipStatusOk

Definition at line 148 of file cipidentity.c.

References CreateCipClass(), device_type_, GetAttributeAll(), GetAttributeSingle(), GetCipInstance(), InitializeCipIdentiy(), InsertAttribute(), InsertService(), kCipShortString, kCipUdint, kCipUint, kCipUsintUsint, kCipWord, kEipStatusError, kEipStatusOk, kGetableSingleAndAll, kGetAttributeAll, kGetAttributeSingle, kReset, product_code_, serial_number_, status_, and vendor_id_.

Referenced by CipStackInit().

Here is the call graph for this function:

Here is the caller graph for this function:

CipIdentitySetExtendedDeviceStatus ( CipIdentityExtendedStatus  extended_status)

Definition at line 185 of file cipidentity.c.

References OPENER_TRACE_INFO, and status_.

Referenced by HandleReceivedIoConnectionData(), and RunIdleChanged().

Here is the caller graph for this function:

void InitializeCipIdentiy ( CipClass class)

Definition at line 123 of file cipidentity.c.

References cip_instance::cip_class, cip_class::class_instance, cip_class::highest_attribute_number, InsertAttribute(), kCipUint, kGetableSingleAndAll, kGetAttributeSingle, and kNotSetOrGetable.

Referenced by CipIdentityInit().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

CipUint device_type_ = OPENER_DEVICE_TYPE

Attribute 2: Device Type

Definition at line 42 of file cipidentity.c.

Referenced by CheckElectronicKeyData(), CipIdentityInit(), and EncapsulateListIdentityResponseMessage().

Attribute 3: Product Code

Definition at line 43 of file cipidentity.c.

Referenced by CheckElectronicKeyData(), CipIdentityInit(), and EncapsulateListIdentityResponseMessage().

CipShortString product_name_
Initial value:
= { sizeof(OPENER_DEVICE_NAME) - 1,
#define OPENER_DEVICE_NAME
Definition: devicedata.h:15

Attribute 7: Product Name

Definition at line 48 of file cipidentity.c.

CipRevision revision_
Initial value:
#define OPENER_DEVICE_MAJOR_REVISION
Definition: devicedata.h:13
#define OPENER_DEVICE_MINOR_REVISION
Definition: devicedata.h:14

Attribute 4: Revision / USINT Major, USINT Minor

Definition at line 44 of file cipidentity.c.

CipUdint serial_number_ = 0

Attribute 6: Serial Number, has to be set prior to OpENer initialization

Definition at line 47 of file cipidentity.c.

Referenced by CipIdentityInit(), EncapsulateListIdentityResponseMessage(), and SetDeviceSerialNumber().

CipWord status_ = 0

Attribute 1: Vendor ID

Definition at line 41 of file cipidentity.c.

Referenced by CheckElectronicKeyData(), CipIdentityInit(), and EncapsulateListIdentityResponseMessage().