ISO-TP_FORMAT_EXTENDED is not working
Posted: Sun 2. Jun 2024, 10:48
Hello
I am working on BMW TP protocol which is extended addressing mode.
test id is 0x6f1 and ECU is is 0x612
I have created TX module as below but I see always flow control error from a simulator since this source does not send '30' for TP response message. should I create my own command to send '30' message? or is there any bug for extended addressing mode? it looks like mapping.can_id_flow_ctrl is not working....
I am working on BMW TP protocol which is extended addressing mode.
test id is 0x6f1 and ECU is is 0x612
I have created TX module as below but I see always flow control error from a simulator since this source does not send '30' for TP response message. should I create my own command to send '30' message? or is there any bug for extended addressing mode? it looks like mapping.can_id_flow_ctrl is not working....
Code: Select all
mapping = cantp_mapping()
mapping.can_id = 0x6f1 # Extended CAN ID
mapping.can_id_flow_ctrl = 0x612 # Extended CAN ID for Flow Control
mapping.can_msgtype = PCANTP_CAN_MSGTYPE_STANDARD
Code: Select all
mapping.netaddrinfo.format = PCANTP_ISOTP_FORMAT_EXTENDED # extended adressing format from ISO 15765-2
mapping.netaddrinfo.msgtype = PCANTP_ISOTP_MSGTYPE_DIAGNOSTIC
mapping.netaddrinfo.target_type = PCANTP_ISOTP_ADDRESSING_PHYSICAL
Code: Select all
mapping.netaddrinfo.source_addr = 0xF1
mapping.netaddrinfo.target_addr = 0x12
mapping.netaddrinfo.extension_addr = 0x00
Code: Select all
# Add ISOTP mappings on channels
status = objPCANIsotp.AddMapping_2016(client_handle, mapping)
print("[ISOTP] Add a simple isotp mapping: %s" %(ISOTP_STATUS_OK_KO(status)))
Code: Select all
# Initialize ISOTP Tx message containing
tx_msg = cantp_msg()
status = objPCANIsotp.MsgDataAlloc_2016(tx_msg, PCANTP_MSGTYPE_ISOTP)
print("[ISOTP] Allocate ISOTP tx message: %s" %(ISOTP_STATUS_OK_KO(status)))
status = objPCANIsotp.MsgDataInit_2016(tx_msg, mapping.can_id, mapping.can_msgtype, MSG_SIZE, ISOTP_REQUEST_MSG, mapping.netaddrinfo)
print("[ISOTP] Initialize ISOTP tx message: %s" %(ISOTP_STATUS_OK_KO(status)))
##########################
while not parameters.stop_task:
status = PCANTP_STATUS_OK
while not objPCANIsotp.StatusIsOk_2016(status, PCANTP_STATUS_NO_MESSAGE, False):
status = objPCANIsotp.Write_2016(client_handle, tx_msg)
sleep(TX_SLEEP)
##########################