MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / perform_request

Method perform_request

erpc_python/erpc/client.py:57–78  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

55 return RequestContext(self.sequence, msg, codec, isOneway)
56
57 def perform_request(self, request):
58 # Arbitrate requests.
59 token = None
60 if self._arbitrator is not None and not request.is_oneway:
61 token = self._arbitrator.prepare_client_receive(request)
62
63 # Send serialized request to server.
64 self.transport.send(request.codec.buffer)
65
66 if not request.is_oneway:
67 if token is not None:
68 msg = self._arbitrator.client_receive(token)
69 else:
70 msg = self.transport.receive()
71 request.codec.buffer = msg
72
73 info = request.codec.start_read_message()
74 if info.type != MessageType.kReplyMessage:
75 raise RequestError("invalid reply message type")
76 if info.sequence != request.sequence:
77 raise RequestError("unexpected sequence number in reply (was %d, expected %d)"
78 % (info.sequence, request.sequence))
79
80
81class RequestContext(object):

Callers 1

erpcMatrixMultiplyMethod · 0.80

Calls 6

client_receiveMethod · 0.80
RequestErrorClass · 0.70
sendMethod · 0.65
receiveMethod · 0.65
start_read_messageMethod · 0.45

Tested by

no test coverage detected