Skip to main content

K-Line CAPL Functions

Open topic with navigation CAPL Functions » K-Line CAPL Functions Valid for: CANoe DE

ON THIS PAGE:


Callbacks

FunctionsShort Description
_Diag_ChannelStateChangedIndicates the state of the diagnostic channel.
_Diag_PreSendIs called before a frame is transmitted.
_KLine_ByteReceptionIndIs called when a byte has been received.
_KLine_ByteTransmissionConIs called when a byte has been transmitted.
_KLine_DataConCalled for a transmitted K-Line response.
_KLine_DataIndCalled for a received K-Line request.
_KLine_ErrorIndCalled when a protocol error occurred.
_KLine_FastInitPatternReceivedCalled when a fast init pattern has been received.
_KLine_FrameReceptionIndIs called when a frame has been received.
_KLine_FrameTransmissionConIs called when a frame has been transmitted.

Configuring and Controlling a K-Line ECU Simulation

FunctionsShort Description
DiagInitEcuSimulationInitialize CAPL node to represent a diagnostics ECU simulation.
DiagSendResponsePDUSends a raw byte buffer.
KLine_CreateECURepresentationInitialize K-Line ECU communication on given channel.
KLine_Init5BaudEcuParamsInitialize K-Line channel for reception of the 5 baud pattern.
KLine_ResetECUConnectionResets the connection state of the simulated ECU.
KLine_SendFrameSend data on the active K-Line communication channel.
KLine_SetP1ECUSets the interbyte time of a response.
KLine_SetP2maxSets the maximum time between the client request and the server response, or between 2 server responses.
KLine_SetP3maxSets the maximum time between the end of the server response and start of a new client request.

Configuring and Controlling a K-Line Tester

FunctionsShort Description
DiagSendRequestPDUSends a raw byte buffer.
KLine_EnableSegmentedResponsesEnables receiving segmented responses.
KLine_GetMeasuredInitParameterRetrieves the different parameters of the init patterns.
KLine_Set5BaudAddressTesterSets the 5 baud address for the 5 baud init pattern.
KLine_SetBaudrateAllows changing the baudrate during the measurement.
KLine_SetECUAddressSets the address of the ECU.
KLine_SetFunctionalAddressSets the functional address of the ECU.
KLine_SetHeaderFormatConfigures the used header format.
KLine_SetInitTypeConfigures the used initialization pattern.
KLine_SetP3TesterSets the P3 time which the tester waits until transmitting a further request.
KLine_SetP4TesterSets the interbyte time of a request.
KLine_SetTesterAddressSets the address of the tester.
KLine_SetUARTParameterConfigures the way bytes are sent on K-Line.
KLine_SetW4TesterSets the W4 timing of the tester between keybyte2 and keybyte2Not.
KLine_SetW5TesterSets the W5 timing before the tester starts to transmit the address byte.
KLine_SetWakeUpTimesTesterSets the timings of the fast init wake-up pattern.
KLine_SuppressAutomaticStopCommunicationFor a fast init ECU, automatic sending of a Stop communication command will be suppressed after closing the channel or a S3 timeout.
KLine_UseDefaultHeaderThe header format specified in the diagnostic description file will be used.

Controlling a Diagnostic Channel

These functions are not restricted to K-Line only.
FunctionsShort Description
DiagCloseChannelCloses a channel.
DiagConnectChannelConnects a channel.
DiagDisconnectChannelDisconnects a channel.
DiagIsChannelConnectedChecks if a channel is already in state Connected.

Test Feature Set for K-Line

FunctionsShort Description
TestGetWaitEventKLineByteIf a byte is the last event that triggers a wait instruction, the content can be called up with this function.
TestGetWaitEventKLineFrameIf a K-Line frame is the last event that triggers a wait instruction, the content can be called up with this function.
TestWaitForDiagChannelClosedWaits for the occurrence of the state change of a diagnostic channel to the state Closed.
TestWaitForDiagChannelConnectedWaits for the occurrence of the state change of a diagnostic channel to the state Connected.
TestWaitForDiagKLineByteReceivedWaits for the occurrence of a received byte.
TestWaitForDiagKLineByteTransmittedWaits for the occurrence of a transmitted byte.
TestWaitForDiagKLineFrameReceivedWaits for the occurrence of a received valid message.
TestWaitForDiagKLineFrameTransmittedWaits for the occurrence of a transmitted valid message.