CAN DragonEmSA
enumTypes and Enums

emsacan_result_t

Description

EmSA CAN Interface — public API for the CAN Dragon DLL.

Details

Declares the DLL import/export surface (EMSACAN_API), limits, configuration and message types, and the functions used to enumerate interfaces, connect, exchange CAN traffic, read/write device parameters, and (on Windows) optional named-pipe forwarding and firmware update. ### Threading and concurrency **Multiple devices:More than one CAN Dragon may be connected at the same time. Each successful EmSACAN_Connect returns a distinct emsacan_handle_t — use a separate handle per device. **Supported:- Using EmSACAN_Read, EmSACAN_Write, EmSACAN_GetStatus, EmSACAN_OpenChannel, EmSACAN_CloseChannel, and EmSACAN_ResetChannel on **differenthandles from **differentthreads at the same time. - Assigning one application thread (or owner) per connected handle for ongoing CAN I/O. - Calling EmSACAN_CalculateTiming from any thread (it does not use a session handle). **Not supported:- Calling any EmSACAN function on the **samehandle from more than one thread at the same time without your own mutual exclusion. - Calling EmSACAN_Startup, EmSACAN_Shutdown, EmSACAN_EnumerateInterfaces, EmSACAN_Connect, or EmSACAN_Disconnect from multiple threads at the same time without your own coordination. - Having a firmware update in progress on more than one handle at the same time. - Calling EmSACAN functions on a handle from that handle’s firmware-update callback. - Calling EmSACAN functions on a handle from that handle’s port connection callback (EmSACAN_OpenChannel). **Per-handle limitations:*- While a firmware update is active on a handle, other calls on that handle may fail (for example EMSACAN_ERR_FWUPDATE_ACTIVE or EMSACAN_ERR_BUSY). - Do not overlap EmSACAN_ReadParameter and EmSACAN_WriteParameter on the same handle unless your application serializes them. - EmSACAN_GetLastError with a NULL handle reports the last process-wide error; with a non-NULL handle it reports the last error for that session only. @defgroup emsacan_public EmSA CAN public API @{

Members

NameValueDescription
EMSACAN_OK0—
EMSACAN_ERR_GENERIC1—
EMSACAN_ERR_HARDWAREINIT2—
EMSACAN_ERR_ALREADYCONNECTED3—
EMSACAN_ERR_USBRXALREADYRUNNING4—
EMSACAN_ERR_LOOKINGFORINTERFACES5—
EMSACAN_ERR_RXEMPTY6—
EMSACAN_ERR_TXOVERFLOW7—
EMSACAN_ERR_USBTXALREADYRUNNING8—
EMSACAN_ERR_BUFFERTOOSMALL9—
EMSACAN_ERR_UNKNOWNPARAMETER10—
EMSACAN_ERR_PARAMETERCANNOTBEWRITTEN11—
EMSACAN_ERR_FAILEDTOTX12—
EMSACAN_ERR_TIMEOUT13—
EMSACAN_ERR_INCORRECTPARAMETER14—
EMSACAN_ERR_INCORRECTREPONSESIZE15—
EMSACAN_ERR_PARAMETERWRITEFAILED16—
EMSACAN_ERR_PARAMETERINVALIDDATA17—
EMSACAN_ERR_INCORRECTCANCHANNELCMDRESPONSE18—
EMSACAN_ERR_FAILEDTOOPENCHANNEL19—
EMSACAN_ERR_FAILEDTOCLOSECHANNEL20—
EMSACAN_ERR_NOTCONNECTED21—
EMSACAN_ERR_FAILEDTOREADSERIALNUM22—
EMSACAN_ERR_STRCONVERTFAILED23—
EMSACAN_ERR_INVALIDCHANNEL24—
EMSACAN_ERR_FAILEDTOREADHARDWAREDESC25—
EMSACAN_ERR_INVALIDCLOCKVALUE26—
EMSACAN_ERR_FAILEDTOSENDTIME27—
EMSACAN_ERR_FAILEDTOGETTIME28—
EMSACAN_ERR_NOTAUTHORIZED29—
EMSACAN_ERR_PARAMETERCANNOTBEREAD30—
EMSACAN_ERR_PARAMETERREADFAILED31—
EMSACAN_ERR_INCORRECTPASSWORD32—
EMSACAN_ERR_INVALIDLICENSE33—
EMSACAN_ERR_INVALIDFINGERPRINT34—
EMSACAN_ERR_NOLICENSE35—
EMSACAN_ERR_FWUPDATE_ACTIVE36—
EMSACAN_ERR_FWUPDATE_UNSUPPORTED37—
EMSACAN_ERR_FWUPDATE_SEQUENCE38—
EMSACAN_ERR_BUSY39—
EMSACAN_ERR_FWUPDATE_IMAGE_REJECTED40—
EMSACAN_ERR_FWUPDATE_REMOTE_ABORT41—
EMSACAN_ERR_SELFTEST_ACTIVE42—
EMSACAN_ERR_SELFTEST_REMOTE_ABORT43—
EMSACAN_ERR_FILESYSTEM_ACTIVE44—
EMSACAN_ERR_INVALID_STATE45—
EMSACAN_ERR_SERVICE_UNAVAILABLE46—
EMSACAN_ERR_INTERFACE_NOT_FOUND47—
EMSACAN_ERR_NOT_SUPPORTED48—