UDS Service request Using 0xBE System Supplier

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
Shail
Posts: 49
Joined: Tue 28. Apr 2020, 10:09

UDS Service request Using 0xBE System Supplier

Post by Shail » Wed 9. Nov 2022, 05:24

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 ?

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: UDS Service request Using 0xBE System Supplier

Post by K.Wagner » Wed 9. Nov 2022, 14:52

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
Best regards,
Keneth

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: UDS Service request Using 0xBE System Supplier

Post by K.Wagner » Wed 9. Nov 2022, 14:55

Admin: --> Topic moved from Hardware/PCAN-USB to Development Packages/PCAN-UDS <--
Best regards,
Keneth

Shail
Posts: 49
Joined: Tue 28. Apr 2020, 10:09

Re: UDS Service request Using 0xBE System Supplier

Post by Shail » Thu 15. Dec 2022, 09:43

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
Last edited by F.Vergnaud on Thu 15. Dec 2022, 10:22, edited 1 time in total.
Reason: code formatting

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: UDS Service request Using 0xBE System Supplier

Post by F.Vergnaud » Thu 15. Dec 2022, 10:24

Hello,

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

Post Reply