Purpose

Queries the current session status from an ECU slave device. Format

mcTypeStatus mcXCPGetStatus(
mcTypeTaskRef ECURefNum,
u8 *SessionStatus,
u8 *ResourceMask,
u16 *SessionId);

Input

ECURefNum

ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from . Output

SessionStatus

SessionStatus returns the current status of the selected ECU.

ResourceMask

ResourceMask is the current resource protection status of the selected ECU.

SessionId

SessionId returns the defined session configuration ID.

Return Value

The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.

Use the function of the ECU M&C API to obtain a descriptive string for the return value.

Description

implements the XCP command GET_STATUS and returns all current status information of the selected ECU slave device, including the status of the resource protection, pending store requests and the general status of data acquisition and stimulation.

Current Session Status

SessionStatus contains a bit mask which is described below:

Bit Number Flag Description
0 STORE_CAL_REQ REQuest to STORE CALibration data:

0—STORE_CAL_REQ mode is reset.

1—STORE_CAL_REQ mode is set.

1 Unused
2 STORE_DAQ_REQ REQuest to STORE DAQ list:

0—STORE_DAQ_REQ mode is reset.

1—STORE_DAQ_REQ mode is set.

3 CLEAR_DAQ_REQ REQuest to CLEAR DAQ configuration:

0—CLEAR_DAQ_REQ is reset.

1—CLEAR_DAQ_REQ is set.

4 Unused
5 Unused
6 DAQ_RUNNING Data Transfer:

0—The data transfer is not running.

1—The data transfer is running.

7 RESUME RESUME Mode:

0—The slave device is not in RESUME mode.

1—The slave device is in RESUME mode.

The STORE_CAL_REQ flag indicates a pending request to save the calibration data into non-volatile memory. As soon as the request has been fulfilled, the slave will reset the appropriate bit. The slave device may indicate this by transmitting an EV_STORE_CAL event packet.

The STORE_DAQ_REQ flag indicates a pending request to save the DAQ list setup in non-volatile memory. As soon as the request has been fulfilled, the slave will reset the appropriate bit. The slave device may indicate this by transmitting an EV_STORE_DAQ event packet.

The CLEAR_DAQ_REQ flag indicates a pending request to clear all DAQ lists in non-volatile memory. All ODT entries are reset to address = 0, extension = 0, size = 0 and bit_offset = FF. Session configuration ID is reset to 0. As soon as the request has been fulfilled, the slave will reset the appropriate bit. The slave device may indicate this by transmitting an EV_CLEAR_DAQ event packet. If the slave device does not support the requested mode, an ERR_OUT_OF_RANGE is returned.

The DAQ_RUNNING flag indicates that at least one DAQ list has been started and is in RUNNING mode.

The RESUME flag indicates that the slave is in RESUME mode.

ResourceMask contains the current resource protection status as a bit mask described below:

Bit Number Flag Description
0 CAL/PAG REQuest to STORE CALibration data:

0—STORE_CAL_REQ mode is reset.

1—STORE_CAL_REQ mode is set.

1 Unused
2 DAQ DAQ list commands (DIRECTION = DAQ):

0—DAQ list commands are not protected with SEED & Key mechanism.

1—DAQ list commands are protected with SEED & Key mechanism.

3 STIM DAQ list commands (DIRECTION = STIM):

0—DAQ list commands are not protected with SEED & Key mechanism.

1—DAQ list commands are protected with SEED & Key mechanism.

4 PGM ProGraMming commands:

0—ProGraMming commands are not protected with SEED & Key mechanism.

1—ProGraMming commands are protected with SEED & Keyamp; mechanism

5 Unused
6 Unused
7 Unused

The CAL/PAG flags indicates that all commands of the CALibration/PAGing group are protected and will return an ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED/UNLOCK sequence.

The PGM flags indicates that all the commands of the ProGraMming group are protected and will return a ERR_ACCESS_LOCKED upon an attempt to execute the command without a previous successful GET_SEED/UNLOCK sequence.

The parameter SessionId contains the Session configuration ID. The session configuration ID must be set by a prior call with STORE_DAQ_REQ set. This allows the master device to verify that automatically started DAQ lists contain the expected data transfer configuration.