erpc_interface/erpc_PLCObject/server.py
changeset 4043 b217fb367574
parent 4035 c317fc64035e
equal deleted inserted replaced
4042:03df7946c2fa 4043:b217fb367574
     1 #
     1 #
     2 # Generated by erpcgen 1.12.0 on Mon May 20 17:53:37 2024.
     2 # Generated by erpcgen 1.13.0 on Fri Nov  8 11:06:24 2024.
     3 #
     3 #
     4 # AUTOGENERATED - DO NOT EDIT
     4 # AUTOGENERATED - DO NOT EDIT
     5 #
     5 #
     6 
     6 
     7 import erpc
     7 import erpc
    25                 interface.IBeremizPLCObjectService.RESETLOGCOUNT_ID: self._handle_ResetLogCount,
    25                 interface.IBeremizPLCObjectService.RESETLOGCOUNT_ID: self._handle_ResetLogCount,
    26                 interface.IBeremizPLCObjectService.SEEDBLOB_ID: self._handle_SeedBlob,
    26                 interface.IBeremizPLCObjectService.SEEDBLOB_ID: self._handle_SeedBlob,
    27                 interface.IBeremizPLCObjectService.SETTRACEVARIABLESLIST_ID: self._handle_SetTraceVariablesList,
    27                 interface.IBeremizPLCObjectService.SETTRACEVARIABLESLIST_ID: self._handle_SetTraceVariablesList,
    28                 interface.IBeremizPLCObjectService.STARTPLC_ID: self._handle_StartPLC,
    28                 interface.IBeremizPLCObjectService.STARTPLC_ID: self._handle_StartPLC,
    29                 interface.IBeremizPLCObjectService.STOPPLC_ID: self._handle_StopPLC,
    29                 interface.IBeremizPLCObjectService.STOPPLC_ID: self._handle_StopPLC,
       
    30                 interface.IBeremizPLCObjectService.EXTENDEDCALL_ID: self._handle_ExtendedCall,
    30             }
    31             }
    31 
    32 
    32     def _handle_AppendChunkToBlob(self, sequence, codec):
    33     def _handle_AppendChunkToBlob(self, sequence, codec):
    33         # Create reference objects to pass into handler for out/inout parameters.
    34         # Create reference objects to pass into handler for out/inout parameters.
    34         newBlobID = erpc.Reference()
    35         newBlobID = erpc.Reference()
   346         if success.value is None:
   347         if success.value is None:
   347             raise ValueError("success.value is None")
   348             raise ValueError("success.value is None")
   348         codec.write_bool(success.value)
   349         codec.write_bool(success.value)
   349         codec.write_uint32(_result)
   350         codec.write_uint32(_result)
   350 
   351 
   351 
   352     def _handle_ExtendedCall(self, sequence, codec):
       
   353         # Create reference objects to pass into handler for out/inout parameters.
       
   354         answer = erpc.Reference()
       
   355 
       
   356         # Read incoming parameters.
       
   357         method = codec.read_string()
       
   358         argument = codec.read_binary()
       
   359 
       
   360         # Invoke user implementation of remote function.
       
   361         _result = self._handler.ExtendedCall(method, argument, answer)
       
   362 
       
   363         # Prepare codec for reply message.
       
   364         codec.reset()
       
   365 
       
   366         # Construct reply message.
       
   367         codec.start_write_message(erpc.codec.MessageInfo(
       
   368             type=erpc.codec.MessageType.kReplyMessage,
       
   369             service=interface.IBeremizPLCObjectService.SERVICE_ID,
       
   370             request=interface.IBeremizPLCObjectService.EXTENDEDCALL_ID,
       
   371             sequence=sequence))
       
   372         if answer.value is None:
       
   373             raise ValueError("answer.value is None")
       
   374         codec.write_binary(answer.value)
       
   375         codec.write_uint32(_result)
       
   376 
       
   377