Error 0x00040009 with UDSApi.Write_2013
Posted: Fri 10. Sep 2021, 15:31
Hello,
I have a problem writing UDS requests on the bus. Initializing worked (PCANTP_HANDLE_PCIBUS2;PCANTP_BAUDRATE_500K). For message configuration I followed the provided samples. Here is the code:
The UDSApi.MsgAlloc_2013 returns the status "PUDS_STATUS_CAUTION_INPUT_MODIFIED", but the method "UDSApi.StatusIsOk_2013(PUDS_STATUS_CAUTION_INPUT_MODIFIED)" returns true, so I guess that is just a warning and can be ignored!?
However the call to UDSApi.Write_2013 failed.
What am I missing? Could it be a mapping? I haven't understood the mapping stuff yet.
I have a problem writing UDS requests on the bus. Initializing worked (PCANTP_HANDLE_PCIBUS2;PCANTP_BAUDRATE_500K). For message configuration I followed the provided samples. Here is the code:
Code: Select all
request = new byte[] { 0x22, 0x42, 0x85 }
//initialize message configuration
uds_msgconfig msgconfig = new uds_msgconfig();
msgconfig.can_id = 0xFFFFFFFF;
msgconfig.can_msgtype = cantp_can_msgtype.PCANTP_CAN_MSGTYPE_STANDARD;
msgconfig.nai.protocol = uds_msgprotocol.PUDS_MSGPROTOCOL_ISO_15765_2_11B_NORMAL;
msgconfig.nai.target_type = cantp_isotp_addressing.PCANTP_ISOTP_ADDRESSING_PHYSICAL;
msgconfig.type = uds_msgtype.PUDS_MSGTYPE_USDT;
msgconfig.nai.source_addr = 0x6F1;
msgconfig.nai.target_addr = 0x610;
//setup request
uds_msg msg_request = new uds_msg();
uds_status status = UDSApi.MsgAlloc_2013(out msg_request, msgconfig, (uint)request.Length); //--> PUDS_STATUS_CAUTION_INPUT_MODIFIED
bool success = CanTpApi.setData_2016(ref msg_request.msg, 0, request, request.Length); // --> true
status = UDSApi.Write_2013(_canChannel, ref msg_request); // --> {Wrong message parameters; input was modified by the API}-0x00040009
However the call to UDSApi.Write_2013 failed.
What am I missing? Could it be a mapping? I haven't understood the mapping stuff yet.