@@ -153,7 +153,10 @@ def _parse_msg_v1_0(self, cols: tuple[str, ...]) -> Optional[Message]:
153153 msg .is_extended_id = len (arbit_id ) > 4
154154 msg .channel = 1
155155 msg .dlc = int (cols [3 ])
156- msg .data = bytearray ([int (cols [i + 4 ], 16 ) for i in range (msg .dlc )])
156+ if len (cols ) > 4 and cols [4 ] == "RTR" :
157+ msg .is_remote_frame = True
158+ else :
159+ msg .data = bytearray ([int (cols [i + 4 ], 16 ) for i in range (msg .dlc )])
157160 return msg
158161
159162 def _parse_msg_v1_1 (self , cols : tuple [str , ...]) -> Optional [Message ]:
@@ -165,7 +168,10 @@ def _parse_msg_v1_1(self, cols: tuple[str, ...]) -> Optional[Message]:
165168 msg .is_extended_id = len (arbit_id ) > 4
166169 msg .channel = 1
167170 msg .dlc = int (cols [4 ])
168- msg .data = bytearray ([int (cols [i + 5 ], 16 ) for i in range (msg .dlc )])
171+ if len (cols ) > 5 and cols [5 ] == "RTR" :
172+ msg .is_remote_frame = True
173+ else :
174+ msg .data = bytearray ([int (cols [i + 5 ], 16 ) for i in range (msg .dlc )])
169175 msg .is_rx = cols [2 ] == "Rx"
170176 return msg
171177
@@ -178,7 +184,10 @@ def _parse_msg_v1_3(self, cols: tuple[str, ...]) -> Optional[Message]:
178184 msg .is_extended_id = len (arbit_id ) > 4
179185 msg .channel = int (cols [2 ])
180186 msg .dlc = int (cols [6 ])
181- msg .data = bytearray ([int (cols [i + 7 ], 16 ) for i in range (msg .dlc )])
187+ if len (cols ) > 7 and cols [7 ] == "RTR" :
188+ msg .is_remote_frame = True
189+ else :
190+ msg .data = bytearray ([int (cols [i + 7 ], 16 ) for i in range (msg .dlc )])
182191 msg .is_rx = cols [3 ] == "Rx"
183192 return msg
184193
@@ -200,7 +209,8 @@ def _parse_msg_v2_x(self, cols: tuple[str, ...]) -> Optional[Message]:
200209 msg .is_extended_id = len (cols [self .columns ["I" ]]) > 4
201210 msg .channel = int (cols [bus ]) if bus is not None else 1
202211 msg .dlc = dlc
203- if dlc :
212+ msg .is_remote_frame = type_ in {"RR" }
213+ if dlc and not msg .is_remote_frame :
204214 msg .data = bytearray .fromhex (cols [self .columns ["D" ]])
205215 msg .is_rx = cols [self .columns ["d" ]] == "Rx"
206216 msg .is_fd = type_ in {"FD" , "FB" , "FE" , "BI" }
@@ -227,7 +237,7 @@ def _parse_cols_v1_3(self, cols: tuple[str, ...]) -> Optional[Message]:
227237
228238 def _parse_cols_v2_x (self , cols : tuple [str , ...]) -> Optional [Message ]:
229239 dtype = cols [self .columns ["T" ]]
230- if dtype in {"DT" , "FD" , "FB" , "FE" , "BI" }:
240+ if dtype in {"DT" , "FD" , "FB" , "FE" , "BI" , "RR" }:
231241 return self ._parse_msg_v2_x (cols )
232242 else :
233243 logger .info ("TRCReader: Unsupported type '%s'" , dtype )
0 commit comments