File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 41
41
log .error ("socket.CMSG_SPACE not available on this platform" )
42
42
43
43
44
+ # Constants needed for precise handling of timestamps
45
+ RECEIVED_TIMESTAMP_STRUCT = struct .Struct ("@ll" )
46
+ RECEIVED_ANCILLARY_BUFFER_SIZE = (
47
+ CMSG_SPACE (RECEIVED_TIMESTAMP_STRUCT .size ) if CMSG_SPACE_available else 0
48
+ )
49
+
50
+
44
51
# Setup BCM struct
45
52
def bcm_header_factory (
46
53
fields : List [Tuple [str , Union [Type [ctypes .c_uint32 ], Type [ctypes .c_long ]]]],
@@ -597,12 +604,6 @@ def capture_message(
597
604
return msg
598
605
599
606
600
- # Constants needed for precise handling of timestamps
601
- if CMSG_SPACE_available :
602
- RECEIVED_TIMESTAMP_STRUCT = struct .Struct ("@ll" )
603
- RECEIVED_ANCILLARY_BUFFER_SIZE = CMSG_SPACE (RECEIVED_TIMESTAMP_STRUCT .size )
604
-
605
-
606
607
class SocketcanBus (BusABC ): # pylint: disable=abstract-method
607
608
"""A SocketCAN interface to CAN.
608
609
You can’t perform that action at this time.
0 commit comments