How to use the erpc.Reference function in erpc

To help you get started, we’ve selected a few erpc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EmbeddedRPC / erpc-imx-demos / MPU / example_erpc / service / erpc_matrix_multiply / server.py View on Github external
def _handle_erpcMatrixMultiply(self, sequence, codec):
        # Create reference objects to pass into handler for out/inout parameters.
        result_matrix = erpc.Reference()

        # Read incoming parameters.
        matrix1 = []
        for _i0 in range(5):
            _v0 = []
            for _i1 in range(5):
                _v1 = codec.read_int32()
                _v0.append(_v1)

            matrix1.append(_v0)

        matrix2 = []
        for _i0 in range(5):
            _v0 = []
            for _i1 in range(5):
                _v1 = codec.read_int32()
github EmbeddedRPC / erpc-imx-demos / MPU / example_erpc / service / erpc_matrix_multiply / client.py View on Github external
def erpcMatrixMultiply(self, matrix1, matrix2, result_matrix):
        assert type(result_matrix) 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.ERPCMATRIXMULTIPLY_ID,
                sequence=request.sequence))
        if matrix1 is None:
            raise ValueError("matrix1 is None")
        for _i0 in matrix1:
            for _i1 in _i0:
                codec.write_int32(_i1)