-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1286e4
commit 35607b8
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2022-present Artur Drogunow <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import copy | ||
import ctypes | ||
import fnmatch | ||
import os.path | ||
|
@@ -187,10 +187,12 @@ def get_database_objects(self) -> List[str]: | |
TAsap3DBOType.DBTYPE_ALL, | ||
) | ||
self._objects_cache = ( | ||
buffer.value.strip(b";").decode(RC["ENCODING"]).split(";") | ||
buffer.value.strip(b";")[: max_size.value] | ||
.decode(RC["ENCODING"]) | ||
.split(";") | ||
) | ||
|
||
return self._objects_cache | ||
return copy.copy(self._objects_cache) | ||
|
||
def get_ecu_tasks(self) -> Dict[str, EcuTask]: | ||
"""Get available data acquisition tasks. | ||
|
@@ -224,13 +226,14 @@ def get_task_instance(task_info: TTaskInfo2) -> EcuTask: | |
def get_network_name(self) -> str: | ||
"""Receives the name of the used network.""" | ||
c_name = ctypes.create_string_buffer(256) | ||
size = ctypes.c_uint() | ||
self._dll.Asap3GetNetworkName( | ||
self.asap3_handle, | ||
self.module_handle, | ||
ctypes.cast(ctypes.byref(c_name), ctypes.c_char_p), | ||
ctypes.byref(ctypes.c_uint()), | ||
ctypes.byref(size), | ||
) | ||
return c_name.value.decode(RC["ENCODING"]) | ||
return c_name.value[: size.value].decode(RC["ENCODING"]) | ||
|
||
def get_ecu_driver_type(self) -> DriverType: | ||
"""Retrieves the drivertype of an ECU. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters