ecdev::IDeviceProfile
Device-class behaviour plugged onto a [GenericEniDevice]. More...
#include <device_profile.hpp>
Inherits from IDeviceLifecycle
Inherited by ecdev::CiA402DriveProfile, ecdev::CiA406EncoderProfile, ecdev::GenericIoProfile
Public Functions
| Name | |
|---|---|
| ~IDeviceProfile() override =default | |
| virtual void | writeOutputs(ProcessImage & image, std::uint64_t cycle_count) |
| virtual void | resolveTopology(const ProcessImage & image) Resolve the static channel/PDO topology from the ENI-derived process image. |
| virtual void | readInputs(const ProcessImage & image, bool wkc_valid, bool operational) |
| virtual const char * | profileName() const =0 Stable identifier for diagnostics (e.g. |
| virtual void | primeOutputs(ProcessImage & image) |
| virtual std::string | prepareSafeOp(ISlaveServices & svc, ProcessImage & image) |
| virtual std::string | configurePreOp(ISlaveServices & svc, ProcessImage & image) |
| virtual void | captureExitDiagnostics(ISlaveServices & svc) End-of-run, after the RT thread has joined; safe to do SDO reads via svc. |
| virtual IMotionProfile * | asMotion() |
| virtual IIoProfile * | asIo() |
| virtual IEncoderProfile * | asEncoder() |
Detailed Description
class ecdev::IDeviceProfile;
Device-class behaviour plugged onto a [GenericEniDevice].
A profile understands the PDO semantics of one EtherCAT device class (CiA 402 drive, CiA 401 digital/analog I/O, CiA 406 encoder, ...) and nothing about the backend, the ENI XML, or the master. It interacts with the world through exactly two narrow contracts:
[ISlaveServices]for setup-time SDO / register / PDO-pulse work (NOT on the RT path).[ProcessImage]for per-cycle reads/writes of mapped objects (RT path).
Selection is done by a [ProfileRegistry](/lxmaster/api/classes/ProfileRegistry); a new device class is added by registering a new profile, with no change to the generic device or the orchestration layer.
Threading: configurePreOp/prepareSafeOp/shutdown hooks run on the bring-up/shutdown thread while the bus is not in OPERATIONAL; writeOutputs/readInputs run on the RT cyclic thread. A profile that exposes data to application threads must do so through its own lock-free state (e.g. atomics), exactly as the facades expect.