CAN DragonEmSA
functionLibrary Lifecycle

EmSACAN_Startup

Prototype

emsacan_result_t EmSACAN_Startup(
    int EnableExclusiveMode );

Description

Starts the library; call before any other API function.

Parameters

ParameterDirectionTypeDescription
EnableExclusiveModeinint0 = CDNet-mediated transport (requires running CDServer); 1 = exclusive USB/FTDI transport (legacy direct hardware access).

Return value

EMSACAN_OK on success, or another emsacan_result_t code on failure.

Example

/* Shared mode (default): allows concurrent access with other applications */
emsacan_result_t rc = EmSACAN_Startup(0);
if (rc != EMSACAN_OK) { /* initialization failed */ }

/* Exclusive mode: sole USB access per connected device */
rc = EmSACAN_Startup(1);