Is there a way to get out the raw data from an UDS Response?
I tried sending a Testerpresent
"ID = 0x281; D0=02 D1=3E D2=00 D3=55 D4=55 D5=55 D6=55 D7=55"
and the ECU is responding correct with:
"ID = 0x2C1; D0=02 D1=7E D2=00 D3=00 D4=00 D5=00 D6=00 D7=00"
But in my Software (code is below), the datalength of "resp " is only 2 Byte and the data in the "managedArray1" after Marshal.Copy is:
D0 = 0x7E, all other bytes in the message are 0
I would expect a datalength of 8 byte and getting the full raw payload of the response message of the ECU. Is this possible?
Code: Select all
...
uds_msg request = new uds_msg();
uds_msg response_uds = new uds_msg();
uds_msg request_confirmation = new uds_msg();
// send requ. and wait until service has been entered
UDSApi.SvcTesterPresent_2013(handle, config, out request);
UDSApi.WaitForService_2013(handle, ref request, out response_uds, out request_confirmation);
// Get Message from response_uds structure
cantp_msgdata_can resp = response_uds.msg.Msgdata_can_Copy;
// Copy to byte array
byte[] managedArray1 = new byte[64];
Marshal.Copy(resp.data, managedArray1, 0, (int)resp.length);
...