I cannot enter the extended mode with the following code. Where is the problem
Code: Select all
status = UDS_Initialize_2013(channel, PCANTP_BAUDRATE_500K, (cantp_hwtype)0, 0, 0);
printf("Initialize channel: %s\n", UDS_STATUS_OK_KO(status));
uint8_t tmp_buffer = PCANTP_ISO_TIMEOUTS_15765_4;
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_ISO_TIMEOUTS, &tmp_buffer, sizeof(tmp_buffer));
tmp_buffer = 32;
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_SEPARATION_TIME, &tmp_buffer, sizeof(tmp_buffer));//stmin
tmp_buffer = 8;
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_BLOCK_SIZE, &tmp_buffer, sizeof(tmp_buffer));//blocksize
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_CAN_TX_DL, &tmp_buffer, sizeof(tmp_buffer));//tx_data_length
tmp_buffer = 0;
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_CAN_PADDING_VALUE, &tmp_buffer, sizeof(tmp_buffer));//tx_padding
uint32_t tmp_buffer1 = 1000;
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_TIMEOUT_REQUEST, &tmp_buffer1, sizeof(tmp_buffer1));
status = UDS_SetValue_2013(channel, PUDS_PARAMETER_TIMEOUT_RESPONSE, &tmp_buffer1, sizeof(tmp_buffer1));
uds_status result;
uds_msg request;
uds_msg request_confirmation;
uds_msg response;
uds_msgconfig config;
memset(&request, 0, sizeof(request));
memset(&request_confirmation, 0, sizeof(request_confirmation));
memset(&response, 0, sizeof(response));
memset(&config, 0, sizeof(config));
// Set request message configuration
config.can_id = PUDS_ISO_15765_4_CAN_ID_FUNCTIONAL_REQUEST;
config.can_msgtype = PCANTP_CAN_MSGTYPE_ECHO;
config.nai.extension_addr = 0x0;
config.nai.protocol = PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL;
config.nai.source_addr = PUDS_ISO_15765_4_ADDR_TEST_EQUIPMENT;
config.nai.target_addr = PUDS_ISO_15765_4_ADDR_ECU_1;
config.nai.target_type = PCANTP_ISOTP_ADDRESSING_FUNCTIONAL;
config.type = PUDS_MSGTYPE_USDT;
result = UDS_SvcDiagnosticSessionControl_2013(channel, config, &request, PUDS_SVC_PARAM_DSC_ECUEDS);
// WaitForService_2013