File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -554,6 +554,15 @@ def __init__(
554
554
1 ,
555
555
)
556
556
557
+ # enable canMSG_LOCAL_TXACK flag in received messages
558
+
559
+ canIoCtlInit (
560
+ self ._read_handle ,
561
+ canstat .canIOCTL_SET_LOCAL_TXACK ,
562
+ ctypes .byref (ctypes .c_byte (local_echo )),
563
+ 1 ,
564
+ )
565
+
557
566
if self .single_handle :
558
567
log .debug ("We don't require separate handles to the bus" )
559
568
self ._write_handle = self ._read_handle
@@ -671,6 +680,7 @@ def _recv_internal(self, timeout=None):
671
680
is_remote_frame = bool (flags & canstat .canMSG_RTR )
672
681
is_error_frame = bool (flags & canstat .canMSG_ERROR_FRAME )
673
682
is_fd = bool (flags & canstat .canFDMSG_FDF )
683
+ is_rx = not bool (flags & canstat .canMSG_LOCAL_TXACK )
674
684
bitrate_switch = bool (flags & canstat .canFDMSG_BRS )
675
685
error_state_indicator = bool (flags & canstat .canFDMSG_ESI )
676
686
msg_timestamp = timestamp .value * TIMESTAMP_FACTOR
@@ -682,6 +692,7 @@ def _recv_internal(self, timeout=None):
682
692
is_error_frame = is_error_frame ,
683
693
is_remote_frame = is_remote_frame ,
684
694
is_fd = is_fd ,
695
+ is_rx = is_rx ,
685
696
bitrate_switch = bitrate_switch ,
686
697
error_state_indicator = error_state_indicator ,
687
698
channel = self .channel ,
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ def CANSTATUS_SUCCESS(status):
63
63
canMSG_ERROR_FRAME = 0x0020
64
64
canMSG_TXACK = 0x0040
65
65
canMSG_TXRQ = 0x0080
66
+ canMSG_LOCAL_TXACK = 0x1000_0000
66
67
67
68
canFDMSG_FDF = 0x010000
68
69
canFDMSG_BRS = 0x020000
@@ -195,6 +196,7 @@ def CANSTATUS_SUCCESS(status):
195
196
canIOCTL_GET_USB_THROTTLE = 29
196
197
canIOCTL_SET_BUSON_TIME_AUTO_RESET = 30
197
198
canIOCTL_SET_LOCAL_TXECHO = 32
199
+ canIOCTL_SET_LOCAL_TXACK = 46
198
200
canIOCTL_PREFER_EXT = 1
199
201
canIOCTL_PREFER_STD = 2
200
202
canIOCTL_CLEAR_ERROR_COUNTERS = 5
You can’t perform that action at this time.
0 commit comments