Page 1 of 1

UDS Service request Using 0xBE System Supplier

Posted: Wed 9. Nov 2022, 05:24
by Shail
Hello,
I need to send UDS Service with system supplier UDS Service ID 0xBE.
it is part of the UDS 14229 spec, under the user defined services

Is any way we can send request using PEAK PCAN-UDS 2.x API
PCAN-UDS_2013.h
PCAN-ISO-TP_2016.h
PCANBasic.h

Service request format : 10 13 BE 10 03 22 24 26
where 0x10 is the First Frame Indication, 0x13 is the size(number of bytes which will be next transmitted)
0XBE : UDS Service ID.

How to send such request using PEAK UDS API ?

Re: UDS Service request Using 0xBE System Supplier

Posted: Wed 9. Nov 2022, 14:52
by K.Wagner
Hello,

the UDS service 0xBE is not one of the standard UDS service requests, so there is no "UDS_Srv***_2013" function for it in the API, like SvcDiagnosticSessionControl_2013. In order to send such a request, you need to use the function UDS_Write_2013. You need to specify the data needed for the service within the uds_msg buffer.

This should be something like:

Code: Select all

    uint8_t SERVICE_IDENTIFIER = 0xBE;
    uint32_t DATA_SIZE = 0x13;
    uint8_t request_data[DATA_SIZE];
    
    cantp_handle channel= cantp_handle.PCANTP_HANDLE_USBBUS1;
    uds_msgconfig request_config= new uds_msgconfig(); // Fill the request_config as needed
    uds_msg msg_buffer = new uds_msg();      
    
    status = UDS_MsgAlloc_2013(msg_buffer, request_config, DATA_SIZE); 
    if (UDS_StatusIsOk_2013(status))
    {
        *out_msg_request->links.service_id = SERVICE_IDENTIFIER;
        memcpy(&msg_buffer->links.param[0], request_data, DATA_SIZE);
        status = UDS_Write_2013(channel, msg_buffer);
    }
More Info about UDS_Write_2013 can be found in the documentation, chapter 3.7.78

Re: UDS Service request Using 0xBE System Supplier

Posted: Wed 9. Nov 2022, 14:55
by K.Wagner
Admin: --> Topic moved from Hardware/PCAN-USB to Development Packages/PCAN-UDS <--

Re: UDS Service request Using 0xBE System Supplier

Posted: Thu 15. Dec 2022, 09:43
by Shail
Hello,

We are writing application in c++.

1) How to define msg_buffer in your example ? if so uds_msg msg_buffer = new uds_msg(); What is header file required for same?
When We define uds_msg *msg_buffer = NULL We are getting error code 9 PCAN_STATUS_PARAM_INVALID_VALUE in status

Code: Select all

           status = UDS_MsgAlloc_2013(msg_buffer, *config, DATA_SIZE);
		if (UDS_StatusIsOk_2013(status_cbme))
		{
			*msg_buffer->links.service_id = SERVICE_IDENTIFIER;

			memcpy(&msg_buffer->links.param[0], request_data, DATA_SIZE); 
			status_cbme = UDS_Write_2013(channel, msg_buffer);
		}
Thanks and Regards,
Shail Shah

Re: UDS Service request Using 0xBE System Supplier

Posted: Thu 15. Dec 2022, 10:24
by F.Vergnaud
Hello,

You need to include "PCAN-UDS_2013.h". You can also find working samples in the PCAN-UDS package.