@@ -709,10 +709,10 @@ class J2534Connection(BaseConnection):
709
709
:type name: string
710
710
:param debug: This will enable windows debugging mode in the dll (see tactrix doc for additional information)
711
711
:type debug: boolean
712
- :param args: Optional parameters list (Unused right now).
713
- :type args: list
714
- :param kwargs: Optional parameters dictionary Unused right now).
715
- :type kwargs: dict
712
+ :param protocol: CAN protocol
713
+ :type protocol: Protocol_ID
714
+ :param baudrate: Operation bauderate
715
+ :type baudrate: int
716
716
717
717
"""
718
718
@@ -727,23 +727,29 @@ class J2534Connection(BaseConnection):
727
727
exit_requested : bool
728
728
opened : bool
729
729
730
- def __init__ (self , windll : str , rxid : int , txid : int , name : Optional [str ] = None , debug : bool = False , * args , ** kwargs ):
730
+ def __init__ (self ,
731
+ windll : str ,
732
+ rxid : int ,
733
+ txid : int ,
734
+ name : Optional [str ] = None ,
735
+ debug : bool = False ,
736
+ protocol = None ,
737
+ baudrate = 500000 ,
738
+ ):
731
739
BaseConnection .__init__ (self , name )
732
740
733
- # Set up a J2534 interface using the DLL provided
734
- try :
735
- self .interface = J2534 (windll = windll , rxid = rxid , txid = txid )
736
- except FileNotFoundError :
737
- raise RuntimeError ('DLL not found' )
738
-
739
- # Set the protocol to ISO15765, Baud rate to 500000
740
- self .protocol = Protocol_ID .ISO15765
741
- self .baudrate = 500000
741
+ self .protocol = protocol if protocol else Protocol_ID .ISO15765
742
+ self .baudrate = baudrate
742
743
self .debug = debug
743
744
744
745
try :
746
+ # Set up a J2534 interface using the DLL provided
747
+ self .interface = J2534 (windll = windll , rxid = rxid , txid = txid )
748
+
745
749
# Open the interface (connect to the DLL)
746
750
self .result , self .devID = self .interface .PassThruOpen ()
751
+ except FileNotFoundError :
752
+ raise RuntimeError ('DLL not found' )
747
753
except OSError as e :
748
754
if e .errno in [0x16 , 0xe06d7363 ]:
749
755
raise RuntimeError ('J2534 Device busy' )
@@ -771,7 +777,7 @@ def __init__(self, windll: str, rxid: int, txid: int, name: Optional[str] = None
771
777
self .log_last_operation ("PassThruConnect" , with_raise = True )
772
778
773
779
configs = SCONFIG_LIST ([
774
- (Ioctl_ID .DATA_RATE .value , 500000 ),
780
+ (Ioctl_ID .DATA_RATE .value , self . baudrate ),
775
781
(Ioctl_ID .LOOPBACK .value , 0 ),
776
782
(Ioctl_ID .ISO15765_BS .value , 0x20 ),
777
783
(Ioctl_ID .ISO15765_STMIN .value , 0 ),
0 commit comments