Table of Contents

Class ZlgCanDevice

Namespace
Suucha.Can.Zlg.Devices
Assembly
Suucha.Can.Zlg.Devices.dll

Represents a ZLG CAN device (supports all ZLG device types)

public class ZlgCanDevice : ICanDevice, IDisposable
Inheritance
ZlgCanDevice
Implements
Inherited Members

Constructors

ZlgCanDevice(DeviceType, uint)

Creates a new ZLG CAN device instance

public ZlgCanDevice(DeviceType deviceType, uint deviceIndex = 0)

Parameters

deviceType DeviceType

Device type

deviceIndex uint

Device index (0-based, for multiple devices)

Properties

DeviceIndex

Device index (for multiple devices of same type)

public uint DeviceIndex { get; }

Property Value

uint

DeviceInfo

Device information (hardware version, serial number, etc.)

public DeviceInfo? DeviceInfo { get; }

Property Value

DeviceInfo

DeviceType

public DeviceType DeviceType { get; }

Property Value

DeviceType

IsOpen

Whether the device is currently open

public bool IsOpen { get; }

Property Value

bool

Methods

Close()

Closes the device and all its channels

public void Close()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~ZlgCanDevice()

Finalizer to ensure proper cleanup of device resources.

protected ~ZlgCanDevice()

GetDeviceInfo()

Gets device information

public DeviceInfo GetDeviceInfo()

Returns

DeviceInfo

Device information

IsDeviceOnline()

Checks if the device is online

public bool IsDeviceOnline()

Returns

bool

True if device is online, false otherwise

Open()

Opens the device

public void Open()

Exceptions

DeviceOpenException

Thrown when device cannot be opened

OpenChannel(int, ChannelConfig)

Opens a CAN channel with the specified configuration

public ICanChannel OpenChannel(int channelIndex, ChannelConfig config)

Parameters

channelIndex int

Channel index (0-based)

config ChannelConfig

Channel configuration

Returns

ICanChannel

The opened channel

Exceptions

ChannelInitException

Thrown when channel cannot be initialized