Skip to content

Commit 250d290

Browse files
christiansandberghardbyte
authored andcommitted
Backport fix to can.player #690
Expose options to send or skip error frame messages
1 parent f69b162 commit 250d290

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

can/player.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def main():
4747
help='''Ignore timestamps (send all frames immediately with minimum gap between frames)''',
4848
action='store_false')
4949

50+
parser.add_argument(
51+
"--error-frames",
52+
help="Also send error frames to the interface.",
53+
action="store_true",
54+
)
55+
5056
parser.add_argument('-g', '--gap', type=float, help='''<s> minimum time between replayed frames''',
5157
default=0.0001)
5258
parser.add_argument('-s', '--skip', type=float, default=60*60*24,
@@ -68,6 +74,8 @@ def main():
6874
logging_level_name = ['critical', 'error', 'warning', 'info', 'debug', 'subdebug'][min(5, verbosity)]
6975
can.set_logging_level(logging_level_name)
7076

77+
error_frames = results.error_frames
78+
7179
config = {"single_handle": True}
7280
if results.interface:
7381
config["interface"] = results.interface
@@ -84,6 +92,8 @@ def main():
8492

8593
try:
8694
for m in in_sync:
95+
if m.is_error_frame and not error_frames:
96+
continue
8797
if verbosity >= 3:
8898
print(m)
8999
bus.send(m)

0 commit comments

Comments
 (0)