EmSACAN_Connect
Prototype
emsacan_result_t EmSACAN_Connect(
wchar_t *SerialNumber,
uint8_t DisableRTCUpdate,
const char *ClientName,
emsacan_handle_t *pHandle );
Description
Connects to a CAN interface by serial number.
Parameters
| Parameter | Direction | Type | Description |
|---|---|---|---|
SerialNumber | in | wchar_t | Wide string serial number of the device to open. |
DisableRTCUpdate | in | uint8_t | Non-zero to skip sending current date/time to the device. |
ClientName | in | const char | Optional UTF-8 display name for this client (NULL = anonymous). In CDNet-mediated mode this name appears as |
pHandle | out | emsacan_handle_t | Receives the session handle on success. |
Return value
EMSACAN_OK on success, or another emsacan_result_t code on failure.
Example
emsacan_handle_t handle = 0;
emsacan_result_t rc = EmSACAN_Connect(L"A1B2C3D4", 0, &handle);
if (rc != EMSACAN_OK)
{
wchar_t err[256];
EmSACAN_GetLastError(0, err, 256);
}
/* use handle for subsequent calls */
