|
CANOPEN_CLIENT Driver 0.1.0
API reference
|
Errors, results, frames, protocol vocabulary and configuration. More...
Classes | |
| struct | canopen_client::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | canopen_client::Result< void > |
| The result of a call that returns no value. More... | |
| struct | canopen_client::CanFrame |
| One classic CAN frame with an 11-bit identifier. More... | |
| struct | canopen_client::SdoAbortInfo |
| The last SDO abort, from the node or from this driver. More... | |
| struct | canopen_client::SdoReply |
| A decoded SDO server reply. More... | |
| struct | canopen_client::HeartbeatInfo |
| A decoded heartbeat or node-guarding reply. More... | |
| struct | canopen_client::NodeStatus |
| What the heartbeat consumer knows about one node. More... | |
| struct | canopen_client::EmcyEvent |
| One emergency message (EMCY). More... | |
| struct | canopen_client::PdoSample |
| The latest frame received on a subscribed TPDO identifier. More... | |
| struct | canopen_client::Stats |
| Counters of the receive path, for diagnostics. More... | |
| struct | canopen_client::PdoMapEntry |
| One mapped object of a PDO. More... | |
| struct | canopen_client::PdoConfig |
| The communication and mapping parameters of one PDO. More... | |
| struct | canopen_client::DriveObjects |
| The object indices of a drive; the defaults are the profile's, a remapped drive overrides them. More... | |
| struct | canopen_client::Config |
| Everything the client uses; the defaults suit a node on a 500 kbit/s bus. More... | |
Functions | |
| constexpr const char * | canopen_client::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr bool | canopen_client::IsValid (const CanFrame &frame) noexcept |
| Whether a frame is representable on the bus: identifier at most 0x7FF, length at most 8. | |
| constexpr const char * | canopen_client::AbortCodeName (uint32_t code) noexcept |
| The name of an abort code, for logs. | |
| constexpr const char * | canopen_client::ToString (DriveState state) noexcept |
| The name of a drive state, for logs. | |
| constexpr Error | canopen_client::Validate (const Config &config) noexcept |
| Check a configuration without touching the bus. | |
| constexpr Config | canopen_client::FastBusPreset () noexcept |
| Short timeouts for a fast, lightly loaded bus. | |
| constexpr Config | canopen_client::SlowBusPreset () noexcept |
| Long timeouts for a slow or busy bus (for example 125 kbit/s with many nodes). | |
| constexpr const char * | canopen_client::GetDriverVersion () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint16_t | canopen_client::kMaxCanId = 0x7FF |
| Largest 11-bit CAN identifier. | |
| constexpr uint8_t | canopen_client::kMaxDlc = 8 |
| Longest classic CAN payload in bytes. | |
| constexpr uint8_t | canopen_client::kBroadcastNode = 0 |
| Node identifier of "every node" in an NMT command. | |
| constexpr uint8_t | canopen_client::kMinNodeId = 1 |
| Lowest valid node identifier. | |
| constexpr uint8_t | canopen_client::kMaxNodeId = 127 |
| Highest valid node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdNmt = 0x000 |
| NMT command identifier (pre-defined connection set). | |
| constexpr uint16_t | canopen_client::kCobIdSync = 0x080 |
| SYNC identifier. | |
| constexpr uint16_t | canopen_client::kCobIdEmcyBase = 0x080 |
| EMCY identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdSdoResponseBase = 0x580 |
| SDO response (server to client) identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdSdoRequestBase = 0x600 |
| SDO request (client to server) identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdHeartbeatBase = 0x700 |
| Heartbeat and node-guarding identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kPdoCobIdMin = 0x181 |
| Lowest identifier the driver accepts for a PDO (the first pre-defined TPDO1 of node 1). | |
| constexpr uint16_t | canopen_client::kPdoCobIdMax = 0x57F |
| Highest identifier the driver accepts for a PDO (the last pre-defined RPDO4 identifier). | |
| constexpr std::size_t | canopen_client::kMonitorCapacity = 16 |
| Nodes the heartbeat and guarding consumer can watch at once. | |
| constexpr std::size_t | canopen_client::kPdoSubscriptionCapacity = 16 |
| TPDO identifiers the receive path can hold the latest frame of. | |
| constexpr std::size_t | canopen_client::kEmcyQueueCapacity = 8 |
EMCY events queued between two PopEmcy() calls. | |
| constexpr std::size_t | canopen_client::kMaxPdoEntries = 16 |
| Entries of one PDO mapping the helpers handle. | |
| constexpr uint32_t | canopen_client::kMaxFramesPerWait = 256 |
| Frames one blocking wait looks at before it gives up (a flooded bus must not stall a call). | |
| constexpr uint32_t | canopen_client::kMaxDrainFrames = 64 |
| Frames drained and routed before a request is sent. | |
| constexpr uint32_t | canopen_client::kMaxSdoSegments = 65536 |
| Segments of one segmented SDO transfer (7 bytes each). | |
| constexpr uint32_t | canopen_client::kMaxReceivesPerWait = 65536 |
| constexpr uint16_t | canopen_client::kControlShutdown = 0x0006 |
| Controlword: shutdown (to Ready to switch on). | |
| constexpr uint16_t | canopen_client::kControlSwitchOn = 0x0007 |
| Controlword: switch on (to Switched on). | |
| constexpr uint16_t | canopen_client::kControlDisableVoltage = 0x0000 |
| Controlword: disable voltage (to Switch on disabled). | |
| constexpr uint16_t | canopen_client::kControlQuickStop = 0x0002 |
| Controlword: quick stop. | |
| constexpr uint16_t | canopen_client::kControlEnableOperation = 0x000F |
| Controlword: enable operation (to Operation enabled). | |
| constexpr uint16_t | canopen_client::kControlFaultReset = 0x0080 |
| Controlword: fault reset (bit 7, acts on the rising edge). | |
| constexpr uint32_t | canopen_client::kMaxSdoTimeoutUs = 60'000'000 |
| Longest SDO timeout in microseconds. | |
Errors, results, frames, protocol vocabulary and configuration.
|
strong |
|
strong |
Why a call failed. Values 0 to 9 are the shared base set; client-specific values start at 16.
DeviceIdMismatch, Crc and Busy are never returned: the CAN controller checks the frame CRC, and every call blocks until it finishes.
| Enumerator | |
|---|---|
| Ok | The call succeeded. |
| NotInitialized |
|
| InvalidArgument | An argument or a |
| Bus | The port failed to send or to receive a frame. |
| Timeout | No valid reply arrived in time (SDO, node guarding, drive state). |
| DeviceIdMismatch | Not returned by this driver. |
| Crc | Not returned by this driver. |
| Busy | Not returned by this driver. |
| DeviceFault | A read-back showed a value other than the one written. |
| Unsupported | The call needs a port hook the port lacks, or a transfer type the driver does not implement. |
| SdoAbort | The node aborted the SDO transfer; see |
| Protocol | A reply broke the protocol (command specifier, toggle bit, size). |
| BufferTooSmall | An upload is larger than the caller's buffer. |
| InvalidFrame | A frame fails validation (identifier, length or content). |
| NodeState | The node is known to be in an NMT state that ignores the request. |
| DriveFault | The drive is in the Fault state or reports a state no transition leaves. |
|
strong |
What Poll() did with the frame it received.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
What a port's Receive() hook reports.
| Enumerator | |
|---|---|
| Frame | A frame was received into the argument. |
| Timeout | No frame arrived within the timeout (not an error). |
| Error | The controller failed (bus off, driver not running). |
|
strong |
SDO abort codes the driver names. Any 32-bit value can arrive; SdoAbortInfo::code keeps the raw value and AbortCodeName() names it.
| Enumerator | |
|---|---|
| ToggleNotAlternated | Toggle bit not alternated. |
| Timeout | SDO protocol timed out. |
| InvalidCommandSpecifier | Client or server command specifier not valid or unknown. |
| InvalidBlockSize | Invalid block size (block mode only). |
| InvalidSequenceNumber | Invalid sequence number (block mode only). |
| CrcError | CRC error (block mode only). |
| OutOfMemory | Out of memory. |
| UnsupportedAccess | Unsupported access to an object. |
| WriteOnly | Attempt to read a write-only object. |
| ReadOnly | Attempt to write a read-only object. |
| ObjectNotFound | Object does not exist in the object dictionary. |
| NotMappable | Object cannot be mapped to the PDO. |
| PdoLengthExceeded | The mapped objects would exceed the PDO length. |
| ParameterIncompatible | General parameter incompatibility. |
| InternalIncompatibility | General internal incompatibility in the device. |
| HardwareError | Access failed due to a hardware error. |
| LengthMismatch | Data type does not match, length of service parameter does not match. |
| LengthTooHigh | Data type does not match, length of service parameter too high. |
| LengthTooLow | Data type does not match, length of service parameter too low. |
| SubIndexNotFound | Sub-index does not exist. |
| InvalidValue | Invalid value for parameter (download only). |
| ValueTooHigh | Value of parameter written too high (download only). |
| ValueTooLow | Value of parameter written too low (download only). |
| MaxLessThanMin | Maximum value is less than minimum value. |
| SdoResourceUnavailable | Resource not available: SDO connection. |
| GeneralError | General error. |
| StoreFailed | Data cannot be transferred or stored to the application. |
| LocalControl | ... because of local control. |
| DeviceState | ... because of the present device state. |
| NoDictionary | Object dictionary dynamic generation fails or none present. |
| NoData | No data available. |
|
strong |
The kind of an SDO server reply.
|
strong |
|
constexprnoexcept |
The name of an abort code, for logs.
| code | The raw 32-bit abort code. |
"Unknown" for a code the driver does not name.
|
constexprnoexcept |
Short timeouts for a fast, lightly loaded bus.
|
constexprnoexcept |
"0.1.0". No I/O.
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
Whether a frame is representable on the bus: identifier at most 0x7FF, length at most 8.
| frame | The frame. |
|
constexprnoexcept |
Long timeouts for a slow or busy bus (for example 125 kbit/s with many nodes).
|
constexprnoexcept |
The name of a drive state, for logs.
| state | The state. |
"Unknown" for a value that is not an enumerator.
|
constexprnoexcept |
The name of an error, for logs.
| error | The error. |
"Unknown" for a value that is not an enumerator. Check a configuration without touching the bus.
| config | The configuration. |
Error::Ok or Error::InvalidArgument.
|
inlineconstexpr |
Receive() calls one blocking wait makes at most, whatever they return, before it gives up. Only frames count against kMaxFramesPerWait; this bounds a port that returns early with no frame.