OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipelectronickey.c File Reference
#include <stdlib.h>
#include "cipelectronickey.h"
Include dependency graph for cipelectronickey.c:

Go to the source code of this file.

Data Structures

struct  electronic_key_format_4
 

Typedefs

typedef struct
electronic_key_format_4 
ElectronicKeyFormat4
 

Functions

void ElectronicKeyFormat4Delete (ElectronicKeyFormat4 **electronic_key)
 Destructor for the electroic key format 4 class. More...
 
CipUint ElectronicKeyFormat4GetDeviceType (const ElectronicKeyFormat4 *const electronic_key)
 Gets the device type from a format 4 electronic key. More...
 
CipByte ElectronicKeyFormat4GetMajorRevision (const ElectronicKeyFormat4 *const electronic_key)
 Gets the major revision from an format 4 electronic key. More...
 
bool ElectronicKeyFormat4GetMajorRevisionCompatibility (const ElectronicKeyFormat4 *const electronic_key)
 Gets the Compatibility flag from the format 4 electronic key. More...
 
CipUsint ElectronicKeyFormat4GetMinorRevision (const ElectronicKeyFormat4 *const electronic_key)
 Gets the minor revision from an format 4 electronic key. More...
 
CipUint ElectronicKeyFormat4GetProductCode (const ElectronicKeyFormat4 *const electronic_key)
 Gets the product code from an format 4 electronic key. More...
 
CipUint ElectronicKeyFormat4GetVendorId (const ElectronicKeyFormat4 *const electronic_key)
 Gets the vendor ID form the electronic key. More...
 
ElectronicKeyFormat4ElectronicKeyFormat4New ()
 Constructor for the electroic key format 4 class. More...
 
void ElectronicKeyFormat4SetDeviceType (ElectronicKeyFormat4 *const electronic_key, const CipUint device_type)
 Sets the device type in the electronic key. More...
 
void ElectronicKeyFormat4SetMajorRevisionCompatibility (ElectronicKeyFormat4 *const electronic_key, const CipByte major_revision_compatibility)
 Sets the major revision byte including the compatibility flag. More...
 
void ElectronicKeyFormat4SetMinorRevision (ElectronicKeyFormat4 *const electronic_key, const CipUsint minor_revision)
 Sets the devices minor revision in an format 4 electronic key. More...
 
void ElectronicKeyFormat4SetProductCode (ElectronicKeyFormat4 *const electronic_key, const CipUint product_code)
 Set product code in the electronic key. More...
 
void ElectronicKeyFormat4SetVendorId (ElectronicKeyFormat4 *const electronic_key, const CipUint vendor_id)
 Sets vendor ID in the electronic key. More...
 
void * ElectronicKeyGetKeyData (const CipElectronicKey *const electronic_key)
 
CipUint ElectronicKeyGetKeyFormat (const CipElectronicKey *const electronic_key)
 
void ElectronicKeySetKeyData (CipElectronicKey *const electronic_key, void *key_data)
 
void ElectronicKeySetKeyFormat (CipElectronicKey *const electronic_key, const CipUsint key_format)
 

Variables

const size_t kElectronicKeyFormat4Size = sizeof(ElectronicKeyFormat4)
 

Typedef Documentation

Function Documentation

void ElectronicKeyFormat4Delete ( ElectronicKeyFormat4 **  electronic_key)

Destructor for the electroic key format 4 class.

Safe destructor/free, nulls the pointer after freeing it

Parameters
electronic_keyA format 4 electronic key

Definition at line 44 of file cipelectronickey.c.

Referenced by ParseConnectionPath().

Here is the caller graph for this function:

CipUint ElectronicKeyFormat4GetDeviceType ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the device type from a format 4 electronic key.

Parameters
electronic_keyThe format 4 electronic key from which the device type will be extracted
Returns
The device type

Definition at line 65 of file cipelectronickey.c.

References electronic_key_format_4::device_type.

Referenced by CheckElectronicKeyData(), and ParseConnectionPath().

Here is the caller graph for this function:

CipByte ElectronicKeyFormat4GetMajorRevision ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the major revision from an format 4 electronic key.

Parameters
electronic_keyAn format 4 electronic key
Returns
The device's major revision

Definition at line 87 of file cipelectronickey.c.

References electronic_key_format_4::major_revision_compatibility.

Referenced by CheckElectronicKeyData(), and ParseConnectionPath().

Here is the caller graph for this function:

bool ElectronicKeyFormat4GetMajorRevisionCompatibility ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the Compatibility flag from the format 4 electronic key.

Parameters
electronic_keyThe format 4 electronic key to be read
Returns
True if compatibility bit is set, false if otherwise

Definition at line 93 of file cipelectronickey.c.

References electronic_key_format_4::major_revision_compatibility.

Referenced by CheckElectronicKeyData().

Here is the caller graph for this function:

CipUsint ElectronicKeyFormat4GetMinorRevision ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the minor revision from an format 4 electronic key.

Parameters
electronic_keyThe format 4 electronic key to be read
Returns
The device's minor revision

Definition at line 109 of file cipelectronickey.c.

References electronic_key_format_4::minor_revision.

Referenced by CheckElectronicKeyData(), and ParseConnectionPath().

Here is the caller graph for this function:

CipUint ElectronicKeyFormat4GetProductCode ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the product code from an format 4 electronic key.

Parameters
electronic_keyThe format 4 electronic key to be read
Returns
The product code

Definition at line 76 of file cipelectronickey.c.

References electronic_key_format_4::product_code.

Referenced by CheckElectronicKeyData(), and ParseConnectionPath().

Here is the caller graph for this function:

CipUint ElectronicKeyFormat4GetVendorId ( const ElectronicKeyFormat4 *const  electronic_key)

Gets the vendor ID form the electronic key.

Parameters
electronic_keyThe format 4 electronic key from which the vendor ID will be extracted
Returns
The vendor ID

Definition at line 54 of file cipelectronickey.c.

References electronic_key_format_4::vendor_id.

Referenced by CheckElectronicKeyData(), and ParseConnectionPath().

Here is the caller graph for this function:

ElectronicKeyFormat4* ElectronicKeyFormat4New ( )

Constructor for the electroic key format 4 class.

Returns
A new unset electronic key

Definition at line 40 of file cipelectronickey.c.

Referenced by ParseConnectionPath().

Here is the caller graph for this function:

void ElectronicKeyFormat4SetDeviceType ( ElectronicKeyFormat4 *const  electronic_key,
const CipUint  device_type 
)

Sets the device type in the electronic key.

Parameters
electronic_keyA format 4 electronic key
device_typeThe device type which shall be inserted into the electronic key

Definition at line 59 of file cipelectronickey.c.

References electronic_key_format_4::device_type.

Referenced by GetElectronicKeyFormat4FromMessage().

Here is the caller graph for this function:

void ElectronicKeyFormat4SetMajorRevisionCompatibility ( ElectronicKeyFormat4 *const  electronic_key,
const CipByte  major_revision_compatibility 
)

Sets the major revision byte including the compatibility flag.

Parameters
major_revision_compatibilityThe major revision byte including the compatibility flag
electronic_keyThe electronic key to be modified

Definition at line 81 of file cipelectronickey.c.

References electronic_key_format_4::major_revision_compatibility.

Referenced by GetElectronicKeyFormat4FromMessage().

Here is the caller graph for this function:

void ElectronicKeyFormat4SetMinorRevision ( ElectronicKeyFormat4 *const  electronic_key,
const CipUsint  minor_revision 
)

Sets the devices minor revision in an format 4 electronic key.

Parameters
minor_revisionThe minor revision to be set in the electronic key
electronic_keyThe electronic key to be modified

Definition at line 103 of file cipelectronickey.c.

References electronic_key_format_4::minor_revision.

Referenced by GetElectronicKeyFormat4FromMessage().

Here is the caller graph for this function:

void ElectronicKeyFormat4SetProductCode ( ElectronicKeyFormat4 *const  electronic_key,
const CipUint  product_code 
)

Set product code in the electronic key.

Parameters
electronic_keyThe electronic key to be modified
product_codeThe product code to be inserted

Definition at line 70 of file cipelectronickey.c.

References electronic_key_format_4::product_code.

Referenced by GetElectronicKeyFormat4FromMessage().

Here is the caller graph for this function:

void ElectronicKeyFormat4SetVendorId ( ElectronicKeyFormat4 *const  electronic_key,
const CipUint  vendor_id 
)

Sets vendor ID in the electronic key.

Parameters
electronic_keyThe electronic key to be set - will be modified
vendor_idThe vendor ID to be set into the electronic key

Definition at line 49 of file cipelectronickey.c.

References electronic_key_format_4::vendor_id.

Referenced by GetElectronicKeyFormat4FromMessage().

Here is the caller graph for this function:

void* ElectronicKeyGetKeyData ( const CipElectronicKey *const  electronic_key)

Definition at line 26 of file cipelectronickey.c.

References CipElectronicKey::key_data.

CipUint ElectronicKeyGetKeyFormat ( const CipElectronicKey *const  electronic_key)

Definition at line 16 of file cipelectronickey.c.

References CipElectronicKey::key_format.

void ElectronicKeySetKeyData ( CipElectronicKey *const  electronic_key,
void *  key_data 
)

Definition at line 21 of file cipelectronickey.c.

References CipElectronicKey::key_data.

void ElectronicKeySetKeyFormat ( CipElectronicKey *const  electronic_key,
const CipUsint  key_format 
)

Definition at line 11 of file cipelectronickey.c.

References CipElectronicKey::key_format.

Variable Documentation

const size_t kElectronicKeyFormat4Size = sizeof(ElectronicKeyFormat4)

Definition at line 38 of file cipelectronickey.c.