7 #ifndef SRC_CIP_CIPEPATH_H_
8 #define SRC_CIP_CIPEPATH_H_
15 #define SEGMENT_TYPE_PORT_SEGMENT 0x00
16 #define SEGMENT_TYPE_LOGICAL_SEGMENT 0x20
17 #define SEGMENT_TYPE_NETWORK_SEGMENT 0x40
18 #define SEGMENT_TYPE_SYMBOLIC_SEGMENT 0x60
19 #define SEGMENT_TYPE_DATA_SEGMENT 0x80
20 #define SEGMENT_TYPE_DATA_TYPE_CONSTRUCTED 0xA0
21 #define SEGMENT_TYPE_DATA_TYPE_ELEMENTARTY 0xC0
22 #define SEGMENT_TYPE_SEGMENT_RESERVED 0xE0
24 #define LOGICAL_SEGMENT_TYPE_CLASS_ID 0x00
25 #define LOGICAL_SEGMENT_TYPE_INSTANCE_ID 0x04
26 #define LOGICAL_SEGMENT_TYPE_MEMBER_ID 0x08
27 #define LOGICAL_SEGMENT_TYPE_CONNECTION_POINT 0x0C
28 #define LOGICAL_SEGMENT_TYPE_ATTRIBUTE_ID 0x10
29 #define LOGICAL_SEGMENT_TYPE_SPECIAL 0x14
30 #define LOGICAL_SEGMENT_TYPE_SERVICE_ID 0x18
31 #define LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL 0x1C
33 #define LOGICAL_SEGMENT_FORMAT_EIGHT_BIT 0x00
34 #define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT 0x01
35 #define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT 0x02
37 #define LOGICAL_SEGMENT_EXTENDED_TYPE_RESERVED 0x00
38 #define LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX 0x01
39 #define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX 0x02
40 #define LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX 0x03
41 #define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX 0x04
42 #define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER 0x05
43 #define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE 0x06
45 #define LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY 0x00
47 #define NETWORK_SEGMENT_SUBTYPE_SCHEDULE 0x01
48 #define NETWORK_SEGMENT_SUBTYPE_FIXED_TAG 0x02
49 #define NETWORK_SEGMENT_SUBTYPE_PRODUCTION_INHIBIT_TIME_IN_MILLISECONDS 0x03
50 #define NETWORK_SEGMENT_SUBTYPE_SAFETY 0x04
51 #define NETWORK_SEGMENT_SUBTYPE_PRODUCTION_INHIBIT_TIME_IN_MICROSECONDS 0x10
52 #define NETWORK_SEGMENT_SUBTYPE_EXTENDED_NETWORK 0x1F
59 typedef enum segment_type {
183 unsigned char *
const cip_path);
195 const unsigned char *
const cip_path);
203 const unsigned char *
const cip_path);
211 unsigned char *
const cip_path);
219 const unsigned char *
const cip_path);
227 const unsigned char *
const cip_path);
235 const unsigned int extended_port_identifier,
244 const unsigned char *
const cip_path);
255 const unsigned char *
const cip_path);
272 const unsigned char *
const cip_path);
281 const unsigned char *
const cip_path);
289 const unsigned char *
const cip_path);
306 const unsigned char *
const cip_path);
314 const unsigned char *
const cip_path);
322 const unsigned char *
const cip_path);
330 const unsigned char *
const cip_path);
338 const unsigned char *
const cip_path);
346 const unsigned char *
const cip_path);
354 const unsigned char *
const cip_path);
362 const unsigned char *
const cip_path);
LogicalSegmentExtendedLogicalType GetPathLogicalSegmentExtendedLogicalType(const unsigned char *const cip_path)
Gets the Extended Logical Type of a Logical Segment EPath message.
logical_segment_extended_logical_type
LogicalSegmentLogicalType GetPathLogicalSegmentLogicalType(const unsigned char *const cip_path)
Gets the Logical Type of an EPath Logical Segment message.
enum port_segment_type PortSegmentFlag
Port Segment flags.
network_segment_subtype
All types of network segment types for the use in all code.
SymbolicSegmentFormat GetPathSymbolicSegmentFormat(const unsigned char *const cip_path)
Gets the Symbolic Segment Format of the Symbolic Segment EPath message.
size_t CipEpathSetLogicalValue(const CipDword logical_value, const LogicalSegmentLogicalFormat logical_format, CipOctet **message)
CipUdint GetPathNetworkSegmentProductionInhibitTimeInMicroseconds(const unsigned char *const cip_path)
Gets the Production Inhibit Time in Microseconds.
symbolic_segment_extended_format
Extended symbolic symbol formats.
logical_segment_special_type_logical_format
ElectronicKeySegmentFormat GetPathLogicalSegmentElectronicKeyFormat(const unsigned char *const cip_path)
Gets the Electronic Key format of a Logical Segment Special Type EPath message.
LogicalSegmentLogicalFormat GetPathLogicalSegmentLogicalFormat(const unsigned char *const cip_path)
Gets the Logical Format of a Logical Segment EPath message.
CipDword attribute_id_or_connection_point
struct connection_path_epath CipConnectionPathEpath
void SetPathSegmentType(SegmentType segment_type, unsigned char *const cip_path)
Sets the basic segment type of an CIP EPath to be sent.
enum data_segment_subtype DataSegmentSubtype
Data segment sub types.
CipUsint GetPathNetworkSegmentProductionInhibitTimeInMilliseconds(const unsigned char *const cip_path)
Gets the Production Inhibit Time in Milliseconds.
symbolic_segment_format
Symbolic segment formats.
enum logical_segment_extended_logical_type LogicalSegmentExtendedLogicalType
SegmentType GetPathSegmentType(const CipOctet *const cip_path)
Gets the basic segment type of a CIP EPath.
uint8_t CipOctet
Data types as defined in the CIP Specification Vol 1 Appendix C.
unsigned int GetPathPortSegmentPortIdentifier(const unsigned char *const cip_path)
Only to be used on Port Segments. Returns the Port Identifier.
enum network_segment_subtype NetworkSegmentSubtype
All types of network segment types for the use in all code.
size_t CipEpathEncodeConnectionEpath(const CipConnectionPathEpath *const connection_epath, CipOctet **encoded_path)
void SetPathPortSegmentExtendedPortIdentifier(const unsigned int extended_port_identifier, CipOctet *const cip_path)
Sets the Extended Port Identifier in a EPath Port Segment message.
port_segment_type
Port Segment flags.
enum logical_segment_logical_format LogicalSegmentLogicalFormat
Enum containing values how long the encoded value will be (8, 16, or 32 bit)
enum segment_type SegmentType
Segment type Enum.
void SetPathPortSegmentPortIdentifier(const unsigned int port_identifier, unsigned char *const cip_path)
Sets the Port Identifier form an Port Segment EPath to be sent.
logical_segment_logical_format
Enum containing values how long the encoded value will be (8, 16, or 32 bit)
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 ...
SymbolicSegmentExtendedFormat GetPathSymbolicSegmentNumericType(const unsigned char *const cip_path)
Gets the Numeric subtype of a Symbolic Segment Extended Format EPath message.
CipUsint GetPathDataSegmentSimpleDataWordLength(const unsigned char *const cip_path)
Gets the data word length of a Simple Data segment.
void SetPathLogicalSegmentLogicalFormat(LogicalSegmentLogicalFormat format, CipOctet *const cip_path)
const CipDword CipEpathGetLogicalValue(const EipUint8 **message)
DataSegmentSubtype GetPathDataSegmentSubtype(const unsigned char *const cip_path)
Gets the Data Segment subtype of a Data Segment EPath message.
bool CipEpathEqual(const CipOctet *const path1, const CipUint path1_length, const CipOctet *const path2, const CipUint path2_length)
enum symbolic_segment_format SymbolicSegmentFormat
Symbolic segment formats.
SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat(const unsigned char *const cip_path)
Gets the Extended Format subtype of a Symbolic Segment EPath message.
data_segment_subtype
Data segment sub types.
logical_segment_type
Enum containing values which kind of logical segment is encoded.
enum electronic_key_segment_format ElectronicKeySegmentFormat
Electronic key formats.
electronic_key_segment_format
Electronic key formats.
void SetPathLogicalSegmentLogicalType(LogicalSegmentLogicalType logical_type, CipOctet *const cip_path)
NetworkSegmentSubtype GetPathNetworkSegmentSubtype(const unsigned char *const cip_path)
Gets the Network Segment Subtype of a EPatch Network Segement EPath message.
LogicalSegmentSpecialTypeLogicalFormat GetPathLogicalSegmentSpecialTypeLogicalType(const unsigned char *const cip_path)
Gets the Special Type Logical Type of a Logical Segment EPath message.
unsigned int GetPathPortSegmentLinkAddressSize(const unsigned char *const cip_path)
Only to be used on Port Segments. Gets the Link Address Size.
segment_type
Segment type Enum.
enum symbolic_segment_extended_format SymbolicSegmentExtendedFormat
Extended symbolic symbol formats.
void GetElectronicKeyFormat4FromMessage(const CipOctet **const cip_path, ElectronicKeyFormat4 *key)
Gets the data for an Electronic Key of format 4 from the EPath message.
enum logical_segment_type LogicalSegmentLogicalType
Enum containing values which kind of logical segment is encoded.
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...
enum logical_segment_special_type_logical_format LogicalSegmentSpecialTypeLogicalFormat