C# Wrapper API
Complete reference for EmSACANNET (EmSACANLibrary and CanDragonDevice). Each method, property, struct, and enum has its own page with signature, parameters, and examples.
See also the C API reference and thequick start guide.
Types and Enums
EmSACANAdvancedChannelConfig— Advanced CAN port configurationEmSACANChannelConfig— Basic CAN port configurationEmSACANChannelConnectionEvent— USB presence events for an open CAN port (EmSACAN_OpenChannel connection callback).EmSACANClock— CAN controller clock rates in MHzEmSACANConfigFlags— Feature configuration flags for the CAN portEmSACANFirmwareType— Selectors for EmSACAN_ReadFirmwareVersion()EmSACANFirmwareUpdatePhase— Device rejected the firmware image during download (see GetLastError for detail).EmSACANFrameManipulation— Frame manipulation configurationEmSACANFrameManipulationBits— Frame manipulation bitsEmSACANFrameManipulationFlags— Frame manipulation flagsEmSACANFrameManipulationTxBit— Frame manipulation transmit bit modesEmSACANInterface— Describes a CAN interfaceEmSACANMessage— Represents a CAN message. Port selection is via the explicit port parameter on <see cref="NativeMethods.EmSACAN_Read"/> / <see cref="NativeMethods.EmSACAN_Write"/>; this struct does not carry a port field.EmSACANMessageType— CAN message type flagsEmSACANParameter— Supported parameters for reading and writingEmSACANPipeCanMessage— Nominal (arbitration) bit rate in kbit/s.EmSACANResult— Function result codes from the EmSACAN APIEmSACANStatus— CAN port status flagsEmSACANTermination— Supported bus termination resistancesEmSACANTimingInfo— Bitrate/sample-point values from <see cref="EmSACANLibrary.CalculateTiming"/>.EmSACANVersion— Version informationEmSACANVersionInfo— Version information for the EmSACAN library DLL.
EmSACANLibrary
EmSACANLibrary.CalculateTiming— Computes bit rates and sample points from advanced port config.EmSACANLibrary.ConfigureCanPipeForwarder— Process-wide EmSACAN library lifecycle and enumeration.EmSACANLibrary.Connect— Connects to an enumerated interface. Uses an empty serial for the internal loopback interface.EmSACANLibrary.EnumerateInterfaces— Enumerates connected CAN Dragon interfaces.EmSACANLibrary.GetAvailableInterfaces— Serial number to description map.EmSACANLibrary.GetLastError— Last process-wide error (e.g. enumerate or connect failures).EmSACANLibrary.GetVersion— Returns DLL major/minor/revision.EmSACANLibrary.HasAvailableInterfaces— True if at least one interface is present.EmSACANLibrary.IsInternalInterface— True when <paramref name="iface"/> is the virtual internal loopback interface.EmSACANLibrary.Shutdown— Shuts down the library and disconnects open devices.EmSACANLibrary.Startup— Initialises the native library.
CanDragonDevice
CanDragonDevice.CancelFirmwareUpdate— Starts device firmware download (pins image until callback completes).CanDragonDevice.CloseAllChannels— Closes all ports tracked as open; ignores per-port errors.CanDragonDevice.CloseChannel— Closes a CAN port and unregisters its USB presence callback.CanDragonDevice.Connect— Opens a device by FTDI serial number and returns a managed session.CanDragonDevice.Dispose— Wraps an existing native handle (used by <see cref="Connect"/>).CanDragonDevice.GetAllChannelStatus— Probes ports 0-7 and returns status for those that respond.CanDragonDevice.GetLastError— Last native error for this session.CanDragonDevice.GetStatus— Reads port status flags.CanDragonDevice.Identify— Flashes LEDs or other identify indication on the device.CanDragonDevice.IsChannelOpen— Legacy-compatible helpers from pre-multi-interface Network, Config, and EmSACAN classes.CanDragonDevice.IsConfigurationLocked— Reports whether configuration is locked for this port on this session.CanDragonDevice.IsFirmwareUpdateActive— True while native firmware worker thread is running.CanDragonDevice.OpenChannel— Opens a CAN port and arms the USB presence monitor for it. When the interface is unplugged or reconnected, <see cref="ChannelConnectionChanged"/> is raised on the native monitor thread for this port.CanDragonDevice.Read— Non-blocking read of one CAN message.CanDragonDevice.ReadAdvancedChannelConfig— Reads <see cref="EmSACANParameter.AdvChannelConfig"/>.CanDragonDevice.ReadBusload— Reads bus load (current, max, average) for a port.CanDragonDevice.ReadChannelConfig— Reads <see cref="EmSACANParameter.ChannelConfig"/>.CanDragonDevice.ReadDeviceVersion— Reads device version parameter block.CanDragonDevice.ReadFirmwareVersion— Reads firmware version for the selected slot.CanDragonDevice.ReadMessage— Alias for <see cref="Read(byte)"/>.CanDragonDevice.ReadNumChannels— Reads number of CAN ports on the device.CanDragonDevice.ReadParameter— Reads a device parameter with no option bytes.CanDragonDevice.ReadSerialNumber— Reads serial number from device (Unicode).CanDragonDevice.ReadSerialNumberAscii— Reads serial number from device (ASCII).CanDragonDevice.ReadTimestamp— Reads TX/RX error counters for a port.CanDragonDevice.ResetChannel— Resets a CAN port.CanDragonDevice.SerialNumber— One open CAN Dragon device (native <c>emsacan_handle_t</c> session).CanDragonDevice.SetCANEvents— Registers Windows event handles signalled when new CAN data or bus errors are available. Pass <see cref="IntPtr.Zero"/> for either handle to ignore that notification.CanDragonDevice.Write— Transmits a CAN message on the specified port.CanDragonDevice.WriteAdvancedChannelConfig— Writes <see cref="EmSACANParameter.AdvChannelConfig"/>.CanDragonDevice.WriteChannelConfig— Writes <see cref="EmSACANParameter.ChannelConfig"/>.CanDragonDevice.WriteFrameManipulation— Writes <see cref="EmSACANParameter.FrameManipulation"/>.CanDragonDevice.WriteMessage— Alias for <see cref="Write(byte, EmSACANMessage)"/>.CanDragonDevice.WriteParameter— Writes a device parameter.
