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

Go to the source code of this file.

Macros

#define DATA_SEGMENT_SUBTYPE_ANSI_EXTENDED_SYMBOL   0x11
 
#define DATA_SEGMENT_SUBTYPE_SIMPLE_DATA   0x00
 
#define ELECTRONIC_KEY_SEGMENT_KEY_FORMAT_4   0x04
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX   0x01
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX   0x03
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX   0x02
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX   0x04
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_RESERVED   0x00
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE   0x06
 
#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER   0x05
 
#define LOGICAL_SEGMENT_FORMAT_EIGHT_BIT   0x00
 
#define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT   0x01
 
#define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT   0x02
 
#define LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY   0x00
 
#define LOGICAL_SEGMENT_TYPE_ATTRIBUTE_ID   0x10
 
#define LOGICAL_SEGMENT_TYPE_CLASS_ID   0x00
 
#define LOGICAL_SEGMENT_TYPE_CONNECTION_POINT   0x0C
 
#define LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL   0x1C
 
#define LOGICAL_SEGMENT_TYPE_INSTANCE_ID   0x04
 
#define LOGICAL_SEGMENT_TYPE_MEMBER_ID   0x08
 
#define LOGICAL_SEGMENT_TYPE_SERVICE_ID   0x18
 
#define LOGICAL_SEGMENT_TYPE_SPECIAL   0x14
 
#define NETWORK_SEGMENT_EXTENDED_NETWORK   0x1F
 
#define NETWORK_SEGMENT_FIXED_TAG   0x02
 
#define NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MICROSECONDS   0x10
 
#define NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MILLISECONDS   0x03
 
#define NETWORK_SEGMENT_SAFETY   0x04
 
#define NETWORK_SEGMENT_SCHEDULE   0x01
 
#define SEGMENT_TYPE_DATA_SEGMENT   0x80
 
#define SEGMENT_TYPE_DATA_TYPE_CONSTRUCTED   0xA0
 
#define SEGMENT_TYPE_DATA_TYPE_ELEMENTARTY   0xC0
 
#define SEGMENT_TYPE_LOGICAL_SEGMENT   0x20
 
#define SEGMENT_TYPE_NETWORK_SEGMENT   0x40
 
#define SEGMENT_TYPE_PORT_SEGMENT   0x00
 
#define SEGMENT_TYPE_SEGMENT_RESERVED   0xE0
 
#define SEGMENT_TYPE_SYMBOLIC_SEGMENT   0x60
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_DOUBLE_CHAR   0x20
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC   0xC0
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UDINT_TYPE   0x08
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UINT_TYPE   0x07
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_USINT_TYPE   0x06
 
#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_TRIPLE_CHAR   0x40
 
#define SYMBOLIC_SEGMENT_FORMAT_EXTENDED_STRING   0x00
 

Functions

size_t CipEpathEncodeConnectionEpath (const CipConnectionPathEpath *const connection_epath, CipOctet **encoded_path)
 
bool CipEpathEqual (const CipOctet *const path1, const CipUint path1_length, const CipOctet *const path2, const CipUint path2_length)
 
const CipDword CipEpathGetLogicalValue (const EipUint8 **message)
 
LogicalSegmentLogicalFormat CipEpathGetNeededLogicalFormatForValue (CipDword value)
 
size_t CipEpathSetLogicalValue (const CipDword logical_value, const LogicalSegmentLogicalFormat logical_format, CipOctet **message)
 
void GetElectronicKeyFormat4FromMessage (const CipOctet **const message, ElectronicKeyFormat4 *key)
 Gets the data for an Electronic Key of format 4 from the EPath message. More...
 
CipUsint GetPathDataSegmentSimpleDataWordLength (const unsigned char *const cip_path)
 Returns the amount of 16-bit data words in the Simple Data EPath. More...
 
DataSegmentSubtype GetPathDataSegmentSubtype (const unsigned char *const cip_path)
 Gets the Data Segment subtype of a Data Segment EPath message. More...
 
ElectronicKeySegmentFormat GetPathLogicalSegmentElectronicKeyFormat (const unsigned char *const cip_path)
 Gets the Electronic Key format of a Logical Segment Special Type EPath message. More...
 
LogicalSegmentExtendedLogicalType GetPathLogicalSegmentExtendedLogicalType (const unsigned char *const cip_path)
 Gets the Extended Logical Type of a Logical Segment EPath message. More...
 
LogicalSegmentLogicalFormat GetPathLogicalSegmentLogicalFormat (const unsigned char *const cip_path)
 Gets the Logical Format of a Logical Segment EPath message. More...
 
LogicalSegmentLogicalType GetPathLogicalSegmentLogicalType (const unsigned char *const cip_path)
 Gets the Logical Type of an EPath Logical Segment message. More...
 
LogicalSegmentSpecialTypeLogicalFormat GetPathLogicalSegmentSpecialTypeLogicalType (const unsigned char *const cip_path)
 Gets the Special Type Logical Type of a Logical Segment EPath message. More...
 
CipUdint GetPathNetworkSegmentProductionInhibitTimeInMicroseconds (const unsigned char *const cip_path)
 Return the Production Inhibit Time in microseconds from an EPath. More...
 
CipUsint GetPathNetworkSegmentProductionInhibitTimeInMilliseconds (const unsigned char *const cip_path)
 Return the Production Inhibit Time in milliseconds from an EPath. More...
 
NetworkSegmentSubtype GetPathNetworkSegmentSubtype (const unsigned char *const cip_path)
 Return the Network Segment subtype. More...
 
bool GetPathPortSegmentExtendedLinkAddressSizeBit (const unsigned char *const cip_path)
 Only to be used on Port Segments. Returns if the Port Segment has the extended link address size bit set. More...
 
unsigned int GetPathPortSegmentExtendedPortNumber (const unsigned char *const cip_path)
 Only to be used on Port Segments with Extended Port Number. Gets the Extended Port Number. More...
 
unsigned int GetPathPortSegmentLinkAddressSize (const unsigned char *const cip_path)
 Only to be used on Port Segments. Gets the Link Address Size. More...
 
unsigned int GetPathPortSegmentPortIdentifier (const unsigned char *const cip_path)
 Only to be used on Port Segments. Returns the Port Identifier. More...
 
SegmentType GetPathSegmentType (const CipOctet *const cip_path)
 Gets the basic segment type of a CIP EPath. More...
 
unsigned int GetPathSymbolicSegmentASCIIFormatLength (const unsigned char *const cip_path)
 
SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat (const unsigned char *const cip_path)
 Gets the Extended Format subtype of a Symbolic Segment EPath message. More...
 
SymbolicSegmentFormat GetPathSymbolicSegmentFormat (const unsigned char *const cip_path)
 Gets the Symbolic Segment Format of the Symbolic Segment EPath message. More...
 
SymbolicSegmentExtendedFormat GetPathSymbolicSegmentNumericType (const unsigned char *const cip_path)
 Gets the Numeric subtype of a Symbolic Segment Extended Format EPath message. More...
 
void SetPathLogicalSegmentLogicalFormat (LogicalSegmentLogicalFormat format, CipOctet *const cip_path)
 
void SetPathLogicalSegmentLogicalType (LogicalSegmentLogicalType logical_type, CipOctet *const cip_path)
 
void SetPathPortSegmentExtendedPortIdentifier (const unsigned int extended_port_identifier, CipOctet *const cip_path)
 Sets the Extended Port Identifier in a EPath Port Segment message. More...
 
void SetPathPortSegmentPortIdentifier (const unsigned int port_identifier, unsigned char *const cip_path)
 Sets the Port Identifier form an Port Segment EPath to be sent. More...
 
void SetPathSegmentType (SegmentType segment_type, unsigned char *const cip_path)
 Sets the basic segment type of an CIP EPath to be sent. More...
 

Variables

const unsigned int kPortSegmentExtendedPort = 15
 

Macro Definition Documentation

#define DATA_SEGMENT_SUBTYPE_ANSI_EXTENDED_SYMBOL   0x11

Definition at line 71 of file cipepath.c.

Referenced by GetPathDataSegmentSubtype().

#define DATA_SEGMENT_SUBTYPE_SIMPLE_DATA   0x00

Definition at line 70 of file cipepath.c.

Referenced by GetPathDataSegmentSubtype().

#define ELECTRONIC_KEY_SEGMENT_KEY_FORMAT_4   0x04

Definition at line 51 of file cipepath.c.

Referenced by GetPathLogicalSegmentElectronicKeyFormat().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX   0x01

Definition at line 43 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX   0x03

Definition at line 45 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX   0x02

Definition at line 44 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX   0x04

Definition at line 46 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_RESERVED   0x00

Definition at line 42 of file cipepath.c.

#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE   0x06

Definition at line 48 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER   0x05

Definition at line 47 of file cipepath.c.

Referenced by GetPathLogicalSegmentExtendedLogicalType().

#define LOGICAL_SEGMENT_FORMAT_EIGHT_BIT   0x00
#define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT   0x01
#define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT   0x02
#define LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY   0x00

Definition at line 50 of file cipepath.c.

Referenced by GetPathLogicalSegmentSpecialTypeLogicalType().

#define LOGICAL_SEGMENT_TYPE_ATTRIBUTE_ID   0x10

Message value of the logical segment/logical type Attribute ID

Definition at line 33 of file cipepath.c.

Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_CLASS_ID   0x00

Message value of the logical segment/logical type Class ID

Definition at line 29 of file cipepath.c.

Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_CONNECTION_POINT   0x0C

Message value of the logical segment/logical type Connection Point

Definition at line 32 of file cipepath.c.

Referenced by GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL   0x1C

Message value of the logical segment/logical type Extended Logical

Definition at line 36 of file cipepath.c.

Referenced by GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_INSTANCE_ID   0x04

Message value of the logical segment/logical type Instance ID

Definition at line 30 of file cipepath.c.

Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_MEMBER_ID   0x08

Message value of the logical segment/logical type Member ID

Definition at line 31 of file cipepath.c.

Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_SERVICE_ID   0x18

Message value of the logical segment/logical type Service ID

Definition at line 35 of file cipepath.c.

Referenced by GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define LOGICAL_SEGMENT_TYPE_SPECIAL   0x14

Message value of the logical segment/logical type Special

Definition at line 34 of file cipepath.c.

Referenced by GetPathLogicalSegmentLogicalType(), and SetPathLogicalSegmentLogicalType().

#define NETWORK_SEGMENT_EXTENDED_NETWORK   0x1F

Definition at line 58 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define NETWORK_SEGMENT_FIXED_TAG   0x02

Definition at line 54 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MICROSECONDS   0x10

Definition at line 57 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MILLISECONDS   0x03

Definition at line 55 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define NETWORK_SEGMENT_SAFETY   0x04

Definition at line 56 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define NETWORK_SEGMENT_SCHEDULE   0x01

Definition at line 53 of file cipepath.c.

Referenced by GetPathNetworkSegmentSubtype().

#define SEGMENT_TYPE_DATA_SEGMENT   0x80

Message value of the Data segment

Definition at line 24 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_DATA_TYPE_CONSTRUCTED   0xA0

Message value of the Data type constructed

Definition at line 25 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_DATA_TYPE_ELEMENTARTY   0xC0

Message value of the Data type elementary

Definition at line 26 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_LOGICAL_SEGMENT   0x20

Message value of the Logical segment

Definition at line 21 of file cipepath.c.

Referenced by DecodePaddedEPath(), GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_NETWORK_SEGMENT   0x40

Message value of the Network segment

Definition at line 22 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_PORT_SEGMENT   0x00

Message value of the Port segment

Definition at line 20 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_SEGMENT_RESERVED   0xE0

Reserved value

Definition at line 27 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SEGMENT_TYPE_SYMBOLIC_SEGMENT   0x60

Message value of the Symbolic segment

Definition at line 23 of file cipepath.c.

Referenced by GetPathSegmentType(), and SetPathSegmentType().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_DOUBLE_CHAR   0x20

Definition at line 62 of file cipepath.c.

Referenced by GetPathSymbolicSegmentExtendedFormat().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC   0xC0

Definition at line 64 of file cipepath.c.

Referenced by GetPathSymbolicSegmentExtendedFormat().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UDINT_TYPE   0x08

Definition at line 68 of file cipepath.c.

Referenced by GetPathSymbolicSegmentNumericType().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UINT_TYPE   0x07

Definition at line 67 of file cipepath.c.

Referenced by GetPathSymbolicSegmentNumericType().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_USINT_TYPE   0x06

Definition at line 66 of file cipepath.c.

Referenced by GetPathSymbolicSegmentNumericType().

#define SYMBOLIC_SEGMENT_EXTENDED_FORMAT_TRIPLE_CHAR   0x40

Definition at line 63 of file cipepath.c.

Referenced by GetPathSymbolicSegmentExtendedFormat().

#define SYMBOLIC_SEGMENT_FORMAT_EXTENDED_STRING   0x00

Definition at line 60 of file cipepath.c.

Referenced by GetPathSymbolicSegmentFormat().

Function Documentation

size_t CipEpathEncodeConnectionEpath ( const CipConnectionPathEpath *const  connection_epath,
CipOctet **  encoded_path 
)
bool CipEpathEqual ( const CipOctet *const  path1,
const CipUint  path1_length,
const CipOctet *const  path2,
const CipUint  path2_length 
)

Definition at line 697 of file cipepath.c.

const CipDword CipEpathGetLogicalValue ( const EipUint8 **  message)

Definition at line 332 of file cipepath.c.

References GetDintFromMessage(), GetIntFromMessage(), GetPathLogicalSegmentLogicalFormat(), GetSintFromMessage(), kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, kLogicalSegmentLogicalFormatThirtyTwoBit, MoveMessageNOctets(), and OPENER_ASSERT.

Referenced by ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

LogicalSegmentLogicalFormat CipEpathGetNeededLogicalFormatForValue ( CipDword  value)

Definition at line 632 of file cipepath.c.

References kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, and kLogicalSegmentLogicalFormatThirtyTwoBit.

Referenced by CipEpathEncodeConnectionEpath().

Here is the caller graph for this function:

size_t CipEpathSetLogicalValue ( const CipDword  logical_value,
const LogicalSegmentLogicalFormat  logical_format,
CipOctet **  message 
)

Definition at line 356 of file cipepath.c.

References AddDintToMessage(), AddIntToMessage(), AddSintToMessage(), kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, kLogicalSegmentLogicalFormatThirtyTwoBit, MoveMessageNOctets(), and OPENER_ASSERT.

Referenced by CipEpathEncodeConnectionEpath().

Here is the call graph for this function:

Here is the caller graph for this function:

void GetElectronicKeyFormat4FromMessage ( const CipOctet **const  cip_path,
ElectronicKeyFormat4 key 
)

Gets the data for an Electronic Key of format 4 from the EPath message.

Parameters
cip_pathThe start of the EPath message
keyWrites the data on the user provided data electronic key struct

Definition at line 441 of file cipepath.c.

References ElectronicKeyFormat4SetDeviceType(), ElectronicKeyFormat4SetMajorRevisionCompatibility(), ElectronicKeyFormat4SetMinorRevision(), ElectronicKeyFormat4SetProductCode(), ElectronicKeyFormat4SetVendorId(), GetIntFromMessage(), GetPathLogicalSegmentElectronicKeyFormat(), GetSintFromMessage(), kElectronicKeySegmentFormatKeyFormat4, MoveMessageNOctets(), and OPENER_ASSERT.

Referenced by ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

CipUsint GetPathDataSegmentSimpleDataWordLength ( const unsigned char *const  cip_path)

Returns the amount of 16-bit data words in the Simple Data EPath.

Gets the data word length of a Simple Data segment.

Parameters
cip_pathPointer to the start of the EPath message
Returns
The amount of 16-bit words of data in the EPath

Definition at line 616 of file cipepath.c.

References GetPathDataSegmentSubtype(), GetPathSegmentType(), GetSintFromMessage(), kDataSegmentSubtypeSimpleData, kSegmentTypeDataSegment, and OPENER_ASSERT.

Here is the call graph for this function:

DataSegmentSubtype GetPathDataSegmentSubtype ( const unsigned char *const  cip_path)

Gets the Data Segment subtype of a Data Segment EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The Data Segment subtype

Definition at line 595 of file cipepath.c.

References DATA_SEGMENT_SUBTYPE_ANSI_EXTENDED_SYMBOL, DATA_SEGMENT_SUBTYPE_SIMPLE_DATA, kDataSegmentSubtypeANSIExtendedSymbol, kDataSegmentSubtypeReserved, and kDataSegmentSubtypeSimpleData.

Referenced by GetPathDataSegmentSimpleDataWordLength(), and ParseConnectionPath().

Here is the caller graph for this function:

ElectronicKeySegmentFormat GetPathLogicalSegmentElectronicKeyFormat ( const unsigned char *const  cip_path)

Gets the Electronic Key format of a Logical Segment Special Type EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The Electronic Key Format used in the EPath

Definition at line 426 of file cipepath.c.

References ELECTRONIC_KEY_SEGMENT_KEY_FORMAT_4, GetPathLogicalSegmentSpecialTypeLogicalType(), kElectronicKeySegmentFormatKeyFormat4, kElectronicKeySegmentFormatReserved, kLogicalSegmentSpecialTypeLogicalFormatElectronicKey, and OPENER_ASSERT.

Referenced by GetElectronicKeyFormat4FromMessage(), and ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

LogicalSegmentLogicalFormat GetPathLogicalSegmentLogicalFormat ( const unsigned char *const  cip_path)

Gets the Logical Format of a Logical Segment EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The logical format of the logical format

Definition at line 287 of file cipepath.c.

References GetPathSegmentType(), kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, kLogicalSegmentLogicalFormatThirtyTwoBit, kSegmentTypeLogicalSegment, LOGICAL_SEGMENT_FORMAT_EIGHT_BIT, LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT, LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT, and OPENER_ASSERT.

Referenced by CipEpathGetLogicalValue().

Here is the call graph for this function:

Here is the caller graph for this function:

LogicalSegmentLogicalType GetPathLogicalSegmentLogicalType ( const unsigned char *const  cip_path)

Gets the Logical Type of an EPath Logical Segment message.

Parameters
cip_pathThe start of the EPath message
Returns
The logical type of the logical segment

Definition at line 213 of file cipepath.c.

References GetPathSegmentType(), kLogicalSegmentLogicalTypeAttributeId, kLogicalSegmentLogicalTypeClassId, kLogicalSegmentLogicalTypeConnectionPoint, kLogicalSegmentLogicalTypeExtendedLogical, kLogicalSegmentLogicalTypeInstanceId, kLogicalSegmentLogicalTypeMemberId, kLogicalSegmentLogicalTypeServiceId, kLogicalSegmentLogicalTypeSpecial, kSegmentTypeLogicalSegment, LOGICAL_SEGMENT_TYPE_ATTRIBUTE_ID, LOGICAL_SEGMENT_TYPE_CLASS_ID, LOGICAL_SEGMENT_TYPE_CONNECTION_POINT, LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL, LOGICAL_SEGMENT_TYPE_INSTANCE_ID, LOGICAL_SEGMENT_TYPE_MEMBER_ID, LOGICAL_SEGMENT_TYPE_SERVICE_ID, LOGICAL_SEGMENT_TYPE_SPECIAL, and OPENER_ASSERT.

Referenced by GetPathLogicalSegmentExtendedLogicalType(), GetPathLogicalSegmentSpecialTypeLogicalType(), and ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

LogicalSegmentSpecialTypeLogicalFormat GetPathLogicalSegmentSpecialTypeLogicalType ( const unsigned char *const  cip_path)

Gets the Special Type Logical Type of a Logical Segment EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The Special Type Logical Format subtype of a Logical Segment EPath message

Definition at line 407 of file cipepath.c.

References GetPathLogicalSegmentLogicalType(), GetPathSegmentType(), kLogicalSegmentLogicalTypeSpecial, kLogicalSegmentSpecialTypeLogicalFormatElectronicKey, kLogicalSegmentSpecialTypeLogicalFormatReserved, kSegmentTypeLogicalSegment, LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY, and OPENER_ASSERT.

Referenced by GetPathLogicalSegmentElectronicKeyFormat(), and ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

CipUdint GetPathNetworkSegmentProductionInhibitTimeInMicroseconds ( const unsigned char *const  cip_path)

Return the Production Inhibit Time in microseconds from an EPath.

Gets the Production Inhibit Time in Microseconds.

Parameters
cip_pathPointer to the start of the EPath message
Returns
the Production Inhibit Time in microseconds ranging from 0 to 4294967295

Definition at line 514 of file cipepath.c.

References GetDintFromMessage(), GetPathNetworkSegmentSubtype(), GetPathSegmentType(), kNetworkSegmentSubtypeProductionInhibitTimeInMicroseconds, kSegmentTypeNetworkSegment, and OPENER_ASSERT.

Here is the call graph for this function:

CipUsint GetPathNetworkSegmentProductionInhibitTimeInMilliseconds ( const unsigned char *const  cip_path)

Return the Production Inhibit Time in milliseconds from an EPath.

Gets the Production Inhibit Time in Milliseconds.

Parameters
cip_pathPointer to the start of the EPath message
Returns
the Production Inhibit Time in milliseconds ranging from 0 to 255

Definition at line 497 of file cipepath.c.

References GetPathNetworkSegmentSubtype(), GetPathSegmentType(), kNetworkSegmentSubtypeProductionInhibitTimeInMilliseconds, kSegmentTypeNetworkSegment, and OPENER_ASSERT.

Here is the call graph for this function:

NetworkSegmentSubtype GetPathNetworkSegmentSubtype ( const unsigned char *const  cip_path)

Return the Network Segment subtype.

Gets the Network Segment Subtype of a EPatch Network Segement EPath message.

Parameters
cip_pathPointer to the start of the EPath message
Returns
The Network Segment subtype of the EPath

Definition at line 466 of file cipepath.c.

References GetPathSegmentType(), kNetworkSegmentSubtypeExtendedNetworkSegment, kNetworkSegmentSubtypeFixedTagSegment, kNetworkSegmentSubtypeProductionInhibitTimeInMicroseconds, kNetworkSegmentSubtypeProductionInhibitTimeInMilliseconds, kNetworkSegmentSubtypeReserved, kNetworkSegmentSubtypeSafetySegment, kNetworkSegmentSubtypeScheduleSegment, kSegmentTypeNetworkSegment, NETWORK_SEGMENT_EXTENDED_NETWORK, NETWORK_SEGMENT_FIXED_TAG, NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MICROSECONDS, NETWORK_SEGMENT_PRODUCTION_INHIBIT_TIME_IN_MILLISECONDS, NETWORK_SEGMENT_SAFETY, NETWORK_SEGMENT_SCHEDULE, and OPENER_ASSERT.

Referenced by GetPathNetworkSegmentProductionInhibitTimeInMicroseconds(), GetPathNetworkSegmentProductionInhibitTimeInMilliseconds(), and ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

bool GetPathPortSegmentExtendedLinkAddressSizeBit ( const unsigned char *const  cip_path)

Only to be used on Port Segments. Returns if the Port Segment has the extended link address size bit set.

Parameters
cip_pathThe start of the EPath message
Returns
True if extended link addres size bit set, false otherwise

Definition at line 148 of file cipepath.c.

Referenced by GetPathPortSegmentExtendedPortNumber(), GetPathPortSegmentLinkAddressSize(), and SetPathPortSegmentExtendedPortIdentifier().

Here is the caller graph for this function:

unsigned int GetPathPortSegmentExtendedPortNumber ( const unsigned char *const  cip_path)

Only to be used on Port Segments with Extended Port Number. Gets the Extended Port Number.

Parameters
cip_pathThe start of the EPath message
Returns
The Link Address Size

Definition at line 186 of file cipepath.c.

References GetPathPortSegmentExtendedLinkAddressSizeBit(), GetPathPortSegmentPortIdentifier(), kPortSegmentExtendedPort, and OPENER_ASSERT.

Here is the call graph for this function:

unsigned int GetPathPortSegmentLinkAddressSize ( const unsigned char *const  cip_path)

Only to be used on Port Segments. Gets the Link Address Size.

Parameters
cip_pathThe start of the EPath message
Returns
The Link Address Size

Definition at line 177 of file cipepath.c.

References GetPathPortSegmentExtendedLinkAddressSizeBit(), and OPENER_ASSERT.

Here is the call graph for this function:

unsigned int GetPathPortSegmentPortIdentifier ( const unsigned char *const  cip_path)

Only to be used on Port Segments. Returns the Port Identifier.

Parameters
cip_pathThe start of the EPath message
Returns
The Port Identifier

Definition at line 158 of file cipepath.c.

References GetPathSegmentType(), kSegmentTypePortSegment, and OPENER_ASSERT.

Referenced by GetPathPortSegmentExtendedPortNumber().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int GetPathSymbolicSegmentASCIIFormatLength ( const unsigned char *const  cip_path)

Definition at line 544 of file cipepath.c.

References OPENER_ASSERT.

SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat ( const unsigned char *const  cip_path)

Gets the Extended Format subtype of a Symbolic Segment EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
Symbolic Segment Extended Format

Definition at line 570 of file cipepath.c.

References GetPathSegmentType(), GetPathSymbolicSegmentFormat(), GetPathSymbolicSegmentNumericType(), kSegmentTypeSymbolicSegment, kSymbolicSegmentExtendedFormatDoubleByteChars, kSymbolicSegmentExtendedFormatReserved, kSymbolicSegmentExtendedFormatTripleByteChars, kSymbolicSegmentFormatExtendedString, OPENER_ASSERT, SYMBOLIC_SEGMENT_EXTENDED_FORMAT_DOUBLE_CHAR, SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC, and SYMBOLIC_SEGMENT_EXTENDED_FORMAT_TRIPLE_CHAR.

Here is the call graph for this function:

SymbolicSegmentFormat GetPathSymbolicSegmentFormat ( const unsigned char *const  cip_path)

Gets the Symbolic Segment Format of the Symbolic Segment EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The Symbolic Segment Format

Definition at line 534 of file cipepath.c.

References kSymbolicSegmentFormatASCII, kSymbolicSegmentFormatExtendedString, and SYMBOLIC_SEGMENT_FORMAT_EXTENDED_STRING.

Referenced by GetPathSymbolicSegmentExtendedFormat().

Here is the caller graph for this function:

SymbolicSegmentExtendedFormat GetPathSymbolicSegmentNumericType ( const unsigned char *const  cip_path)

Gets the Numeric subtype of a Symbolic Segment Extended Format EPath message.

Parameters
cip_pathThe start of the EPath message
Returns
The Numeric Extended Format subtype

Definition at line 552 of file cipepath.c.

References kSymbolicSegmentExtendedFormatNumericSymbolUDINT, kSymbolicSegmentExtendedFormatNumericSymbolUINT, kSymbolicSegmentExtendedFormatNumericSymbolUSINT, kSymbolicSegmentExtendedFormatReserved, SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UDINT_TYPE, SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_UINT_TYPE, and SYMBOLIC_SEGMENT_EXTENDED_FORMAT_NUMERIC_USINT_TYPE.

Referenced by GetPathSymbolicSegmentExtendedFormat().

Here is the caller graph for this function:

void SetPathLogicalSegmentLogicalFormat ( LogicalSegmentLogicalFormat  format,
CipOctet *const  cip_path 
)

Definition at line 311 of file cipepath.c.

References GetPathSegmentType(), kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, kLogicalSegmentLogicalFormatThirtyTwoBit, kSegmentTypeLogicalSegment, LOGICAL_SEGMENT_FORMAT_EIGHT_BIT, LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT, LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT, and OPENER_ASSERT.

Referenced by CipEpathEncodeConnectionEpath().

Here is the call graph for this function:

Here is the caller graph for this function:

void SetPathLogicalSegmentLogicalType ( LogicalSegmentLogicalType  logical_type,
CipOctet *const  cip_path 
)
void SetPathPortSegmentExtendedPortIdentifier ( const unsigned int  extended_port_identifier,
CipOctet *const  cip_path 
)

Sets the Extended Port Identifier in a EPath Port Segment message.

Parameters
extended_port_identifierThe extended port identifier to be encoded into the message
cip_pathThe start for the EPatch message

Definition at line 198 of file cipepath.c.

References GetPathPortSegmentExtendedLinkAddressSizeBit(), kPortSegmentExtendedPort, and SetPathPortSegmentPortIdentifier().

Here is the call graph for this function:

void SetPathPortSegmentPortIdentifier ( const unsigned int  port_identifier,
unsigned char *const  cip_path 
)

Sets the Port Identifier form an Port Segment EPath to be sent.

Parameters
port_identifierThe port identifier
cip_pathA message buffer - Will be written on!

Definition at line 168 of file cipepath.c.

References OPENER_ASSERT.

Referenced by SetPathPortSegmentExtendedPortIdentifier().

Here is the caller graph for this function:

void SetPathSegmentType ( SegmentType  segment_type,
unsigned char *const  cip_path 
)

Sets the basic segment type of an CIP EPath to be sent.

Parameters
segment_typeThe segment type
cip_pathA message buffer - Will be written on!

Definition at line 113 of file cipepath.c.

References kSegmentTypeDataSegment, kSegmentTypeDataTypeConstructed, kSegmentTypeDataTypeElementary, kSegmentTypeLogicalSegment, kSegmentTypeNetworkSegment, kSegmentTypePortSegment, kSegmentTypeReserved, kSegmentTypeSymbolicSegment, OPENER_ASSERT, SEGMENT_TYPE_DATA_SEGMENT, SEGMENT_TYPE_DATA_TYPE_CONSTRUCTED, SEGMENT_TYPE_DATA_TYPE_ELEMENTARTY, SEGMENT_TYPE_LOGICAL_SEGMENT, SEGMENT_TYPE_NETWORK_SEGMENT, SEGMENT_TYPE_PORT_SEGMENT, SEGMENT_TYPE_SEGMENT_RESERVED, and SEGMENT_TYPE_SYMBOLIC_SEGMENT.

Referenced by CipEpathEncodeConnectionEpath().

Here is the caller graph for this function:

Variable Documentation

const unsigned int kPortSegmentExtendedPort = 15

Reserved port segment port value, indicating the use of the extended port field

Definition at line 17 of file cipepath.c.

Referenced by GetPathPortSegmentExtendedPortNumber(), and SetPathPortSegmentExtendedPortIdentifier().