I try to use the UDS library and to activate the data padding.
I've started from the "02_client_resquest_ecu_reset_USDT" C# sample project and I've made some modification to adapt it to my need as you can see in the code below.
Unfortunately even with the parameter set to 0x01 value that corresponds to padding_ON, it doesn't work.
Do I use the "UDSApi.SetValue_2013" function in the right way ?
Thanks for support.
Regards.
Code: Select all
// Print version informations
status = UDSApi.GetValue_2013(cantp_handle.PCANTP_HANDLE_NONEBUS, uds_parameter.PUDS_PARAMETER_API_VERSION, buffer, BUFFER_SIZE);
Console.WriteLine("PCAN-UDS API Version - {0}: {1}", buffer, STATUS_OK_KO(status));
string bauderate = "f_clock=80000000, nom_brp=1, nom_tseg1=127, nom_tseg2=32, nom_sjw=32, data_brp=1, data_tseg1=31, data_tseg2=8, data_sjw=8";
// Initialize client
status = UDSApi.InitializeFD_2013(tp_handle, bauderate);
Console.WriteLine("Initialize channel: {0}", STATUS_OK_KO(status));
status = UDSApi.SetValue_2013(tp_handle, uds_parameter.PUDS_PARAMETER_CAN_DATA_PADDING, new byte[] {0x01}, 1);
Console.WriteLine("Set Padding: {0}", STATUS_OK_KO(status));
// Initialize a physical configuration
config_physical.can_id = (UInt32)0x14DA65F1;
config_physical.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_FD | cantp_can_msgtype.PCANTP_CAN_MSGTYPE_EXTENDED;
config_physical.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_29B_EXTENDED;
config_physical.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;
config_physical.type = uds_msgtype.PUDS_MSGTYPE_UUDT;
//config_physical.nai.source_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
//config_physical.nai.target_addr = (UInt16)uds_address.PUDS_ADDRESS_ISO_15765_4_ADDR_ECU_1;
config_physical.nai.extension_addr = 0x52;
// Execute ECUReset and wait response
status = UDSApi.SvcECUReset_2013(tp_handle, config_physical, out msg_request, UDSApi.uds_svc_param_er.PUDS_SVC_PARAM_ER_HR);
Console.WriteLine("Execute ECUReset service: {0}", STATUS_OK_KO(status));
status = UDSApi.WaitForService_2013(tp_handle, ref msg_request, out response, out request_confirmation);
Console.WriteLine("Wait for service: {0}", STATUS_OK_KO(status));