File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -212,12 +212,7 @@ def __init__(
212
212
self .m_objPCANBasic = PCANBasic ()
213
213
self .m_PcanHandle = channel
214
214
215
- apv = self .get_api_version ()
216
- if apv < MIN_PCAN_API_VERSION :
217
- raise CanInitializationError (
218
- f"Minimum version of pcan api is { MIN_PCAN_API_VERSION } ."
219
- f" Installed version is { apv } . Consider upgrade of pcan basic package"
220
- )
215
+ self .check_api_version ()
221
216
222
217
if state is BusState .ACTIVE or state is BusState .PASSIVE :
223
218
self .state = state
@@ -324,6 +319,14 @@ def get_api_version(self):
324
319
325
320
return version .parse (value .decode ("ascii" ))
326
321
322
+ def check_api_version (self ):
323
+ apv = self .get_api_version ()
324
+ if apv < MIN_PCAN_API_VERSION :
325
+ raise CanInitializationError (
326
+ f"Minimum version of pcan api is { MIN_PCAN_API_VERSION } ."
327
+ f" Installed version is { apv } . Consider upgrade of pcan basic package"
328
+ )
329
+
327
330
def status (self ):
328
331
"""
329
332
Query the PCAN bus status.
You can’t perform that action at this time.
0 commit comments