Function CANTP_AddMapping with a target type Functional
Posted: Tue 10. Oct 2017, 11:39
Hello,
I'm trying to use CANTP_AddMapping function for target type functional.
According to my ECU specification :
CAN Broadcast id : 0x223
CAN tester id : 0x12B
First I wrote the following code :
To use it, I just wrote UDS_SvcReadDataByIdentifier and UDS_WaitForServiceFunctional with the parameter request.NETADDRINFO.TA = 0xF5;
I got the following CAN communication
As expected, the tester equipment sent on 0x223 and the ECU answered on 0x12B
But, my second mapping is wrong because I can get the answer from the ECU
After some modification, the best I can catch is the request from the tester itself
So due to my wrong mapping the tester ignore the ECU answer.
Could you explain me how to fix this?
Thank you in advance.
Best regards
Alexis
I'm trying to use CANTP_AddMapping function for target type functional.
According to my ECU specification :
CAN Broadcast id : 0x223
CAN tester id : 0x12B
First I wrote the following code :
Code: Select all
TPUDSStatus resultMap = CANTP_AddMapping(PCANTP_USBBUS1, //CanChannel
0x223, //canID
CAN_ID_NO_MAPPING, //canIDResponse
PCANTP_ID_CAN_11BIT, // canIdType
PCANTP_FORMAT_NORMAL, //formatType
PCANTP_MESSAGE_DIAGNOSTIC, // msgType
PUDS_SERVER_ADDR_TEST_EQUIPMENT, //sourceAddr
0xF5, // targetAddr
PCANTP_ADDRESSING_FUNCTIONAL, //targetType
0x00 // remoteAddr
);
...
resultMap = CANTP_AddMapping(PCANTP_USBBUS1, //CanChannel
0x12B, //canID
CAN_ID_NO_MAPPING, //canIDResponse
PCANTP_ID_CAN_11BIT, // canIdType
PCANTP_FORMAT_NORMAL, //formatType
PCANTP_MESSAGE_DIAGNOSTIC, // msgType
0xF5, //sourceAddr
PUDS_SERVER_ADDR_TEST_EQUIPMENT, // targetAddr
PCANTP_ADDRESSING_PHYSICAL, //targetType
0x00 // remoteAddr
);
I got the following CAN communication
Code: Select all
; Message Number
; | Time Offset (ms)
; | | Type
; | | | ID (hex)
; | | | | Data Length
; | | | | | Data Bytes (hex) ...
; | | | | | |
;---+-- ----+---- --+-- ----+--- + -+ -- -- -- -- -- -- --
1) 1403.4 Rx 0111 8 00 00 00 5D 6E 00 00 00 //not relevant
2) 1949.4 Rx 00000123 8 00 00 00 00 00 00 00 00 //not relevant
3) 2177.4 Rx 0223 8 03 22 FD 02 FF FF FF FF
4) 2179.5 Rx 012B 8 07 62 FD 02 00 00 02 22
5) 3950.4 Rx 00000123 8 00 00 00 00 00 00 00 00 //not relevant
6) 5951.3 Rx 00000123 8 00 00 00 00 00 00 00 00 //not relevant
7) 6404.2 Rx 0111 8 00 00 00 5D 6E 00 00 00 //not relevant
But, my second mapping is wrong because I can get the answer from the ECU
After some modification, the best I can catch is the request from the tester itself
Code: Select all
"UDS REQUEST from 0xF1 (to 0xF5, with RA 0x0) - result: 0 - OK !\n"
" -> Length: 3, Data= 22 FD 02"
Could you explain me how to fix this?
Thank you in advance.
Best regards
Alexis