Skip to content

Commit a613eeb

Browse files
authored
Merge pull request #884 from ebroecker/adapt_#872
resend #872 after merging several other prs
2 parents a8d0559 + 57122ca commit a613eeb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/canmatrix/CanMatrix.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def delete_obsolete_defines(self): # type: () -> None
279279
for element in defines_to_delete:
280280
del self.signal_defines[element]
281281

282-
def frame_by_id(self, arbitration_id): # type: (ArbitrationId) -> typing.Union[Frame, None]
282+
def get_frame_by_id(self, arbitration_id): # type: (ArbitrationId) -> typing.Union[Frame, None]
283283
"""Get Frame by its arbitration id.
284284
285285
:param ArbitrationId arbitration_id: Frame id as canmatrix.ArbitrationId
@@ -296,6 +296,17 @@ def frame_by_id(self, arbitration_id): # type: (ArbitrationId) -> typing.Union[
296296
self._frames_dict_id_extend[hash_name] = frame
297297
return frame
298298
return None
299+
300+
def frame_by_id(self, arbitration_id): # type: (ArbitrationId) -> typing.Union[Frame, None]
301+
"""Get Frame by its arbitration id.
302+
:param ArbitrationId arbitration_id: Frame id as canmatrix.ArbitrationId
303+
:rtype: Frame or None
304+
"""
305+
for test in self.frames:
306+
if test.arbitration_id == arbitration_id:
307+
# found ID while ignoring extended or standard
308+
return test
309+
return None
299310

300311
def frame_by_header_id(self, header_id): # type: (HeaderId) -> typing.Union[Frame, None]
301312
"""Get Frame by its Header id.

0 commit comments

Comments
 (0)