--- a/connectors/ERPC/__init__.py Wed Jan 17 22:09:32 2024 +0100
+++ b/connectors/ERPC/__init__.py Fri Jan 19 19:58:44 2024 +0100
@@ -17,7 +17,7 @@
from erpc_interface.erpc_PLCObject.interface import IBeremizPLCObjectService
from erpc_interface.erpc_PLCObject.client import BeremizPLCObjectServiceClient
-from erpc_interface.erpc_PLCObject.common import trace_order, extra_file, PLCstatus_enum
+from erpc_interface.erpc_PLCObject.common import trace_order, extra_file, PLCstatus_enum, IECtype_enum import PSKManagement as PSK
from connectors.ERPC.PSK_Adapter import SSLPSKClientTransport
@@ -55,10 +55,12 @@
lambda res:(enum_to_PLCstatus[res.PLCstatus], res.logcounts)),
"GetTraceVariables":TranslatedReturnAsLastOutput(
lambda res:(enum_to_PLCstatus[res.PLCstatus],
- [(sample.tick, sample.TraceBuffer) for sample in res.traces])),
+ [(sample.tick, bytes(sample.TraceBuffer)) for sample in res.traces])), "MatchMD5":ReturnAsLastOutput,
"NewPLC":ReturnAsLastOutput,
"SeedBlob":ReturnAsLastOutput,
+ "SetTraceVariablesList": ReturnAsLastOutput, + "StopPLC":ReturnAsLastOutput, @@ -66,7 +68,9 @@
lambda md5sum, plcObjectBlobID, extrafiles: (
md5sum, plcObjectBlobID, [extra_file(*f) for f in extrafiles]),
- lambda orders : ([trace_order(*order) for order in orders],)
+ trace_order(idx, getattr(IECtype_enum, iectype), b"" if force is None else force) + for idx, iectype, force in orders],) def ERPC_connector_factory(uri, confnodesroot):
--- a/controls/DebugVariablePanel/DebugVariableItem.py Wed Jan 17 22:09:32 2024 +0100
+++ b/controls/DebugVariablePanel/DebugVariableItem.py Fri Jan 19 19:58:44 2024 +0100
@@ -255,7 +255,7 @@
if self.VariableType in ["STRING", "WSTRING"]:
# String data value is CRC
- num_value = (binascii.crc32(value.encode()) & STRING_CRC_MASK)
+ num_value = (binascii.crc32(value) & STRING_CRC_MASK) elif self.VariableType in ["TIME", "TOD", "DT", "DATE"]:
# Numeric value of time type variables
# is represented in seconds
--- a/erpc_interface/__init__.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/__init__.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
--- a/erpc_interface/erpc_PLCObject.erpc Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject.erpc Fri Jan 19 19:58:44 2024 +0100
@@ -19,6 +19,32 @@
PLCstatus_enum PLCstatus;
@@ -41,7 +67,7 @@
@@ -66,7 +92,7 @@
ResetLogCount() -> uint32
SeedBlob(in binary seed, out binary blobID) -> uint32
- SetTraceVariablesList(in list<trace_order> orders) -> uint32
+ SetTraceVariablesList(in list<trace_order> orders, out uint32 debugtoken) -> uint32
+ StopPLC(out bool success) -> uint32 --- a/erpc_interface/erpc_PLCObject/__init__.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject/__init__.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
--- a/erpc_interface/erpc_PLCObject/client.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject/client.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
@@ -235,7 +235,9 @@
_result = codec.read_uint32()
- def SetTraceVariablesList(self, orders):
+ def SetTraceVariablesList(self, orders, debugtoken): + assert type(debugtoken) is erpc.Reference, "out parameter must be a Reference object" # Build remote function invocation message.
request = self._clientManager.create_request()
@@ -253,6 +255,7 @@
# Send request and process reply.
self._clientManager.perform_request(request)
+ debugtoken.value = codec.read_uint32() _result = codec.read_uint32()
@@ -271,7 +274,9 @@
_result = codec.read_uint32()
+ def StopPLC(self, success): + assert type(success) is erpc.Reference, "out parameter must be a Reference object" # Build remote function invocation message.
request = self._clientManager.create_request()
@@ -283,6 +288,7 @@
# Send request and process reply.
self._clientManager.perform_request(request)
+ success.value = codec.read_bool() _result = codec.read_uint32()
--- a/erpc_interface/erpc_PLCObject/common.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject/common.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
@@ -13,6 +13,31 @@
# Structures data types declarations
class log_message(object):
@@ -187,12 +212,12 @@
class trace_order(object):
def __init__(self, idx=None, iectype=None, force=None):
- self.iectype = iectype # uint8
+ self.iectype = iectype # IECtype_enum self.force = force # binary
self.idx = codec.read_uint32()
- self.iectype = codec.read_uint8()
+ self.iectype = codec.read_int32() self.force = codec.read_binary()
@@ -202,7 +227,7 @@
codec.write_uint32(self.idx)
raise ValueError("iectype is None")
- codec.write_uint8(self.iectype)
+ codec.write_int32(self.iectype) raise ValueError("force is None")
codec.write_binary(self.force)
--- a/erpc_interface/erpc_PLCObject/interface.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject/interface.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
@@ -55,13 +55,13 @@
def SeedBlob(self, seed, blobID):
raise NotImplementedError()
- def SetTraceVariablesList(self, orders):
+ def SetTraceVariablesList(self, orders, debugtoken): raise NotImplementedError()
raise NotImplementedError()
+ def StopPLC(self, success): raise NotImplementedError()
--- a/erpc_interface/erpc_PLCObject/server.py Wed Jan 17 22:09:32 2024 +0100
+++ b/erpc_interface/erpc_PLCObject/server.py Fri Jan 19 19:58:44 2024 +0100
@@ -1,5 +1,5 @@
-# Generated by erpcgen 1.11.0 on Wed Jan 17 21:59:20 2024.
+# Generated by erpcgen 1.11.0 on Fri Jan 19 08:26:41 2024. # AUTOGENERATED - DO NOT EDIT
@@ -280,6 +280,9 @@
codec.write_uint32(_result)
def _handle_SetTraceVariablesList(self, sequence, codec):
+ # Create reference objects to pass into handler for out/inout parameters. + debugtoken = erpc.Reference() # Read incoming parameters.
_n0 = codec.start_read_list()
@@ -289,7 +292,7 @@
# Invoke user implementation of remote function.
- _result = self._handler.SetTraceVariablesList(orders)
+ _result = self._handler.SetTraceVariablesList(orders, debugtoken) # Prepare codec for reply message.
@@ -300,6 +303,9 @@
service=interface.IBeremizPLCObjectService.SERVICE_ID,
request=interface.IBeremizPLCObjectService.SETTRACEVARIABLESLIST_ID,
+ if debugtoken.value is None: + raise ValueError("debugtoken.value is None") + codec.write_uint32(debugtoken.value) codec.write_uint32(_result)
def _handle_StartPLC(self, sequence, codec):
@@ -320,10 +326,13 @@
codec.write_uint32(_result)
def _handle_StopPLC(self, sequence, codec):
+ # Create reference objects to pass into handler for out/inout parameters. + success = erpc.Reference() # Read incoming parameters.
# Invoke user implementation of remote function.
- _result = self._handler.StopPLC()
+ _result = self._handler.StopPLC(success) # Prepare codec for reply message.
@@ -334,6 +343,9 @@
service=interface.IBeremizPLCObjectService.SERVICE_ID,
request=interface.IBeremizPLCObjectService.STOPPLC_ID,
+ if success.value is None: + raise ValueError("success.value is None") + codec.write_bool(success.value) codec.write_uint32(_result)
--- a/runtime/eRPCServer.py Wed Jan 17 22:09:32 2024 +0100
+++ b/runtime/eRPCServer.py Fri Jan 19 19:58:44 2024 +0100
@@ -12,7 +12,7 @@
-from erpc_interface.erpc_PLCObject.common import PSKID, PLCstatus, TraceVariables, trace_sample, PLCstatus_enum, log_message
+from erpc_interface.erpc_PLCObject.common import PSKID, PLCstatus, TraceVariables, trace_sample, PLCstatus_enum, log_message, IECtype_enum from erpc_interface.erpc_PLCObject.interface import IBeremizPLCObjectService
from erpc_interface.erpc_PLCObject.server import BeremizPLCObjectServiceService
@@ -23,6 +23,8 @@
CRITICAL_LOG_LEVEL = LogLevelsDict["CRITICAL"]
+enum_to_IECtype = dict(map(lambda t:(t[1],t[0]),getmembers(IECtype_enum, lambda x:type(x)==int))) def ReturnAsLastOutput(method, args_wrapper, *args):
args[-1].value = method(*args_wrapper(*args[:-1]))
@@ -43,10 +45,12 @@
"GetPLCstatus":TranslatedReturnAsLastOutput(
lambda res:PLCstatus(getattr(PLCstatus_enum, res[0]),res[1])),
"GetTraceVariables":TranslatedReturnAsLastOutput(
- lambda res:TraceVariables(res[0],[trace_sample(*sample) for sample in res[1]])),
+ lambda res:TraceVariables(getattr(PLCstatus_enum, res[0]),[trace_sample(*sample) for sample in res[1]])), "MatchMD5":ReturnAsLastOutput,
"NewPLC":ReturnAsLastOutput,
"SeedBlob":ReturnAsLastOutput,
+ "SetTraceVariablesList": ReturnAsLastOutput, + "StopPLC":ReturnAsLastOutput, @@ -56,7 +60,7 @@
lambda md5sum, plcObjectBlobID, extrafiles: (
md5sum, bytes(plcObjectBlobID), [(f.fname, bytes(f.blobID)) for f in extrafiles]),
- lambda orders : ([(order.idx, order.iectype, order.force) for order in orders],)
+ lambda orders : ([(order.idx, enum_to_IECtype[order.iectype], None if len(order.force)==0 else order.force) for order in orders],) def rpc_wrapper(method_name):