@@ -247,7 +247,7 @@ def __init__(
247247 raise ValueError (err_msg )
248248
249249 self .channel_info = str (channel )
250- self . fd = isinstance (timing , BitTimingFd ) if timing else kwargs .get ("fd" , False )
250+ is_fd = isinstance (timing , BitTimingFd ) if timing else kwargs .get ("fd" , False )
251251
252252 hwtype = PCAN_TYPE_ISA
253253 ioport = 0x02A0
@@ -271,7 +271,7 @@ def __init__(
271271 result = self .m_objPCANBasic .Initialize (
272272 self .m_PcanHandle , pcan_bitrate , hwtype , ioport , interrupt
273273 )
274- elif self . fd :
274+ elif is_fd :
275275 if isinstance (timing , BitTimingFd ):
276276 timing = check_or_adjust_timing_clock (
277277 timing , sorted (VALID_PCAN_FD_CLOCKS , reverse = True )
@@ -338,7 +338,9 @@ def __init__(
338338 if result != PCAN_ERROR_OK :
339339 raise PcanCanInitializationError (self ._get_formatted_error (result ))
340340
341- super ().__init__ (channel = channel , state = state , bitrate = bitrate , ** kwargs )
341+ super ().__init__ (
342+ channel = channel , is_fd = is_fd , state = state , bitrate = bitrate , ** kwargs
343+ )
342344
343345 def _find_channel_by_dev_id (self , device_id ):
344346 """
@@ -484,7 +486,7 @@ def _recv_internal(
484486 end_time = time .time () + timeout if timeout is not None else None
485487
486488 while True :
487- if self .fd :
489+ if self .is_fd :
488490 result , pcan_msg , pcan_timestamp = self .m_objPCANBasic .ReadFD (
489491 self .m_PcanHandle
490492 )
@@ -546,7 +548,7 @@ def _recv_internal(
546548 error_state_indicator = bool (pcan_msg .MSGTYPE & PCAN_MESSAGE_ESI .value )
547549 is_error_frame = bool (pcan_msg .MSGTYPE & PCAN_MESSAGE_ERRFRAME .value )
548550
549- if self .fd :
551+ if self .is_fd :
550552 dlc = dlc2len (pcan_msg .DLC )
551553 timestamp = boottimeEpoch + (pcan_timestamp .value / (1000.0 * 1000.0 ))
552554 else :
@@ -592,7 +594,7 @@ def send(self, msg, timeout=None):
592594 if msg .error_state_indicator :
593595 msgType |= PCAN_MESSAGE_ESI .value
594596
595- if self .fd :
597+ if self .is_fd :
596598 # create a TPCANMsg message structure
597599 CANMsg = TPCANMsgFD ()
598600
0 commit comments