|
@@ -30,19 +30,19 @@
|
|
|
#define LOGICAL_SEGMENT_TYPE_SERVICE_ID_MESSAGE_VALUE 0x18 /**< Message value of the logical segment/logical type Service ID */
|
|
#define LOGICAL_SEGMENT_TYPE_SERVICE_ID_MESSAGE_VALUE 0x18 /**< Message value of the logical segment/logical type Service ID */
|
|
|
#define LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL_MESSAGE_VALUE 0x1C /**< Message value of the logical segment/logical type Extended Logical */
|
|
#define LOGICAL_SEGMENT_TYPE_EXTENDED_LOGICAL_MESSAGE_VALUE 0x1C /**< Message value of the logical segment/logical type Extended Logical */
|
|
|
|
|
|
|
|
-#define LOGICAL_SEGMENT_FORMAT_EIGHT_BIT_MESSAGE_VALUE 0x00
|
|
|
|
|
-#define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT_MESSAGE_VALUE 0x01
|
|
|
|
|
-#define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT_MESSAGE_VALUE 0x02
|
|
|
|
|
|
|
+#define LOGICAL_SEGMENT_FORMAT_EIGHT_BIT_MESSAGE_VALUE 0x00 /**< Message value indicating an 8 bit value */
|
|
|
|
|
+#define LOGICAL_SEGMENT_FORMAT_SIXTEEN_BIT_MESSAGE_VALUE 0x01 /**< Message value indicating an 16 bit value */
|
|
|
|
|
+#define LOGICAL_SEGMENT_FORMAT_THIRTY_TWO_BIT_MESSAGE_VALUE 0x02 /**< Message value indicating an 32 bit value */
|
|
|
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_RESERVED_MESSAGE_VALUE 0x00
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX_MESSAGE_VALUE 0x01
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX_MESSAGE_VALUE 0x02
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX_MESSAGE_VALUE 0x03
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX_MESSAGE_VALUE 0x04
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER_MESSAGE_VALUE 0x05
|
|
|
|
|
-#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE_MESSAGE_VALUE 0x06
|
|
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_RESERVED_MESSAGE_VALUE 0x00 /**< Message value indicating an reserved/unused Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_ARRAY_INDEX_MESSAGE_VALUE 0x01 /**< Message value indicating the Array Index Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_ARRAY_INDEX_MESSAGE_VALUE 0x02 /**< Message value indicating the Indirect Array Index Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_BIT_INDEX_MESSAGE_VALUE 0x03 /**< Message value indicating the Bit Index Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_INDIRECT_BIT_INDEX_MESSAGE_VALUE 0x04 /**< Message value indicating the Indirect Bit Index Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_NUMBER_MESSAGE_VALUE 0x05 /**< Message value indicating the Structured Member Number Extended Logical Segment type */
|
|
|
|
|
+#define LOGICAL_SEGMENT_EXTENDED_TYPE_STRUCTURE_MEMBER_HANDLE_MESSAGE_VALUE 0x06 /**< Message value indicating the Structured Member Handler Extended Logical Segment type */
|
|
|
|
|
|
|
|
-#define LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY_MESSAGE_VALUE 0x00
|
|
|
|
|
|
|
+#define LOGICAL_SEGMENT_SPECIAL_TYPE_FORMAT_ELECTRONIC_KEY_MESSAGE_VALUE 0x00 /**< Message value indicating an electronic key */
|
|
|
|
|
|
|
|
#define NETWORK_SEGMENT_SUBTYPE_SCHEDULE_MESSAGE_VALUE 0x01
|
|
#define NETWORK_SEGMENT_SUBTYPE_SCHEDULE_MESSAGE_VALUE 0x01
|
|
|
#define NETWORK_SEGMENT_SUBTYPE_FIXED_TAG_MESSAGE_VALUE 0x02
|
|
#define NETWORK_SEGMENT_SUBTYPE_FIXED_TAG_MESSAGE_VALUE 0x02
|
|
@@ -61,23 +61,23 @@ typedef enum network_segment_subtype {
|
|
|
kNetworkSegmentSubtypeExtendedNetworkSegment
|
|
kNetworkSegmentSubtypeExtendedNetworkSegment
|
|
|
} NetworkSegmentSubtype;
|
|
} NetworkSegmentSubtype;
|
|
|
|
|
|
|
|
-typedef enum {
|
|
|
|
|
|
|
+typedef enum electronic_key_segment_format {
|
|
|
kElectronicKeySegmentFormatReserved,
|
|
kElectronicKeySegmentFormatReserved,
|
|
|
kElectronicKeySegmentFormatKeyFormat4
|
|
kElectronicKeySegmentFormatKeyFormat4
|
|
|
} ElectronicKeySegmentFormat;
|
|
} ElectronicKeySegmentFormat;
|
|
|
|
|
|
|
|
-typedef enum {
|
|
|
|
|
|
|
+typedef enum data_segment_subtype {
|
|
|
kDataSegmentSubtypeReserved,
|
|
kDataSegmentSubtypeReserved,
|
|
|
kDataSegmentSubtypeSimpleData,
|
|
kDataSegmentSubtypeSimpleData,
|
|
|
kDataSegmentSubtypeANSIExtendedSymbol
|
|
kDataSegmentSubtypeANSIExtendedSymbol
|
|
|
} DataSegmentSubtype;
|
|
} DataSegmentSubtype;
|
|
|
|
|
|
|
|
-typedef enum {
|
|
|
|
|
|
|
+typedef enum symbolic_segment_format {
|
|
|
kSymbolicSegmentFormatASCII,
|
|
kSymbolicSegmentFormatASCII,
|
|
|
kSymbolicSegmentFormatExtendedString
|
|
kSymbolicSegmentFormatExtendedString
|
|
|
} SymbolicSegmentFormat;
|
|
} SymbolicSegmentFormat;
|
|
|
|
|
|
|
|
-typedef enum {
|
|
|
|
|
|
|
+typedef enum symbolic_segment_extended_format {
|
|
|
kSymbolicSegmentExtendedFormatDoubleByteChars,
|
|
kSymbolicSegmentExtendedFormatDoubleByteChars,
|
|
|
kSymbolicSegmentExtendedFormatTripleByteChars,
|
|
kSymbolicSegmentExtendedFormatTripleByteChars,
|
|
|
kSymbolicSegmentExtendedFormatNumericSymbolUSINT,
|
|
kSymbolicSegmentExtendedFormatNumericSymbolUSINT,
|
|
@@ -86,19 +86,58 @@ typedef enum {
|
|
|
kSymbolicSegmentExtendedFormatReserved
|
|
kSymbolicSegmentExtendedFormatReserved
|
|
|
} SymbolicSegmentExtendedFormat;
|
|
} SymbolicSegmentExtendedFormat;
|
|
|
|
|
|
|
|
|
|
+/** @brief Gets the basic segment type of a CIP EPath
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cip_path The start of the EPath message
|
|
|
|
|
+ * @return The basic segment type
|
|
|
|
|
+ */
|
|
|
SegmentType GetPathSegmentType(const unsigned char *const cip_path);
|
|
SegmentType GetPathSegmentType(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/** @brief Sets the basic segment type of an CIP EPath to be sent
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param segment_type The segment type
|
|
|
|
|
+ * @param cip_path A message buffer - Will be written on!
|
|
|
|
|
+ */
|
|
|
void SetPathSegmentType(SegmentType segment_type, unsigned char *const cip_path);
|
|
void SetPathSegmentType(SegmentType segment_type, unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/*********************************************************
|
|
|
|
|
+ * Port Segment functions
|
|
|
|
|
+ *********************************************************/
|
|
|
|
|
+
|
|
|
|
|
+/** @brief Only to be used on Port Segments. Returns if the Port Segment has the extended link address size bit set
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cip_path The start of the EPath message
|
|
|
|
|
+ * @return True if extended link addres size bit set, false otherwise
|
|
|
|
|
+ */
|
|
|
bool GetPathPortSegmentExtendedLinkAddressSizeBit(const unsigned char *const cip_path);
|
|
bool GetPathPortSegmentExtendedLinkAddressSizeBit(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/** @brief Only to be used on Port Segments. Returns the Port Identifier
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cip_path The start of the EPath message
|
|
|
|
|
+ * @return The Port Identifier
|
|
|
|
|
+ */
|
|
|
unsigned int GetPathPortSegmentPortIdentifier(const unsigned char *const cip_path);
|
|
unsigned int GetPathPortSegmentPortIdentifier(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/** @brief Sets the Port Identifier form an Port Segment EPath to be sent.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param port_identifier The port identifier
|
|
|
|
|
+ * @param cip_path A message buffer - Will be written on!
|
|
|
|
|
+ */
|
|
|
void SetPathPortSegmentPortIdentifier(const unsigned int port_identifier,
|
|
void SetPathPortSegmentPortIdentifier(const unsigned int port_identifier,
|
|
|
unsigned char *const cip_path);
|
|
unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/** @brief Only to be used on Port Segments. Gets the Link Address Size
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cip_path The start of the EPath message
|
|
|
|
|
+ * @return The Link Address Size
|
|
|
|
|
+ */
|
|
|
unsigned int GetPathPortSegmentLinkAddressSize(const unsigned char *const cip_path);
|
|
unsigned int GetPathPortSegmentLinkAddressSize(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+/** @brief Only to be used on Port Segments with Extended Port Number. Gets the Extended Port Number
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cip_path The start of the EPath message
|
|
|
|
|
+ * @return The Link Address Size
|
|
|
|
|
+ */
|
|
|
unsigned int GetPathPortSegmentExtendedPortNumber(const unsigned char *const cip_path);
|
|
unsigned int GetPathPortSegmentExtendedPortNumber(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
void SetPathPortSegmentExtendedPortIdentifier(
|
|
void SetPathPortSegmentExtendedPortIdentifier(
|
|
@@ -129,4 +168,8 @@ CipUsint GetPathDataSegmentSimpleDataWordLength(const unsigned char *const cip_p
|
|
|
|
|
|
|
|
SymbolicSegmentFormat GetPathSymbolicSegmentFormat(const unsigned char *const cip_path);
|
|
SymbolicSegmentFormat GetPathSymbolicSegmentFormat(const unsigned char *const cip_path);
|
|
|
|
|
|
|
|
|
|
+SymbolicSegmentExtendedFormat GetPathSymbolicSegmentNumericType(const unsigned char *const cip_path);
|
|
|
|
|
+
|
|
|
|
|
+SymbolicSegmentExtendedFormat GetPathSymbolicSegmentExtendedFormat(const unsigned char *const cip_path);
|
|
|
|
|
+
|
|
|
#endif /* SRC_CIP_CIPEPATH_H_ */
|
|
#endif /* SRC_CIP_CIPEPATH_H_ */
|