@@ -982,7 +982,8 @@ def _process_rx(self, msg: CanMessage) -> ProcessRxReport:
982
982
immediate_tx_msg_required = True
983
983
984
984
return self .ProcessRxReport (immediate_tx_required = immediate_tx_msg_required , frame_received = frame_complete )
985
-
985
+
986
+
986
987
def _process_tx (self ) -> ProcessTxReport :
987
988
"""Process the transmit state machine"""
988
989
output_msg = None # Value outputted. If None, no subsequent call to _process_tx will be done.
@@ -1076,7 +1077,7 @@ def _process_tx(self) -> ProcessTxReport:
1076
1077
if total_size <= self .params .tx_data_length - size_offset - len (self .address .get_tx_payload_prefix ()):
1077
1078
# Will raise if size is not what was requested
1078
1079
payload = self .active_send_request .generator .consume (total_size , enforce_exact = True )
1079
-
1080
+
1080
1081
if size_on_first_byte :
1081
1082
msg_data = self .address .get_tx_payload_prefix () + bytearray ([0x0 | len (payload )]) + payload
1082
1083
else :
@@ -1090,7 +1091,8 @@ def _process_tx(self) -> ProcessTxReport:
1090
1091
self .tx_state = self .TxState .TRANSMIT_SF_STANDBY
1091
1092
else :
1092
1093
output_msg = msg_temp
1093
-
1094
+ self ._stop_sending (success = True )
1095
+
1094
1096
# Multi frame - First Frame
1095
1097
else :
1096
1098
self .tx_frame_length = total_size
@@ -1125,7 +1127,6 @@ def _process_tx(self) -> ProcessTxReport:
1125
1127
# This states serves if the rate limiter prevent from starting a new transmission.
1126
1128
# We need to pop the isotp frame to know if the rate limiter must kick, but since the data is already popped,
1127
1129
# we can't stay in IDLE state. So we come here until the rate limiter gives us permission to proceed.
1128
-
1129
1130
if self .tx_standby_msg is not None :
1130
1131
if len (self .tx_standby_msg .data ) <= allowed_bytes :
1131
1132
output_msg = self .tx_standby_msg
@@ -1151,7 +1152,7 @@ def _process_tx(self) -> ProcessTxReport:
1151
1152
payload = self .active_send_request .generator .consume (payload_length , enforce_exact = False )
1152
1153
if len (payload ) > 0 : # Corner case. If generator size is a multiple of ll_data_length, we will get an empty payload on last frame.
1153
1154
msg_data = self .address .get_tx_payload_prefix () + bytearray ([0x20 | self .tx_seqnum ]) + payload
1154
- arbitration_id = self .address .get_tx_arbitration_id ()
1155
+ arbitration_id = self .address .get_tx_arbitration_id ()
1155
1156
output_msg = self ._make_tx_msg (arbitration_id , msg_data )
1156
1157
self .tx_seqnum = (self .tx_seqnum + 1 ) & 0xF
1157
1158
self .timer_tx_stmin .start ()
0 commit comments