CAN DragonEmSA
functionStatus

EmSACAN_IsConfigurationLocked

Prototype

emsacan_result_t EmSACAN_IsConfigurationLocked(
    emsacan_handle_t Handle,
    uint8_t ChannelNumber,
    int *pLocked );

Description

Reports whether channel configuration is locked for the given port.

Parameters

ParameterDirectionTypeDescription
Handleinemsacan_handle_tSession handle from EmSACAN_Connect.
ChannelNumberinuint8_tZero-based port index.
pLockedoutintOn success, set to 0 (false) or 1 (true). Configuration is locked when this client cannot apply SET_CHANNEL_CONFIG for the port: the channel is configured and this handle is not the sole connected client on that channel (CDNet-mediated mode only).

Return value

EMSACAN_OK on success, or another emsacan_result_t code on failure.

Example

int locked = 0;
if (EmSACAN_IsConfigurationLocked(handle, 0, &locked) == EMSACAN_OK)
{
    if (locked)
        { /* read existing config instead of writing */ }
}

See also