Skip to content

CanOpenSafetyExtensions Class

Reaches the safety layer of a node without widening ICanOpenNode (adding members to a published interface breaks every implementer; see the DisposeAsync extension for the precedent).

public static class CanOpenSafetyExtensions

Inheritance Object → CanOpenSafetyExtensions

Methods

CanOpenSafetyExtensions.ReadPeerSafetyConfigurationAsync(this ICanOpenSafety, byte, PeerSafetyConfiguration, CancellationToken) Method

Reads a peer's safety configuration through the optional inspection surface (#403). Does not add a member requirement to existing ICanOpenSafety implementations.

public static System.Threading.Tasks.Task<CanKit.Pro.CANopen.Safety.PeerSafetySnapshot> ReadPeerSafetyConfigurationAsync(this CanKit.Pro.CANopen.Safety.ICanOpenSafety safety, byte peerNodeId, CanKit.Pro.CANopen.Safety.PeerSafetyConfiguration? expected=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

safety ICanOpenSafety

peerNodeId Byte

expected PeerSafetyConfiguration

cancellationToken CancellationToken

Returns

Task<PeerSafetySnapshot>

Exceptions

NotSupportedException
The safety implementation does not support inspection.

CanOpenSafetyExtensions.Safety(this ICanOpenNode) Method

The ICanOpenSafety of a node this library created.

public static CanKit.Pro.CANopen.Safety.ICanOpenSafety Safety(this CanKit.Pro.CANopen.ICanOpenNode node);

Parameters

node ICanOpenNode

Returns

ICanOpenSafety

Exceptions

NotSupportedException
The node is not one of this library's.