erpc_interface/erpc_PLCObject/client.py
author Edouard Tisserant <edouard.tisserant@gmail.com>
Fri, 05 Apr 2024 13:11:30 +0200
changeset 3928 5c662d2e3f72
parent 3887 2df45e4bd500
child 3941 09aa8a10026c
permissions -rw-r--r--
merge
#
# Generated by erpcgen 1.11.0 on Mon Jan 22 16:49:00 2024.
#
# AUTOGENERATED - DO NOT EDIT
#

import erpc
from . import common, interface

# Client for BeremizPLCObjectService
class BeremizPLCObjectServiceClient(interface.IBeremizPLCObjectService):
    def __init__(self, manager):
        super(BeremizPLCObjectServiceClient, self).__init__()
        self._clientManager = manager

    def AppendChunkToBlob(self, data, blobID, newBlobID):
        assert type(newBlobID) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.APPENDCHUNKTOBLOB_ID,
                sequence=request.sequence))
        if data is None:
            raise ValueError("data is None")
        codec.write_binary(data)
        if blobID is None:
            raise ValueError("blobID is None")
        codec.write_binary(blobID)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        newBlobID.value = codec.read_binary()
        _result = codec.read_uint32()
        return _result

    def GetLogMessage(self, level, msgID, message):
        assert type(message) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.GETLOGMESSAGE_ID,
                sequence=request.sequence))
        if level is None:
            raise ValueError("level is None")
        codec.write_uint8(level)
        if msgID is None:
            raise ValueError("msgID is None")
        codec.write_uint32(msgID)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        message.value = common.log_message()._read(codec)
        _result = codec.read_uint32()
        return _result

    def GetPLCID(self, plcID):
        assert type(plcID) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.GETPLCID_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        plcID.value = common.PSKID()._read(codec)
        _result = codec.read_uint32()
        return _result

    def GetPLCstatus(self, status):
        assert type(status) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.GETPLCSTATUS_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        status.value = common.PLCstatus()._read(codec)
        _result = codec.read_uint32()
        return _result

    def GetTraceVariables(self, debugToken, traces):
        assert type(traces) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.GETTRACEVARIABLES_ID,
                sequence=request.sequence))
        if debugToken is None:
            raise ValueError("debugToken is None")
        codec.write_uint32(debugToken)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        traces.value = common.TraceVariables()._read(codec)
        _result = codec.read_uint32()
        return _result

    def MatchMD5(self, MD5, match):
        assert type(match) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.MATCHMD5_ID,
                sequence=request.sequence))
        if MD5 is None:
            raise ValueError("MD5 is None")
        codec.write_string(MD5)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        match.value = codec.read_bool()
        _result = codec.read_uint32()
        return _result

    def NewPLC(self, md5sum, plcObjectBlobID, extrafiles, success):
        assert type(success) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.NEWPLC_ID,
                sequence=request.sequence))
        if md5sum is None:
            raise ValueError("md5sum is None")
        codec.write_string(md5sum)
        if plcObjectBlobID is None:
            raise ValueError("plcObjectBlobID is None")
        codec.write_binary(plcObjectBlobID)
        if extrafiles is None:
            raise ValueError("extrafiles is None")
        codec.start_write_list(len(extrafiles))
        for _i0 in extrafiles:
            _i0._write(codec)


        # Send request and process reply.
        self._clientManager.perform_request(request)
        success.value = codec.read_bool()
        _result = codec.read_uint32()
        return _result

    def PurgeBlobs(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.PURGEBLOBS_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_uint32()
        return _result

    def RepairPLC(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.REPAIRPLC_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_uint32()
        return _result

    def ResetLogCount(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.RESETLOGCOUNT_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_uint32()
        return _result

    def SeedBlob(self, seed, blobID):
        assert type(blobID) is erpc.Reference, "out parameter must be a Reference object"

        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SEEDBLOB_ID,
                sequence=request.sequence))
        if seed is None:
            raise ValueError("seed is None")
        codec.write_binary(seed)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        blobID.value = codec.read_binary()
        _result = codec.read_uint32()
        return _result

    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()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.SETTRACEVARIABLESLIST_ID,
                sequence=request.sequence))
        if orders is None:
            raise ValueError("orders is None")
        codec.start_write_list(len(orders))
        for _i0 in orders:
            _i0._write(codec)


        # Send request and process reply.
        self._clientManager.perform_request(request)
        debugtoken.value = codec.read_uint32()
        _result = codec.read_uint32()
        return _result

    def StartPLC(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.STARTPLC_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_uint32()
        return _result

    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()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.STOPPLC_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        success.value = codec.read_bool()
        _result = codec.read_uint32()
        return _result