Line data Source code
1 : /********************************************************************************
2 : * Copyright (c) 2026 Accenture
3 : *
4 : * This program and the accompanying materials are made available under the
5 : * terms of the Apache License Version 2.0 which is available at
6 : * https://www.apache.org/licenses/LICENSE-2.0
7 : *
8 : * SPDX-License-Identifier: Apache-2.0
9 : ********************************************************************************/
10 :
11 : #pragma once
12 :
13 : #include "someip/RpcClosure.h"
14 : #include "someip/SomeIpConstants.h"
15 :
16 : #include <cstdint>
17 :
18 : namespace someip
19 : {
20 : class ISomeIpSerializable;
21 : class IRpcChannel;
22 :
23 : class IRpcSender
24 : {
25 : protected:
26 55 : IRpcSender() = default;
27 :
28 : public:
29 : IRpcSender(IRpcSender const&) = delete;
30 : IRpcSender& operator=(IRpcSender const&) = delete;
31 :
32 : /**
33 : * Send request to remote ECU
34 : *
35 : * \param pRequest Payload of the request
36 : * \param serviceId ServiceID of the request
37 : * \param MethodId MethodID of the request
38 : * \param InterfaceVersion InterfaceVersion of the request
39 : * \param isResponseExpected request-response (true) or fire&forget (false)
40 : * \param channel IRpcChannel storing Endpoint information
41 : * \param timeout time in ms until request is expired
42 : *
43 : * \return Result of sending attempt in form of a ServiceResultCode
44 : */
45 : virtual ServiceResultCode sendRequest(
46 : ISomeIpSerializable const* pRequest,
47 : service_id::type serviceId,
48 : uint16_t methodId,
49 : uint8_t interfaceVersion,
50 : bool isResponseExpected,
51 : IRpcChannel& channel,
52 : uint32_t timeout)
53 : = 0;
54 :
55 : /**
56 : * Process expired request (no response sent in time).
57 : *
58 : * \param channel affected channel
59 : *
60 : */
61 : virtual void requestExpired(IRpcChannel& channel) = 0;
62 : };
63 :
64 : } // namespace someip
|