Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
mm::comm Namespace Reference

Namespaces

namespace  soem
 
namespace  spoe
 

Classes

struct  AlStatusCode
 Metadata for a single AL Status Code entry. More...
 
struct  BusIoLock
 The bus lock held shared, and a frame slot. The slot goes first. More...
 
class  BusLock
 A reader/writer lock that lets no new reader in while a writer waits. More...
 
class  ControlPlaneLocks
 The control-plane locks of one fieldbus driver: one for the bus, one per drive. More...
 
struct  DcConfig
 Distributed-clock configuration for a slave. More...
 
struct  DcSyncDiagnostics
 Live distributed-clock synchronisation status for one slave, read from its ESC. More...
 
struct  DriveLock
 The bus lock held shared, the lock of one drive, and a frame slot. More...
 
struct  EscRegister
 Metadata for a single ESC register entry. More...
 
class  FieldbusDriver
 Abstract interface for an EtherCAT fieldbus driver. More...
 
struct  FmmuConfig
 One FMMU's configuration as programmed on a slave's ESC. More...
 
struct  FoeError
 A structured FoE failure. String-like where a caller only forwards it (operator<<, .message, what()); branchable where a caller must react (kind, retry). More...
 
struct  FoeErrorCode
 Metadata for a single FoE error code entry. More...
 
class  FrameSlot
 One of a fixed number of slots for a frame on the wire. Released when destroyed. More...
 
struct  MailboxConfig
 Mailbox configuration for a slave (the CoE/FoE/EoE/SoE transport windows). More...
 
struct  MailboxErrorCode
 Metadata for a single CoE mailbox error code entry. More...
 
struct  NetworkAdapter
 
struct  ObjectDataTypeInfo
 Metadata for a single object dictionary data type. More...
 
struct  OdEntry
 Schema of a single object dictionary entry uploaded from a slave. More...
 
struct  OdRead
 One device's object dictionary as read from the bus, and what the read did not get. More...
 
struct  PdoLayout
 Layout of the process-data images, produced by configureProcessData. More...
 
struct  PortDiagnostics
 Per-port link state and error counters decoded from a slave's ESC. More...
 
struct  ProcessDataWatchdogConfig
 Process-data (sync-manager) watchdog configuration of one slave. More...
 
class  ScopedQuietSdoLog
 RAII guard that suppresses per-transfer SDO debug logging for its scope (and restores the previous state on exit, so it nests correctly). More...
 
struct  SdoAbortCode
 Metadata for a single CoE SDO abort code entry. More...
 
struct  SiiCategoryDistributedClockElement
 One distributed-clock setting from SII category 60 (0x3C). More...
 
struct  SiiCategoryGeneral
 General device information (SII category 30 / 0x1E). More...
 
struct  SiiCategoryPdoElement
 One default PDO (RxPDO category 51 / 0x33, or TxPDO category 50 / 0x32). More...
 
struct  SiiCategoryPdoEntryElement
 One mapped object within a default PDO (SII categories 50/51). More...
 
struct  SiiCategorySection
 The decoded category section of an SII image. More...
 
struct  SiiCategorySyncManagerElement
 One Sync-Manager default from SII category 41 (0x29). More...
 
struct  SiiInfo
 SII (Slave Information Interface) — the structured EEPROM image of an EtherCAT slave. More...
 
struct  SlaveConfig
 Static ESC configuration snapshot for one slave, captured by configureProcessData. More...
 
struct  SlaveDiagnostics
 Decoded health diagnostics for one slave, read live from its ESC registers. More...
 
struct  SlaveInfo
 Immutable identity fields read from a slave's EEPROM during configuration. More...
 
struct  SlaveInformationInterface
 A fully parsed SII image: fixed header plus decoded categories. More...
 
struct  SlaveIo
 One slave's input and output windows within the process-data images. More...
 
struct  SyncManagerConfig
 One Sync Manager's configuration as programmed on a slave's ESC. More...
 

Enumerations

enum class  EtherCatState : uint16_t {
  Init = 0x01 , PreOp = 0x02 , Boot = 0x03 , SafeOp = 0x04 ,
  Op = 0x08
}
 EtherCAT Application Layer state values. More...
 
enum class  Reachability : uint8_t { Answering , AddressLost , NotAnswering }
 Whether a slave answers at the station address the master gave it. More...
 
enum class  Retry { Transient , Permanent }
 Retry disposition of a failed operation: whether re-issuing the identical call could plausibly succeed. This is the one axis callers branch on uniformly — a firmware flasher retries Transient failures and aborts on Permanent ones — so it rides alongside the FoE-specific kind rather than being folded into it. More...
 
enum class  FoeErrorKind {
  NoResponse , FileNotFound , BufferTooSmall , PacketMismatch ,
  Protocol
}
 Specific File-over-EtherCAT failure kind. Transport-agnostic: the SOEM driver decodes it from the error code of the slave's FoE Error packet, or from a negated ec_err_type when the slave sent none. The SPoE driver decodes it from its own protocol codes. More...
 
enum class  ObjectDataType : uint16_t {
  UNSPECIFIED = 0x0000 , BOOLEAN = 0x0001 , BYTE = 0x001E , WORD = 0x001F ,
  DWORD = 0x0020 , BIT1 = 0x0030 , BIT2 = 0x0031 , BIT3 = 0x0032 ,
  BIT4 = 0x0033 , BIT5 = 0x0034 , BIT6 = 0x0035 , BIT7 = 0x0036 ,
  BIT8 = 0x0037 , BIT9 = 0x0038 , BIT10 = 0x0039 , BIT11 = 0x003A ,
  BIT12 = 0x003B , BIT13 = 0x003C , BIT14 = 0x003D , BIT15 = 0x003E ,
  BIT16 = 0x003F , BITARR8 = 0x002D , BITARR16 = 0x002E , BITARR32 = 0x002F ,
  INTEGER8 = 0x0002 , INTEGER16 = 0x0003 , INTEGER24 = 0x0010 , INTEGER32 = 0x0004 ,
  INTEGER40 = 0x0012 , INTEGER48 = 0x0013 , INTEGER56 = 0x0014 , INTEGER64 = 0x0015 ,
  UNSIGNED8 = 0x0005 , UNSIGNED16 = 0x0006 , UNSIGNED24 = 0x0016 , UNSIGNED32 = 0x0007 ,
  UNSIGNED40 = 0x0018 , UNSIGNED48 = 0x0019 , UNSIGNED56 = 0x001A , UNSIGNED64 = 0x001B ,
  REAL32 = 0x0008 , REAL64 = 0x0011 , GUID = 0x001D , VISIBLE_STRING = 0x0009 ,
  OCTET_STRING = 0x000A , UNICODE_STRING = 0x000B , WSTRING = 0x0268 , TIME_OF_DAY = 0x000C ,
  TIME_DIFFERENCE = 0x000D , DOMAIN = 0x000F , ARRAY_OF_INT = 0x0260 , ARRAY_OF_SINT = 0x0261 ,
  ARRAY_OF_DINT = 0x0262 , ARRAY_OF_UDINT = 0x0263 , ARRAY_OF_BITARR8 = 0x0264 , ARRAY_OF_BITARR16 = 0x0265 ,
  ARRAY_OF_BITARR32 = 0x0266 , ARRAY_OF_USINT = 0x0267 , ARRAY_OF_REAL = 0x0269 , ARRAY_OF_LREAL = 0x026A ,
  PDO_MAPPING = 0x0021 , IDENTITY = 0x0023 , COMMAND_PAR = 0x0025 , PDO_PARAMETER = 0x0027 ,
  ENUM = 0x0028 , SM_SYNCHRONISATION = 0x0029 , RECORD = 0x002A , BACKUP_PARAMETER = 0x002B ,
  MODULAR_DEVICE_PROFILE = 0x002C , ERROR_SETTING = 0x0281 , DIAGNOSIS_HISTORY = 0x0282 , EXTERNAL_SYNC_STATUS = 0x0283 ,
  EXTERNAL_SYNC_SETTINGS = 0x0284 , DEFTYPE_FSOEFRAME = 0x0285 , DEFTYPE_FSOECOMMPAR = 0x0286 , UTYPE_START = 0x0800 ,
  UTYPE_END = 0x0FFF
}
 CoE object dictionary data type codes. More...
 
enum class  SiiCategoryType : uint16_t {
  Nop = 0 , DeviceSpecific = 1 , Strings = 10 , DataTypes = 20 ,
  General = 30 , Fmmu = 40 , SyncM = 41 , FmmuX = 42 ,
  SyncUnit = 43 , TxPdo = 50 , RxPdo = 51 , Dc = 60 ,
  Timeouts = 70 , Dictionary = 80 , Hardware = 90 , VendorInformation = 100 ,
  Images = 110 , VendorSpecific = 0x0800 , ApplicationSpecific = 0x2000 , End = 0xFFFF
}
 Recognised SII category type identifiers (ETG.2010 Table 5). More...
 

Functions

void to_json (nlohmann::json &j, const AlStatusCode &c)
 Serialises an AlStatusCode to JSON.
 
constexpr const AlStatusCode * findAlStatusCode (uint16_t code)
 Looks up code in kAlStatusCodes, or returns nullptr if it is not catalogued.
 
constexpr bool isAlStatusCodeTerminal (uint16_t code)
 Returns true if code indicates a state-transition failure that cannot be resolved by retrying the same writestate.
 
constexpr std::string_view alStatusCodeName (uint16_t code)
 Returns the short name for code, or an empty view if code is not a known AL Status Code.
 
void to_json (nlohmann::json &j, const NetworkAdapter &a)
 Serialises a NetworkAdapter to JSON.
 
bool isMacAddress (const std::string &s)
 Returns true if s is a MAC address in either Linux (:) or Windows (-) separator format.
 
std::string normalizeMac (const std::string &raw, char sep)
 Normalises a MAC address string to uppercase with the given separator.
 
std::optional< std::array< uint8_t, 6 > > parseMac (const std::string &s)
 Decodes a MAC address string into its six bytes, in wire order.
 
std::vector< NetworkAdapter > enumerateNetworkAdapters ()
 Enumerates all network adapters visible to the OS.
 
std::expected< NetworkAdapter, std::string > resolveNetworkAdapter (const std::string &input)
 Resolves a network adapter specifier to a fully populated NetworkAdapter.
 
void to_json (nlohmann::json &j, const EscRegister &r)
 Serialises an EscRegister to JSON.
 
std::array< uint8_t, kSyncManagerRegisterBytes > encodeSyncManager (const SyncManagerConfig &config)
 Encodes a Sync Manager as the eight bytes an FPWR to its register block carries.
 
std::optional< SyncManagerConfig > decodeSyncManager (uint8_t index, std::span< const uint8_t > bytes)
 Decodes a Sync Manager register block — the inverse of encodeSyncManager.
 
std::array< uint8_t, kFmmuRegisterBytes > encodeFmmu (const FmmuConfig &config)
 Encodes an FMMU as the sixteen bytes an FPWR to its register block carries.
 
std::optional< FmmuConfig > decodeFmmu (uint8_t index, std::span< const uint8_t > bytes)
 Decodes an FMMU register block — the inverse of encodeFmmu.
 
EtherCatState alState (uint16_t alStatus)
 Extracts the AL state (bits 3:0) from a raw AL Status register value (0x0130).
 
bool alHasError (uint16_t alStatus)
 Returns whether the AL Status error indicator (bit 4 of register 0x0130) is set.
 
std::string_view toString (EtherCatState state)
 Human-readable name of an AL state, for log and error messages.
 
std::string_view toString (Reachability reachability)
 API name of a reachability, as the HTTP API and the client spell it.
 
int workingCounterContribution (uint16_t alStatus, bool hasOutputs, bool hasInputs)
 Working-counter contribution of one slave for a given AL status and PDO presence.
 
bool exchangesProcessData (uint16_t alStatus)
 Returns whether a slave with this AL status exchanges process data: SAFE-OP or OP, with the error flag clear.
 
FoeError makeFoeRefusal (uint32_t code, std::string_view text, std::string_view op, uint16_t slave, std::string_view filename)
 Builds the FoeError for a transfer the slave refused with an FoE Error packet, naming the code as an SDO failure names its abort code: "(FoE error 0x8001: Not found)".
 
std::string_view foeReason (FoeErrorKind kind)
 Short human-readable reason for a FoE kind (no surrounding punctuation).
 
Retry foeRetry (FoeErrorKind kind)
 Retry disposition implied by a FoE kind. A missing file or an undersized buffer is a fixed condition that will recur identically; a desync or a not-yet-ready slave (the BOOT bootloader warm-up path) is worth another attempt.
 
std::ostream & operator<< (std::ostream &os, const FoeError &e)
 Streams the message, so ASSERT_TRUE(r) << r.error() and spdlog {} work unchanged.
 
FoeError makeFoeError (FoeErrorKind kind, std::string_view op, uint16_t slave, std::string_view filename)
 Builds a fully-formed FoeError from a decoded kind plus call context. Keeps the message wording identical to the pre-promotion string ("<op> slave N '<file>' failed (<reason>)") so nothing downstream that logs or displays it changes shape.
 
void to_json (nlohmann::json &j, const FoeErrorCode &e)
 Serialises a FoeErrorCode to JSON.
 
constexpr std::string_view foeErrorCodeName (uint32_t code)
 Returns the name of code, or an empty view if code is not a known FoE error code (vendor-specific, or a slave that put something else in the field).
 
void to_json (nlohmann::json &j, const MailboxErrorCode &e)
 Serialises a MailboxErrorCode to JSON.
 
constexpr std::string_view mailboxErrorCodeDescription (uint16_t code)
 Returns the description of code, or an empty view if code is not a known mailbox error code (vendor-specific, or a stale/garbage read).
 
void to_json (nlohmann::json &j, const ObjectDataTypeInfo &info)
 Serialises an ObjectDataTypeInfo to JSON.
 
constexpr std::string_view objectDataTypeName (uint16_t code)
 Returns the symbolic name of code, or "UNKNOWN" if it is not in the table.
 
constexpr uint16_t objectDataTypeBitSize (uint16_t code)
 Returns the declared bit width of code, or 0 if unknown / variable-length.
 
void to_json (nlohmann::json &j, const SdoAbortCode &e)
 Serialises an SdoAbortCode to JSON.
 
constexpr std::string_view sdoAbortCodeDescription (uint32_t code)
 Returns the description of code, or an empty view if code is not a known SDO abort code (vendor-specific, or a stale/garbage read).
 
std::optional< SiiCategoryType > resolveSiiCategoryType (uint16_t value)
 Normalises a raw 16-bit category-type word into a SiiCategoryType.
 
std::expected< SlaveInformationInterface, std::string > parseSii (std::span< const uint8_t > buffer)
 Parses a raw SII EEPROM image into a SlaveInformationInterface.
 
std::expected< void, std::string > validateSiiImage (std::span< const uint8_t > buffer)
 Checks that a raw SII image is structurally sound enough to be written to an EEPROM.
 
void to_json (nlohmann::json &j, const SiiInfo &v)
 
void to_json (nlohmann::json &j, const SiiCategoryGeneral &v)
 
void to_json (nlohmann::json &j, const SiiCategorySyncManagerElement &v)
 
void to_json (nlohmann::json &j, const SiiCategoryPdoEntryElement &v)
 
void to_json (nlohmann::json &j, const SiiCategoryPdoElement &v)
 
void to_json (nlohmann::json &j, const SiiCategoryDistributedClockElement &v)
 
void to_json (nlohmann::json &j, const SiiCategorySection &v)
 
void to_json (nlohmann::json &j, const SlaveInformationInterface &v)
 
constexpr bool isSomanetDevice (uint32_t vendorId)
 Whether a device with this vendor ID is a SOMANET device.
 

Variables

constexpr auto kAlStatusCodes
 Catalogue of AL Status Codes.
 
constexpr auto kEscRegisters
 Catalogue of well-known ESC registers.
 
constexpr std::size_t kMaxProcessImageBytes = 32768
 Maximum size in bytes of the combined process-data image (all outputs + all inputs).
 
constexpr std::chrono::milliseconds kFoeReadTimeout {6000}
 How long a file read waits for the slave's answer, unless the caller asks for longer.
 
constexpr uint16_t kSyncManagerRegisterBase = 0x0800
 Register block addresses and widths for the two configurations above (ETG.1000.4 §6).
 
constexpr uint16_t kSyncManagerRegisterBytes = 8
 Width of one channel (Table 58).
 
constexpr uint16_t kFmmuRegisterBase = 0x0600
 FMMU entity 0 (Table 57).
 
constexpr uint16_t kFmmuRegisterBytes = 16
 Width of one entity (Table 56).
 
constexpr auto kFoeErrorCodes
 Catalogue of FoE error codes defined in ETG.1000.6 §5.8.5, Table 93.
 
constexpr auto kMailboxErrorCodes
 Catalogue of CoE mailbox error codes.
 
constexpr auto kObjectDataTypes
 Catalogue of ETG.1020 object dictionary data types.
 
constexpr auto kSdoAbortCodes
 Catalogue of CoE SDO abort codes.
 
thread_local bool sdoLogQuiet = false
 When true on the calling thread, a driver demotes its per-transfer SDO debug logs to trace. Set it via ScopedQuietSdoLog around background polling so a periodic poller does not flood the log, while direct (user-initiated) reads keep their debug trace.
 
constexpr uint32_t kSynapticonVendorId = 0x000022D2
 Synapticon's EtherCAT Vendor ID (SII and object 0x1018:01).
 
constexpr uint32_t kSensodriveVendorId = 0x0000063A
 Sensodrive's EtherCAT Vendor ID (SII and object 0x1018:01).
 

Enumeration Type Documentation

◆ EtherCatState

enum class mm::comm::EtherCatState : uint16_t
strong

EtherCAT Application Layer state values.

Numeric values match the EtherCAT standard AL control/status register encoding (ETG.1000.6 §6.4.1).

Enumerator
Init 

INIT — reset state, no communication.

PreOp 

PRE-OPERATIONAL — mailbox communication active.

Boot 

BOOT — firmware download mode.

SafeOp 

SAFE-OPERATIONAL — outputs are received but not applied.

Op 

OPERATIONAL — full PDO exchange.

◆ FoeErrorKind

enum class mm::comm::FoeErrorKind
strong

Specific File-over-EtherCAT failure kind. Transport-agnostic: the SOEM driver decodes it from the error code of the slave's FoE Error packet, or from a negated ec_err_type when the slave sent none. The SPoE driver decodes it from its own protocol codes.

Enumerator
NoResponse 

The slave answered nothing (work counter 0 — timeout or not ready).

FileNotFound 

Firmware recognises no such filename.

BufferTooSmall 

The slave's buffer cannot hold the requested transfer.

PacketMismatch 

Packet-number desync mid-transfer.

Protocol 

Generic FoE-protocol error with no finer classification.

◆ ObjectDataType

enum class mm::comm::ObjectDataType : uint16_t
strong

CoE object dictionary data type codes.

Maps the 16-bit DataType field returned by ecx_readOE to its symbolic name. Base numbering follows SOEM (ec_type.h) / CiA 301 — what the wire actually reports — extended with the record/array/DEFTYPE codes from ETG.1020 v1.6.0 (§26 Base Data Types, Tables 119-121) plus ETG.5001 / ETG.5120 cross-references. Where SOEM and ETG.1020 disagree (notably 0x000B, see below) SOEM's numbering wins.

Enumerator
UNSPECIFIED 

Undefined or unknown data type.

BOOLEAN 

Boolean value (true or false), transported as a byte.

BYTE 

8-bit unsigned integer.

WORD 

16-bit unsigned integer.

DWORD 

32-bit unsigned integer.

BIT1 

1-bit field.

BIT2 

2-bit field.

BIT3 

3-bit field.

BIT4 

4-bit field.

BIT5 

5-bit field.

BIT6 

6-bit field.

BIT7 

7-bit field.

BIT8 

8-bit field.

BIT9 

9-bit field.

BIT10 

10-bit field.

BIT11 

11-bit field.

BIT12 

12-bit field.

BIT13 

13-bit field.

BIT14 

14-bit field.

BIT15 

15-bit field.

BIT16 

16-bit field.

BITARR8 

Array of 8 bits.

BITARR16 

Array of 16 bits.

BITARR32 

Array of 32 bits.

INTEGER8 

8-bit signed integer.

INTEGER16 

16-bit signed integer.

INTEGER24 

24-bit signed integer.

INTEGER32 

32-bit signed integer.

INTEGER40 

40-bit signed integer.

INTEGER48 

48-bit signed integer.

INTEGER56 

56-bit signed integer.

INTEGER64 

64-bit signed integer.

UNSIGNED8 

8-bit unsigned integer.

UNSIGNED16 

16-bit unsigned integer.

UNSIGNED24 

24-bit unsigned integer.

UNSIGNED32 

32-bit unsigned integer.

UNSIGNED40 

40-bit unsigned integer.

UNSIGNED48 

48-bit unsigned integer.

UNSIGNED56 

56-bit unsigned integer.

UNSIGNED64 

64-bit unsigned integer.

REAL32 

32-bit IEEE 754 floating point.

REAL64 

64-bit IEEE 754 floating point.

GUID 

128-bit globally unique identifier.

VISIBLE_STRING 

Null-terminated ASCII string.

OCTET_STRING 

Variable-length byte array.

UNICODE_STRING 

UCS-2 string (SOEM/CiA numbering; see note above).

WSTRING 

UCS-2/wide string — ETG.1020's UNICODE_STRING code (cf. 0x000B).

TIME_OF_DAY 

Time of day (ETG.1020).

TIME_DIFFERENCE 

Time difference (ETG.1020).

DOMAIN 

Application-specific domain (ETG.1020).

ARRAY_OF_INT 

Sequence of INT (IEC 61131-3).

ARRAY_OF_SINT 

Sequence of SINT.

ARRAY_OF_DINT 

Sequence of DINT.

ARRAY_OF_UDINT 

Sequence of UDINT.

ARRAY_OF_BITARR8 

Sequence of BITARR8.

ARRAY_OF_BITARR16 

Sequence of BITARR16.

ARRAY_OF_BITARR32 

Sequence of BITARR32.

ARRAY_OF_USINT 

Sequence of USINT.

ARRAY_OF_REAL 

Sequence of REAL.

ARRAY_OF_LREAL 

Sequence of LREAL.

PDO_MAPPING 

PDO mapping (ETG.1000).

IDENTITY 

Identity object (ETG.1000).

COMMAND_PAR 

Command parameter (ETG.1000).

PDO_PARAMETER 

PDO parameter (ETG.1020).

ENUM 

Enumeration (ETG.1020).

SM_SYNCHRONISATION 

Sync manager synchronisation (ETG.1000).

RECORD 

Generic record structure.

BACKUP_PARAMETER 

Backup parameter (ETG.1020).

MODULAR_DEVICE_PROFILE 

Modular device profile (ETG.5001).

ERROR_SETTING 

Error setting (ETG.1020).

DIAGNOSIS_HISTORY 

Diagnosis history (ETG.1020).

EXTERNAL_SYNC_STATUS 

External sync status (ETG.1020).

EXTERNAL_SYNC_SETTINGS 

External sync settings (ETG.1020).

DEFTYPE_FSOEFRAME 

FSoE frame (ETG.5120).

DEFTYPE_FSOECOMMPAR 

FSoE communication parameters (ETG.5120).

UTYPE_START 

Start of user-defined type range.

UTYPE_END 

End of user-defined type range.

◆ Reachability

enum class mm::comm::Reachability : uint8_t
strong

Whether a slave answers at the station address the master gave it.

A reset sets the Configured Station Address register (0x0010) back to 0, and only the master can write it again. From then on every configured-address read and write misses the slave, so its AL state is unknown although it is still on the wire.

The wire position is checked by position only. When devices were added to or removed from the chain, the device at that position can be a different one, and a device near the end can find nothing at its position. Both outcomes need a scan.

Enumerator
Answering 

It answers at its configured station address.

AddressLost 

It answers at its wire position only. A scan gives it an address again.

NotAnswering 

Nothing answers at its address or at its wire position.

◆ Retry

enum class mm::comm::Retry
strong

Retry disposition of a failed operation: whether re-issuing the identical call could plausibly succeed. This is the one axis callers branch on uniformly — a firmware flasher retries Transient failures and aborts on Permanent ones — so it rides alongside the FoE-specific kind rather than being folded into it.

Enumerator
Transient 

A fresh attempt may succeed (protocol desync, slave not yet ready after BOOT).

Permanent 

The identical call will fail the same way (no such file, undersized buffer).

◆ SiiCategoryType

enum class mm::comm::SiiCategoryType : uint16_t
strong

Recognised SII category type identifiers (ETG.2010 Table 5).

ETG.2010 is the authoritative SII spec; its Table 5 supersedes ETG.1000.6 Table 19. The base IDs up to Dc (60) are common to both; the extended IDs (FmmuX, SyncUnit, Timeouts, Dictionary, Hardware, VendorInformation, Images, ApplicationSpecific) and the wider vendor/application ranges (see resolveSiiCategoryType) are ETG.2010's. Several spec ranges collapse to a single representative (e.g. all vendor-specific values map to VendorSpecific); the category-type word is a full Unsigned16 (no vendor-specific flag bit).

Enumerator
Nop 
DeviceSpecific 
Strings 
DataTypes 
General 
Fmmu 
SyncM 
FmmuX 
SyncUnit 
TxPdo 
RxPdo 
Dc 
Timeouts 
Dictionary 
Hardware 
VendorInformation 
Images 
VendorSpecific 
ApplicationSpecific 
End 

Function Documentation

◆ alHasError()

bool mm::comm::alHasError ( uint16_t  alStatus)
inline

Returns whether the AL Status error indicator (bit 4 of register 0x0130) is set.

◆ alState()

EtherCatState mm::comm::alState ( uint16_t  alStatus)
inline

Extracts the AL state (bits 3:0) from a raw AL Status register value (0x0130).

The single place the AL Status register layout is decoded: the low nibble is the current state, bit 4 is the error indicator (see alHasError). Callers compare the result against EtherCatState rather than re-masking the raw register.

◆ alStatusCodeName()

constexpr std::string_view mm::comm::alStatusCodeName ( uint16_t  code)
constexpr

Returns the short name for code, or an empty view if code is not a known AL Status Code.

An empty result is the signal that a slave reported a code outside the catalogue — vendor-specific, or a stale/garbage read — which a caller should flag rather than present as a decoded error.

◆ decodeFmmu()

std::optional< FmmuConfig > mm::comm::decodeFmmu ( uint8_t  index,
std::span< const uint8_t >  bytes 
)

Decodes an FMMU register block — the inverse of encodeFmmu.

Every field survives the round trip, because the register carries all of them.

Parameters
indexFMMU number, which the block itself does not carry.
bytesThe register block; at least kFmmuRegisterBytes.
Returns
The configuration, or nullopt when bytes is short.

◆ decodeSyncManager()

std::optional< SyncManagerConfig > mm::comm::decodeSyncManager ( uint8_t  index,
std::span< const uint8_t >  bytes 
)

Decodes a Sync Manager register block — the inverse of encodeSyncManager.

type is not recoverable and comes back zero. What a Sync Manager carries — a mailbox or process data, and in which direction — is not in the register. It is the master's own classification, read from the slave's SII, so a caller that needs it must supply it.

Parameters
indexSync Manager number, which the block itself does not carry.
bytesThe register block; at least kSyncManagerRegisterBytes.
Returns
The configuration, or nullopt when bytes is short.

◆ encodeFmmu()

std::array< uint8_t, kFmmuRegisterBytes > mm::comm::encodeFmmu ( const FmmuConfig &  config)

Encodes an FMMU as the sixteen bytes an FPWR to its register block carries.

◆ encodeSyncManager()

std::array< uint8_t, kSyncManagerRegisterBytes > mm::comm::encodeSyncManager ( const SyncManagerConfig &  config)

Encodes a Sync Manager as the eight bytes an FPWR to its register block carries.

The two bytes the master may not set — status at offset 5 and PDI control at offset 7 — are written as zero. SyncManagerConfig::flags is the 32-bit read of offsets 4 to 7, so its low byte is the control byte and its third the activate byte.

◆ enumerateNetworkAdapters()

std::vector< NetworkAdapter > mm::comm::enumerateNetworkAdapters ( )

Enumerates all network adapters visible to the OS.

Scans every network adapter and returns a fully populated NetworkAdapter per NIC, so callers can select a specific one by its hardware address rather than by its OS-assigned name, which can change across reboots or driver updates. All three representations are populated at enumeration time.

Platform behaviour

  • Linux — iterates the adapter list returned by SOEM's ec_find_adapters() and queries each interface with SIOCGIFHWADDR via a temporary SOCK_DGRAM socket. Adapters for which the ioctl call fails are silently skipped.
  • macOS — reads link-layer (AF_LINK) addresses from getifaddrs().
  • Windows — calls GetAdaptersAddresses() (IPHLPAPI) to enumerate adapters. Interface names are formatted as WinPcap/Npcap NPF paths: "\\Device\\NPF_<AdapterName>".

MAC address format — macLinux is uppercase colon-separated hex octets, e.g. "AA:BB:CC:DD:EE:FF"; macWindows is the dash-separated equivalent. Both are consistent across platforms.

Returns an empty vector if adapter enumeration fails (e.g. insufficient privileges or no adapters present).

Note
Call once at startup to resolve a configured MAC address to the interface name required by a fieldbus driver. Do not call in a tight loop — OS adapter enumeration is slow.

◆ exchangesProcessData()

bool mm::comm::exchangesProcessData ( uint16_t  alStatus)
inline

Returns whether a slave with this AL status exchanges process data: SAFE-OP or OP, with the error flag clear.

Below SAFE-OP a slave writes nothing into the frame, so its input region holds bytes it never sent. The control plane uses this rule to choose between the process image and an SDO upload, and the RT decode uses it to leave such a slave's cells alone. The two must agree, so the rule has one definition.

Parameters
alStatusAL status of the slave: the state in the low four bits, and the error flag.

◆ findAlStatusCode()

constexpr const AlStatusCode * mm::comm::findAlStatusCode ( uint16_t  code)
constexpr

Looks up code in kAlStatusCodes, or returns nullptr if it is not catalogued.

◆ foeErrorCodeName()

constexpr std::string_view mm::comm::foeErrorCodeName ( uint32_t  code)
constexpr

Returns the name of code, or an empty view if code is not a known FoE error code (vendor-specific, or a slave that put something else in the field).

◆ foeReason()

std::string_view mm::comm::foeReason ( FoeErrorKind  kind)
inline

Short human-readable reason for a FoE kind (no surrounding punctuation).

◆ foeRetry()

Retry mm::comm::foeRetry ( FoeErrorKind  kind)
inline

Retry disposition implied by a FoE kind. A missing file or an undersized buffer is a fixed condition that will recur identically; a desync or a not-yet-ready slave (the BOOT bootloader warm-up path) is worth another attempt.

◆ isAlStatusCodeTerminal()

constexpr bool mm::comm::isAlStatusCodeTerminal ( uint16_t  code)
constexpr

Returns true if code indicates a state-transition failure that cannot be resolved by retrying the same writestate.

A terminal code means the polling loop in FieldbusDriver::transitionToState should abandon the slave immediately rather than waiting for the timeout — the master must change something (re-init, reflash, power cycle) before another transition attempt can succeed. Unknown codes are treated as non-terminal.

◆ isMacAddress()

bool mm::comm::isMacAddress ( const std::string &  s)

Returns true if s is a MAC address in either Linux (:) or Windows (-) separator format.

Accepts exactly 17 characters: six pairs of hex digits separated by consistent colon or dash delimiters, e.g. "AA:BB:CC:DD:EE:FF" or "aa-bb-cc-dd-ee-ff". Mixed separators are rejected.

Parameters
sString to test.
Returns
true when s matches the pattern; false otherwise.

◆ isSomanetDevice()

constexpr bool mm::comm::isSomanetDevice ( uint32_t  vendorId)
constexpr

Whether a device with this vendor ID is a SOMANET device.

A SOMANET device runs SOMANET firmware. The vendor ID is the evidence for that, and it comes from the SII, so it is known as soon as the device is. Sensodrive devices run SOMANET firmware unmodified under their own vendor ID.

◆ mailboxErrorCodeDescription()

constexpr std::string_view mm::comm::mailboxErrorCodeDescription ( uint16_t  code)
constexpr

Returns the description of code, or an empty view if code is not a known mailbox error code (vendor-specific, or a stale/garbage read).

◆ makeFoeError()

FoeError mm::comm::makeFoeError ( FoeErrorKind  kind,
std::string_view  op,
uint16_t  slave,
std::string_view  filename 
)
inline

Builds a fully-formed FoeError from a decoded kind plus call context. Keeps the message wording identical to the pre-promotion string ("<op> slave N '<file>' failed (<reason>)") so nothing downstream that logs or displays it changes shape.

◆ makeFoeRefusal()

FoeError mm::comm::makeFoeRefusal ( uint32_t  code,
std::string_view  text,
std::string_view  op,
uint16_t  slave,
std::string_view  filename 
)

Builds the FoeError for a transfer the slave refused with an FoE Error packet, naming the code as an SDO failure names its abort code: "(FoE error 0x8001: Not found)".

Only 0x8001 Not found has a kind of its own, because a caller branches on it: removing a file that is not there is a success. The slave's text often repeats the code's name, so it is added only when it says more.

Parameters
codeETG.1000.6 error code from the Error packet.
textThe packet's error text, empty when it carried none.

◆ normalizeMac()

std::string mm::comm::normalizeMac ( const std::string &  raw,
char  sep 
)

Normalises a MAC address string to uppercase with the given separator.

Extracts the six hex-octet pairs from raw (which must pass isMacAddress()) and rebuilds the string in uppercase with sep as the field delimiter.

Parameters
rawSource MAC string (colon- or dash-separated, any case).
sepOutput separator character, typically ':' or '-'.
Returns
Normalised MAC string of the form "XX<sep>XX<sep>…<sep>XX".
Precondition
isMacAddress(raw) == true

◆ objectDataTypeBitSize()

constexpr uint16_t mm::comm::objectDataTypeBitSize ( uint16_t  code)
constexpr

Returns the declared bit width of code, or 0 if unknown / variable-length.

◆ objectDataTypeName()

constexpr std::string_view mm::comm::objectDataTypeName ( uint16_t  code)
constexpr

Returns the symbolic name of code, or "UNKNOWN" if it is not in the table.

◆ operator<<()

std::ostream & mm::comm::operator<< ( std::ostream &  os,
const FoeError &  e 
)
inline

Streams the message, so ASSERT_TRUE(r) << r.error() and spdlog {} work unchanged.

◆ parseMac()

std::optional< std::array< uint8_t, 6 > > mm::comm::parseMac ( const std::string &  s)

Decodes a MAC address string into its six bytes, in wire order.

The string form is what an adapter carries and what a human types; a protocol that puts a MAC on the wire — an ENI Source, an EoE frame — needs the bytes. isMacAddress decides what is acceptable, so both separators and either case are.

Parameters
sSource MAC string.
Returns
The six bytes, most significant first, or std::nullopt when s is not a MAC address.

◆ parseSii()

std::expected< SlaveInformationInterface, std::string > mm::comm::parseSii ( std::span< const uint8_t >  buffer)

Parses a raw SII EEPROM image into a SlaveInformationInterface.

Decodes the fixed 128-byte header, then walks the category section starting at offset 128 (each category is a 16-bit type, a 16-bit word-size, then wordSize × 2 payload bytes), dispatching recognised categories to their decoders and stopping at the End (0xFFFF) or Nop marker. Unrecognised categories are skipped; multiple PDO categories accumulate. The walk is bounds-checked: a category claiming more bytes than remain is clamped, never read past the end.

Parameters
bufferRaw SII bytes (at least 128 for a valid header).
Returns
The parsed structure, or an error string if buffer is shorter than the fixed header.

◆ resolveNetworkAdapter()

std::expected< NetworkAdapter, std::string > mm::comm::resolveNetworkAdapter ( const std::string &  input)

Resolves a network adapter specifier to a fully populated NetworkAdapter.

input may be any of the three accepted forms:

  • Linux MAC address: "AA:BB:CC:DD:EE:FF"
  • Windows MAC address: "AA-BB-CC-DD-EE-FF"
  • OS interface name: "eth0", "\\Device\\NPF_{GUID}"

Calls enumerateNetworkAdapters() once to resolve the form that was not supplied.

Parameters
inputUser-supplied adapter specifier string.
Returns
Fully populated NetworkAdapter, or an error string if the adapter cannot be found in the OS adapter map.

◆ resolveSiiCategoryType()

std::optional< SiiCategoryType > mm::comm::resolveSiiCategoryType ( uint16_t  value)

Normalises a raw 16-bit category-type word into a SiiCategoryType.

Range-based values are folded to a single representative (DeviceSpecific for 0x0001–0x0009, VendorSpecific for 0x0800–0x1FFF and 0x3000–0xFFFE, ApplicationSpecific for 0x2000–0x2FFF); the original numeric value is not preserved. Fixed IDs (Strings, General, …) and the End marker resolve directly. Returns std::nullopt for unrecognised values, which the caller skips.

◆ sdoAbortCodeDescription()

constexpr std::string_view mm::comm::sdoAbortCodeDescription ( uint32_t  code)
constexpr

Returns the description of code, or an empty view if code is not a known SDO abort code (vendor-specific, or a stale/garbage read).

◆ to_json() [1/15]

void mm::comm::to_json ( nlohmann::json &  j,
const AlStatusCode &  c 
)

Serialises an AlStatusCode to JSON.

Produces an object with keys code, name, description, terminal. Participates in nlohmann ADL so that nlohmann::json(kAlStatusCodes) works automatically.

Parameters
jOutput JSON value.
cAL Status Code entry to serialise.

◆ to_json() [2/15]

void mm::comm::to_json ( nlohmann::json &  j,
const EscRegister &  r 
)

Serialises an EscRegister to JSON.

Produces an object with keys address, length, name, description. Participates in nlohmann ADL so that nlohmann::json(kEscRegisters) works automatically.

Parameters
jOutput JSON value.
rRegister entry to serialise.

◆ to_json() [3/15]

void mm::comm::to_json ( nlohmann::json &  j,
const FoeErrorCode &  e 
)

Serialises a FoeErrorCode to JSON.

Produces an object with keys code, name, description. Participates in nlohmann ADL so that nlohmann::json(kFoeErrorCodes) works automatically.

Parameters
jOutput JSON value.
eFoE error code entry to serialise.

◆ to_json() [4/15]

void mm::comm::to_json ( nlohmann::json &  j,
const MailboxErrorCode &  e 
)

Serialises a MailboxErrorCode to JSON.

Produces an object with keys code, name, description. Participates in nlohmann ADL so that nlohmann::json(kMailboxErrorCodes) works automatically.

◆ to_json() [5/15]

void mm::comm::to_json ( nlohmann::json &  j,
const NetworkAdapter &  a 
)

Serialises a NetworkAdapter to JSON.

Produces an object with keys macLinux, macWindows, name, description. Participates in nlohmann ADL so that nlohmann::json(adapters) serialises a std::vector<NetworkAdapter> automatically.

Parameters
jOutput JSON value.
aAdapter to serialise.

◆ to_json() [6/15]

void mm::comm::to_json ( nlohmann::json &  j,
const ObjectDataTypeInfo &  info 
)

Serialises an ObjectDataTypeInfo to JSON.

Produces an object with keys code, name, bitSize. Participates in nlohmann ADL so that nlohmann::json(kObjectDataTypes) works automatically.

◆ to_json() [7/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SdoAbortCode &  e 
)

Serialises an SdoAbortCode to JSON.

Produces an object with keys code and description. Participates in nlohmann ADL so that nlohmann::json(kSdoAbortCodes) works automatically.

◆ to_json() [8/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategoryDistributedClockElement &  v 
)

◆ to_json() [9/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategoryGeneral &  v 
)

◆ to_json() [10/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategoryPdoElement &  v 
)

◆ to_json() [11/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategoryPdoEntryElement &  v 
)

◆ to_json() [12/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategorySection &  v 
)

◆ to_json() [13/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiCategorySyncManagerElement &  v 
)

◆ to_json() [14/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SiiInfo &  v 
)

◆ to_json() [15/15]

void mm::comm::to_json ( nlohmann::json &  j,
const SlaveInformationInterface &  v 
)

◆ toString() [1/2]

std::string_view mm::comm::toString ( EtherCatState  state)
inline

Human-readable name of an AL state, for log and error messages.

◆ toString() [2/2]

std::string_view mm::comm::toString ( Reachability  reachability)
inline

API name of a reachability, as the HTTP API and the client spell it.

◆ validateSiiImage()

std::expected< void, std::string > mm::comm::validateSiiImage ( std::span< const uint8_t >  buffer)

Checks that a raw SII image is structurally sound enough to be written to an EEPROM.

This is the guard in front of FieldbusDriver::writeSii, and it exists because that write is the most destructive operation in the stack: a malformed image leaves the slave unidentifiable until it is re-flashed, and the ESC only reloads the EEPROM on a power cycle, so the damage is discovered after the point where it could still be undone. Validation is therefore not a nicety — it is the difference between rejecting a bad file and bricking a drive.

Deliberately structural rather than semantic: it does not judge whether the vendor ID or the PDO defaults are right for the device, only that the bytes are a well-formed SII image.

Four checks, in the order a corrupt file usually fails them:

  • a whole number of 16-bit words, since the EEPROM is word-addressed;
  • at least 0x41 words, so the fixed header and the first category header are present;
  • the ETG CRC-8 (polynomial 0x07, initial value 0xFF) over words 0-6 matches the checksum byte at offset 14 — the image's own integrity check, and the one the ESC itself verifies;
  • the category chain from word 0x40 reaches the 0xFFFF end marker without any category claiming more words than the image holds.
Parameters
bufferRaw SII image.
Returns
Void when the image passes, or a message naming the check that failed.

◆ workingCounterContribution()

int mm::comm::workingCounterContribution ( uint16_t  alStatus,
bool  hasOutputs,
bool  hasInputs 
)
inline

Working-counter contribution of one slave for a given AL status and PDO presence.

A slave increments the working counter of an LRW by 2 when it takes the outputs and by 1 when it delivers the inputs (ETG.1000.4, section 5.4.3.5). SAFE-OP and OP contribute the same. The PRE-OP to SAFE-OP transition enables the output Sync Manager as well as the input one, and leaving OP only sets the outputs to their safe values (ETG.1000.6, Tables 99 and 103). The slave must also receive outputs in SAFE-OP, or it refuses the step to OP with AL status code 0x0019. Below SAFE-OP a slave does not contribute.

A slave with the error flag set contributes 0. One that enters SAFE-OP with the flag set disables Sync Manager 2 and may still deliver its inputs, so 0 is lower than what it answers. The expected value is a lower limit, so that is safe, and the error itself is reported in the AL status.

Summed across the bus, this is the working counter a partially operational bus is expected to produce, and a health check compares the live working counter against it. The protocol rule lives here, with the other AL vocabulary, and not in the node layer, which knows no transport.

Parameters
alStatusAL status of the slave: the state in the low four bits, and the error flag.
hasOutputsWhether the slave has any mapped output (RxPDO) bits.
hasInputsWhether the slave has any mapped input (TxPDO) bits.

Variable Documentation

◆ kAlStatusCodes

constexpr auto mm::comm::kAlStatusCodes
inlineconstexpr

Catalogue of AL Status Codes.

The first block is a faithful transcription of ETG.1000.6 V1.0.4 Table 11 (the latest released revision). The second block adds codes that are not in that table but are reported by real slaves and carried by SOEM's own ec_ALstatuscodelist — most relevantly the firmware/EEPROM/FMMU failures raised during BOOT/FoE flashing and re-mapping. They earn their place here because isAlStatusCodeTerminal must classify them so FieldbusDriver::transitionToState fails fast instead of spinning to timeout.

◆ kEscRegisters

constexpr auto mm::comm::kEscRegisters
inlineconstexpr

Catalogue of well-known ESC registers.

Addresses and sizes follow the Beckhoff EtherCAT ESC datasheet (Section II) and ETG.1000.4. FMMU and SyncManager entries list the full block for the first instance; subsequent instances follow at fixed strides (FMMU: 16 bytes, SM: 8 bytes).

◆ kFmmuRegisterBase

constexpr uint16_t mm::comm::kFmmuRegisterBase = 0x0600
constexpr

FMMU entity 0 (Table 57).

◆ kFmmuRegisterBytes

constexpr uint16_t mm::comm::kFmmuRegisterBytes = 16
constexpr

Width of one entity (Table 56).

◆ kFoeErrorCodes

constexpr auto mm::comm::kFoeErrorCodes
inlineconstexpr
Initial value:
= std::to_array<FoeErrorCode>({
{0x00000000, "Undefined", "Unspecified or vendor-specific FoE error"},
{0x00008000, "Not defined", "General FoE error with no further classification"},
{0x00008001, "Not found", "The requested file was not found on the slave"},
{0x00008002, "Access denied", "Access to the requested file is denied"},
{0x00008003, "Disk full", "The slave has insufficient storage to complete the transfer"},
{0x00008004, "Illegal", "Illegal FoE operation"},
{0x00008005, "Packet number wrong",
"Received a data packet with an unexpected sequence number"},
{0x00008006, "Already exists", "The file already exists on the slave"},
{0x00008007, "No user", "No user is logged in; authentication required"},
{0x00008008, "Bootstrap only", "This operation is only available in Bootstrap state"},
{0x00008009, "Not Bootstrap", "This operation is not available in Bootstrap state"},
{0x0000800A, "No rights", "Insufficient rights to perform the requested operation"},
{0x0000800B, "Program error", "A program error occurred on the slave"},
})

Catalogue of FoE error codes defined in ETG.1000.6 §5.8.5, Table 93.

Codes in the 0x8000 range are the standard EtherCAT FoE error codes. The 0x00000000 entry is a catch-all for unspecified or vendor-specific errors, which otherwise fall outside this range.

◆ kFoeReadTimeout

constexpr std::chrono::milliseconds mm::comm::kFoeReadTimeout {6000}
inlineconstexpr

How long a file read waits for the slave's answer, unless the caller asks for longer.

A SOMANET bootloader can take seconds to answer a read, and it sends nothing until it answers. A read given up too early fails on every attempt, because each attempt starts the read again. 6 s is the timeout known to work on such drives in the field: Motion Master v5 waits the same 6 s, and it reads files from SOMANET bootloaders reliably. The wait is spent only when the slave does not answer.

◆ kMailboxErrorCodes

constexpr auto mm::comm::kMailboxErrorCodes
inlineconstexpr
Initial value:
= std::to_array<MailboxErrorCode>({
{0x0001, "MBXERR_SYNTAX", "Syntax of the 6-octet mailbox header is wrong"},
{0x0002, "MBXERR_UNSUPPORTEDPROTOCOL", "The mailbox protocol is not supported"},
{0x0003, "MBXERR_INVALIDCHANNEL",
"Channel field contains a wrong value (a slave may ignore it)"},
{0x0004, "MBXERR_SERVICENOTSUPPORTED", "The service in the mailbox protocol is not supported"},
{0x0005, "MBXERR_INVALIDHEADER",
"The mailbox protocol header is wrong (excluding the 6-octet mailbox header)"},
{0x0006, "MBXERR_SIZETOOSHORT", "Length of received mailbox data is too short"},
{0x0007, "MBXERR_NOMOREMEMORY",
"Mailbox protocol cannot be processed because of limited resources"},
{0x0008, "MBXERR_INVALIDSIZE", "The length of data is inconsistent"},
{0x0009, "MBXERR_SERVICEINWORK", "Mailbox service already in use"},
})

Catalogue of CoE mailbox error codes.

A faithful transcription of ETG.1000.4 Table 30 ("Error Reply Service Data"). A slave returns one of these in a mailbox error reply when the mailbox layer (below any specific protocol like CoE/FoE) rejects a transfer. SOEM carries the same set in its ec_mbxerrorlist but stops at 0x0008 — this table also lists the spec's 0x0009. The FieldbusDriver surfaces mailbox errors as text embedding the raw 0x... code, so this table lets a caller decode it to a reason.

◆ kMaxProcessImageBytes

constexpr std::size_t mm::comm::kMaxProcessImageBytes = 32768
inlineconstexpr

Maximum size in bytes of the combined process-data image (all outputs + all inputs).

The whole bus is exchanged as one IOmap laid out as [all outputs | all inputs]; on SOEM that is a single buffer of this size, so it is the combined image (outputs + inputs) that both buildProcessImage and configureProcessData() bound against this cap. Each per-direction RT ProcessBuffer scratch is also this size — one direction alone may use the whole budget when the other is empty. A SOMANET drive maps ~100 bytes across both directions, so 50 drives total ~5 KB — under 15% of this cap. This is not a practical limit: on 100 Mbit EtherCAT an image approaching 32 KB already forces a many-millisecond cycle, so the cap sits well clear of any realistic configuration.

◆ kObjectDataTypes

constexpr auto mm::comm::kObjectDataTypes
inlineconstexpr

Catalogue of ETG.1020 object dictionary data types.

◆ kSdoAbortCodes

constexpr auto mm::comm::kSdoAbortCodes
inlineconstexpr

Catalogue of CoE SDO abort codes.

A faithful transcription of ETG.1000.6 §5.6.2.7.2, Table 41 (which reproduces the CANopen CiA 301 SDO abort transfer codes). A slave returns one of these in the Abort SDO Transfer request when a mailbox SDO read/write fails. SOEM carries the identical set in its ec_sdoerrorlist; the FieldbusDriver surfaces SDO failures only as text, embedding the raw 0x... code, so this table lets a caller decode that code to a reason.

◆ kSensodriveVendorId

constexpr uint32_t mm::comm::kSensodriveVendorId = 0x0000063A
inlineconstexpr

Sensodrive's EtherCAT Vendor ID (SII and object 0x1018:01).

Sensodrive devices run SOMANET firmware, so isSomanetDevice is true for them.

◆ kSynapticonVendorId

constexpr uint32_t mm::comm::kSynapticonVendorId = 0x000022D2
inlineconstexpr

Synapticon's EtherCAT Vendor ID (SII and object 0x1018:01).

In mm::comm because the fieldbus driver must know the vendor, and comm cannot depend on node. mm::node::kSynapticonVendorId names this same constant.

◆ kSyncManagerRegisterBase

constexpr uint16_t mm::comm::kSyncManagerRegisterBase = 0x0800
constexpr

Register block addresses and widths for the two configurations above (ETG.1000.4 §6).

A master programs a Sync Manager or an FMMU by writing its whole block to the slave's ESC, and an ENI init command carries exactly those bytes. The constants sit here so the encode, the decode and any caller working out a stride all read them from one place. Sync Manager channel 0 (Table 59).

◆ kSyncManagerRegisterBytes

constexpr uint16_t mm::comm::kSyncManagerRegisterBytes = 8
constexpr

Width of one channel (Table 58).

◆ sdoLogQuiet

thread_local bool mm::comm::sdoLogQuiet = false
inline

When true on the calling thread, a driver demotes its per-transfer SDO debug logs to trace. Set it via ScopedQuietSdoLog around background polling so a periodic poller does not flood the log, while direct (user-initiated) reads keep their debug trace.

Thread-local (the comment, not the name, carries that): the flag is read on the same thread that issues the transfer — SDO reads run synchronously on the caller's thread — so a scope set by the caller reliably covers the driver's logging. Inline so the one instance is shared across translation units.