How can I send and receive XCP Raw CTO frames with CASL?
With CASL not only diagnostic messages can be sent but also XCP CTOs. Using the standard approach also used with diagnose (using DiagRaw Messages, see example) the user can send XCP commands and access raw data of the responses. The only difference is that the respective device is an XCP device. The following example shows a short script sending a XCP command (0xFF 0x00) from CANape to the ECU and printing the first byte of the response to the write window:
handle_tx = XCPsim.DiagNewRawMessage(0xFF,0x00); //Building Tx message
handle_rx = XCPsim.DiagSendRequest(handle_tx); //Sending Tx message
//Response is received and accessible via handle_rx
Write("Output is %d", DiagGetRaw(handle_rx, 0)); //Printing first res byte