OpENer - Open Source EtherNet/IP(TM) I/O Target Stack
2.1
|
#include <stdbool.h>
#include <stdlib.h>
#include "cipepath.h"
#include "endianconv.h"
#include "cipelectronickey.h"
#include "trace.h"
#include <assert.h>
Go to the source code of this file.
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 |
#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 |
Definition at line 38 of file cipepath.c.
Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalFormat(), and SetPathLogicalSegmentLogicalFormat().
#define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT 0x01 |
Definition at line 39 of file cipepath.c.
Referenced by DecodePaddedEPath(), GetPathLogicalSegmentLogicalFormat(), and SetPathLogicalSegmentLogicalFormat().
#define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT 0x02 |
Definition at line 40 of file cipepath.c.
Referenced by GetPathLogicalSegmentLogicalFormat(), and SetPathLogicalSegmentLogicalFormat().
#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().
size_t CipEpathEncodeConnectionEpath | ( | const CipConnectionPathEpath *const | connection_epath, |
CipOctet ** | encoded_path | ||
) |
Definition at line 645 of file cipepath.c.
References connection_path_epath::attribute_id_or_connection_point, CipEpathGetNeededLogicalFormatForValue(), CipEpathSetLogicalValue(), connection_path_epath::class_id, connection_path_epath::instance_id, kLogicalSegmentLogicalTypeClassId, kSegmentTypeLogicalSegment, MoveMessageNOctets(), SetPathLogicalSegmentLogicalFormat(), SetPathLogicalSegmentLogicalType(), and SetPathSegmentType().
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.
Definition at line 332 of file cipepath.c.
References GetDintFromMessage(), GetIntFromMessage(), GetPathLogicalSegmentLogicalFormat(), GetSintFromMessage(), kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, kLogicalSegmentLogicalFormatThirtyTwoBit, MoveMessageNOctets(), and OPENER_ASSERT.
Referenced by ParseConnectionPath().
LogicalSegmentLogicalFormat CipEpathGetNeededLogicalFormatForValue | ( | CipDword | value | ) |
Definition at line 632 of file cipepath.c.
References kLogicalSegmentLogicalFormatEightBit, kLogicalSegmentLogicalFormatSixteenBit, and kLogicalSegmentLogicalFormatThirtyTwoBit.
Referenced by CipEpathEncodeConnectionEpath().
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().
void GetElectronicKeyFormat4FromMessage | ( | const CipOctet **const | cip_path, |
ElectronicKeyFormat4 * | key | ||
) |
Gets the data for an Electronic Key of format 4 from the EPath message.
cip_path | The start of the EPath message |
key | Writes 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().
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.
cip_path | Pointer to the start of the EPath message |
Definition at line 616 of file cipepath.c.
References GetPathDataSegmentSubtype(), GetPathSegmentType(), GetSintFromMessage(), kDataSegmentSubtypeSimpleData, kSegmentTypeDataSegment, and OPENER_ASSERT.
DataSegmentSubtype GetPathDataSegmentSubtype | ( | const unsigned char *const | cip_path | ) |
Gets the Data Segment subtype of a Data Segment EPath message.
cip_path | The start of the EPath message |
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().
ElectronicKeySegmentFormat GetPathLogicalSegmentElectronicKeyFormat | ( | const unsigned char *const | cip_path | ) |
Gets the Electronic Key format of a Logical Segment Special Type EPath message.
cip_path | The start of the EPath message |
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().
LogicalSegmentExtendedLogicalType GetPathLogicalSegmentExtendedLogicalType | ( | const unsigned char *const | cip_path | ) |
Gets the Extended Logical Type of a Logical Segment EPath message.
cip_path | The start of the EPath message |
Definition at line 379 of file cipepath.c.
References GetPathLogicalSegmentLogicalType(), kLogicalSegmentExtendedLogicalTypeArrayIndex, kLogicalSegmentExtendedLogicalTypeBitIndex, kLogicalSegmentExtendedLogicalTypeIndirectArrayIndex, kLogicalSegmentExtendedLogicalTypeIndirectBitIndex, kLogicalSegmentExtendedLogicalTypeReserved, kLogicalSegmentExtendedLogicalTypeStructureMemberHandle, kLogicalSegmentExtendedLogicalTypeStructureMemberNumber, kLogicalSegmentLogicalTypeExtendedLogical, LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX, LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX, LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX, LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX, LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE, LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER, and OPENER_ASSERT.
LogicalSegmentLogicalFormat GetPathLogicalSegmentLogicalFormat | ( | const unsigned char *const | cip_path | ) |
Gets the Logical Format of a Logical Segment EPath message.
cip_path | The start of the EPath message |
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().
LogicalSegmentLogicalType GetPathLogicalSegmentLogicalType | ( | const unsigned char *const | cip_path | ) |
Gets the Logical Type of an EPath Logical Segment message.
cip_path | The start of the EPath message |
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().
LogicalSegmentSpecialTypeLogicalFormat GetPathLogicalSegmentSpecialTypeLogicalType | ( | const unsigned char *const | cip_path | ) |
Gets the Special Type Logical Type of a Logical Segment EPath message.
cip_path | The start of the 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().
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.
cip_path | Pointer to the start of the EPath message |
Definition at line 514 of file cipepath.c.
References GetDintFromMessage(), GetPathNetworkSegmentSubtype(), GetPathSegmentType(), kNetworkSegmentSubtypeProductionInhibitTimeInMicroseconds, kSegmentTypeNetworkSegment, and OPENER_ASSERT.
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.
cip_path | Pointer to the start of the EPath message |
Definition at line 497 of file cipepath.c.
References GetPathNetworkSegmentSubtype(), GetPathSegmentType(), kNetworkSegmentSubtypeProductionInhibitTimeInMilliseconds, kSegmentTypeNetworkSegment, and OPENER_ASSERT.
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.
cip_path | Pointer to the start of the EPath message |
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().
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.
cip_path | The start of the EPath message |
Definition at line 148 of file cipepath.c.
Referenced by GetPathPortSegmentExtendedPortNumber(), GetPathPortSegmentLinkAddressSize(), and SetPathPortSegmentExtendedPortIdentifier().
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.
cip_path | The start of the EPath message |
Definition at line 186 of file cipepath.c.
References GetPathPortSegmentExtendedLinkAddressSizeBit(), GetPathPortSegmentPortIdentifier(), kPortSegmentExtendedPort, and OPENER_ASSERT.
unsigned int GetPathPortSegmentLinkAddressSize | ( | const unsigned char *const | cip_path | ) |
Only to be used on Port Segments. Gets the Link Address Size.
cip_path | The start of the EPath message |
Definition at line 177 of file cipepath.c.
References GetPathPortSegmentExtendedLinkAddressSizeBit(), and OPENER_ASSERT.
unsigned int GetPathPortSegmentPortIdentifier | ( | const unsigned char *const | cip_path | ) |
Only to be used on Port Segments. Returns the Port Identifier.
cip_path | The start of the EPath message |
Definition at line 158 of file cipepath.c.
References GetPathSegmentType(), kSegmentTypePortSegment, and OPENER_ASSERT.
Referenced by GetPathPortSegmentExtendedPortNumber().
SegmentType GetPathSegmentType | ( | const CipOctet *const | cip_path | ) |
Gets the basic segment type of a CIP EPath.
cip_path | The start of the EPath message |
Definition at line 76 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 GetPathDataSegmentSimpleDataWordLength(), GetPathLogicalSegmentLogicalFormat(), GetPathLogicalSegmentLogicalType(), GetPathLogicalSegmentSpecialTypeLogicalType(), GetPathNetworkSegmentProductionInhibitTimeInMicroseconds(), GetPathNetworkSegmentProductionInhibitTimeInMilliseconds(), GetPathNetworkSegmentSubtype(), GetPathPortSegmentPortIdentifier(), GetPathSymbolicSegmentExtendedFormat(), ParseConnectionPath(), SetPathLogicalSegmentLogicalFormat(), and SetPathLogicalSegmentLogicalType().
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.
cip_path | The start of the EPath message |
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.
SymbolicSegmentFormat GetPathSymbolicSegmentFormat | ( | const unsigned char *const | cip_path | ) |
Gets the Symbolic Segment Format of the Symbolic Segment EPath message.
cip_path | The start of the EPath message |
Definition at line 534 of file cipepath.c.
References kSymbolicSegmentFormatASCII, kSymbolicSegmentFormatExtendedString, and SYMBOLIC_SEGMENT_FORMAT_EXTENDED_STRING.
Referenced by GetPathSymbolicSegmentExtendedFormat().
SymbolicSegmentExtendedFormat GetPathSymbolicSegmentNumericType | ( | const unsigned char *const | cip_path | ) |
Gets the Numeric subtype of a Symbolic Segment Extended Format EPath message.
cip_path | The start of the EPath message |
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().
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().
void SetPathLogicalSegmentLogicalType | ( | LogicalSegmentLogicalType | logical_type, |
CipOctet *const | cip_path | ||
) |
Definition at line 252 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 CipEpathEncodeConnectionEpath().
void SetPathPortSegmentExtendedPortIdentifier | ( | const unsigned int | extended_port_identifier, |
CipOctet *const | cip_path | ||
) |
Sets the Extended Port Identifier in a EPath Port Segment message.
extended_port_identifier | The extended port identifier to be encoded into the message |
cip_path | The start for the EPatch message |
Definition at line 198 of file cipepath.c.
References GetPathPortSegmentExtendedLinkAddressSizeBit(), kPortSegmentExtendedPort, and SetPathPortSegmentPortIdentifier().
void SetPathPortSegmentPortIdentifier | ( | const unsigned int | port_identifier, |
unsigned char *const | cip_path | ||
) |
Sets the Port Identifier form an Port Segment EPath to be sent.
port_identifier | The port identifier |
cip_path | A message buffer - Will be written on! |
Definition at line 168 of file cipepath.c.
References OPENER_ASSERT.
Referenced by SetPathPortSegmentExtendedPortIdentifier().
void SetPathSegmentType | ( | SegmentType | segment_type, |
unsigned char *const | cip_path | ||
) |
Sets the basic segment type of an CIP EPath to be sent.
segment_type | The segment type |
cip_path | A 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().
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().