Crate powerlink_rs_xdc

Crate powerlink_rs_xdc 

Source
Expand description

Parses and generates POWERLINK XDC (XML Device Configuration) files.

This no_std + alloc library provides type-safe parsing and serialization for POWERLINK XDC (Configuration Manager) data based on the EPSG DS 311 specification.

It provides the following main capabilities:

  • Parsing: Loading .xdc or .xdd XML strings into strongly-typed Rust structures.
  • Resolution: Resolving complex inheritance, uniqueIDRef links, and templates defined in the Application Process.
  • Serialization: generating minimal valid XDC XML strings from Rust structures.
  • Core Integration: Converting the parsed data into the ObjectDictionary format required by the powerlink-rs core stack.

Structs§

AddInfo
Represents one <addInfo> element.
AllowedValues
Represents <allowedValues> for a parameter.
AppArray
Represents an <array> data type.
AppDerived
Represents a <derived> data type.
AppEnum
Represents an <enum> data type.
AppStruct
Represents a <struct> data type.
ApplicationProcess
Represents the <ApplicationProcess> block, defining application parameters and types.
Capabilities
Represents the <capabilities> element. (EPSG DS 311, 7.4.6.2)
Characteristic
Represents a single <characteristic>. (EPSG DS 311, 7.4.6.2.2.2)
CharacteristicList
Represents a <characteristicsList>, grouping characteristics by category. (EPSG DS 311, 7.4.6.2.2)
Classification
Represents a <classification> element. (EPSG DS 311, 7.4.6.7)
CnFeatures
Represents <CNFeatures>, specific to Controlled Nodes.
CombinedState
Represents a state composed of multiple LEDs (e.g., “Error Stop”).
ConnectedModule
Represents a <connectedModule> entry, linking a slot to a child module.
Connector
Represents a <connector> element. (EPSG DS 311, 7.4.6.5)
Count
Represents a <count> element within a derived type.
DeviceFunction
Represents the <DeviceFunction> block. (EPSG DS 311, 7.4.6)
DeviceManager
Represents the <DeviceManager> block.
Diagnostic
Represents <Diagnostic> capabilities.
Dictionary
Represents a <dictionary> element for external text resources. (EPSG DS 311, 7.4.6.4)
EnumValue
Represents a single <enumValue>.
ErrorDefinition
Represents one <Error> entry in the <ErrorList>.
Firmware
Represents a <firmware> element. (EPSG DS 311, 7.4.6.6)
FunctionInstance
Represents a <functionInstance>.
FunctionType
Represents a <functionType>.
GeneralFeatures
Represents <GeneralFeatures>.
Identity
Represents the <DeviceIdentity> block.
IndicatorList
Represents an <indicatorList> containing LED definitions.
InterfaceComm
Represents an <interface> in the Communication profile, mapping hardware interfaces to OD ranges.
InterfaceDevice
Represents an <interface> on a modular head (Device profile).
InterfaceList
Represents an <interfaceList>.
LED
Represents a single <LED> indicator.
LEDstate
Represents a single state for a specific <LED> (e.g., “flashing red”).
MnFeatures
Represents <MNFeatures>, specific to Managing Nodes.
ModuleInterface
Represents a <moduleInterface> (properties of a child module).
ModuleManagementComm
Represents the <moduleManagement> block from the Communication profile.
ModuleManagementDevice
Represents the <moduleManagement> block from the Device profile.
NetworkManagement
Represents the <NetworkManagement> block.
NmtSettings
Configuration settings for the NMT (Network Management) state machine, extracted from the XDC profile’s <NetworkManagement> block.
Object
Represents a single <Object> (an OD Index).
ObjectDictionary
Represents the complete <ObjectList> (Object Dictionary).
ParameterGroup
Represents a <parameterGroup>.
ParameterRef
Represents a reference to a parameter within a group.
Picture
Represents a <picture> element. (EPSG DS 311, 7.4.6.3)
ProfileHeader
Represents the <ProfileHeader> block, containing file metadata.
Range
Represents a <range> of OD indices for a modular interface.
StandardCompliance
Represents a <compliantWith> element describing standard compliance. (EPSG DS 311, 7.4.6.2.2.5)
StaticErrorBit
Represents one <ErrorBit> from the <StaticErrorBitField>.
StructMember
Represents a <varDeclaration> within a struct.
SubObject
Represents a <SubObject> (an OD Sub-Index).
Value
Represents a single <value>.
ValueRange
Represents a <range>.
VarDeclaration
Represents a <varDeclaration> in an interface list.
Version
Represents a <version> element.
VersionInfo
Represents a <versionInfo> element.
XdcFile
Represents a fully parsed and resolved XDC/XDD file.

Enums§

AppDataType
Enum representing user-defined data types from <dataTypeList>.
NmtCnDna
Public representation of the NMTCNDNA attribute (Dynamic Node Addressing).
ObjectPdoMapping
PDO mapping capabilities.
ParameterAccess
Access types for an Object Dictionary entry.
ParameterGroupItem
An item inside a <parameterGroup>.
ParameterSupport
Support level for an Object Dictionary entry.
XdcError
Errors that can occur during XDC parsing, validation, or serialization.

Functions§

extract_nmt_settings
Extracts NMT configuration settings from the parsed XDC file.
load_xdc_from_str
Loads XDC data from an XML string, prioritizing actualValue attributes.
load_xdd_defaults_from_str
Loads XDD data from an XML string, prioritizing defaultValue attributes.
save_xdc_to_string
Serializes an XdcFile data structure into a standard XDC XML string.
to_core_od
Converts a parsed XdcFile into the runtime ObjectDictionary.
xdc_to_storage_map
Extracts storable parameters from the XDC file into a flat map.