on preStart
{
long klineHandle;
long channelNo;
long value;
channelNo = DiagGetCommParameter("CANoe.ChannelNumber");
klineHandle = KLine_CreateECURepresentation(channelNo);
write("KLine_CreateECURepresentation at K-Line%d returns %d", channelNo, klineHandle);
value = DiagGetCommParameter("KLine.InitType");
if (value == 1 /*FIVE_BAUD*/)
{
// For a 5 Baud ECU the initialization of the parameters must be done in prestart!
value = diagGetCommParameter("KLine.5BaudAddress");
// The timing parameters from the configuration are for the tester side, so use hard-coded ones here
status = KLine_Init5BaudEcuParams(value, 50 /* 5Bd */, 100, 10, 1, 35, 0, 650, 0 /*default*/);
write("Init 5Bd pattern for address 0x%02x returns %d", value, status);
}
}