Skip to content

Commit

Permalink
update for CANape 22 header
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 committed Jun 24, 2024
1 parent 95ccb20 commit 21ca1eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/pycanape/cnp_api/cnp_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,28 @@ class ErrorCodes(IntEnum):
)
AEC_OBJNAME_NOT_UNIQUE = 153 # Objectname not unique
AEC_INDEX_DO_NOT_MATCH = 154 # Index of Objectname does not unique
AEC_LAST_ERRCODE = 155
AEC_MEASUREMENT_NOT_ALLOWED = 155 # Index of Objectname does not unique
ACE_ERROR_ASSIGN_TO_RECORDER = 156 # Error assigning object to Recorder
ACE_DATAYPE_NOT_ALLOWED = 157 # Datatype not allowed
ACE_MISSING_MONITOR_DEVICE = 158 # No Monitor device available in this Network
ACE_WRONG_OBJECT_STATE = 159 # Wrong object state for current function
AEC_LAST_ERRCODE = 160


class TApplicationType(IntEnum):
eUNDEFINED = 0
eCANAPE = 1
eCANAPETBE = 2
eAPPLOCATION = 3


class TeSyncOption(IntEnum):
e_UPLOAD = 0
e_DOWNLOAD = 1
e_SKIP = 2
e_UNKNOWN = 3


class TLogicalChannels(IntEnum):
ekUndefined = 0 # Undefined logical channel
ekCAN = 1 # CAN logical channel
Expand Down Expand Up @@ -455,7 +468,7 @@ class TAsap3DataType(IntEnum):

@property
def dtype(self) -> "npt.DTypeLike":
datatype_map: typing.Dict[TAsap3DataType, "npt.DTypeLike"] = {
datatype_map: typing.Dict[TAsap3DataType, npt.DTypeLike] = {
TAsap3DataType.TYPE_INT: np.int32,
TAsap3DataType.TYPE_FLOAT: np.float32,
TAsap3DataType.TYPE_DOUBLE: np.float64,
Expand Down
12 changes: 12 additions & 0 deletions src/pycanape/cnp_api/cnp_prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,18 @@ def __init__(self, lib_path: Path) -> None: # noqa: PLR0915
errcheck=self._get_last_error,
)

self.Asap3ECUOnOffline2 = self._map_symbol(
func_name="Asap3ECUOnOffline2",
restype=ctypes.c_bool,
argtypes=[
cnp_class.TAsap3Hdl, # > TAsap3Hdl hdl
cnp_class.TModulHdl, # > TModulHdl module
cnp_class.enum_type, # > TAsap3ECUState State
cnp_class.enum_type, # > TeSyncOption syncaction
],
errcheck=self._get_last_error,
)

self.Asap3EnableBusLoggingRecorderByModule = self._map_symbol(
func_name="Asap3EnableBusLoggingRecorderByModule",
restype=ctypes.c_bool,
Expand Down

0 comments on commit 21ca1eb

Please sign in to comment.