Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::someip::rpc::RpcServer Class Reference

SOME/IP RPC server. More...

#include <rpc_server.h>

Inheritance diagram for ara::com::someip::rpc::RpcServer:
ara::com::someip::rpc::SocketRpcServer

Public Types

using HandlerType = std::function< bool(const std::vector< uint8_t > &, std::vector< uint8_t > &)>
 SOME/IP RPC request handler type.
 

Public Member Functions

 RpcServer (const RpcServer &)=delete
 
void SetHandler (uint16_t serviceId, uint16_t methodId, HandlerType handler)
 Set a RPC request handler. More...
 

Protected Member Functions

 RpcServer (uint8_t protocolVersion, uint8_t interfaceVersion) noexcept
 Constructor. More...
 
bool TryInvokeHandler (const std::vector< uint8_t > &requestPayload, std::vector< uint8_t > &responsePayload) const
 Try to invoke corresponding request handler at a message reception. More...
 

Detailed Description

SOME/IP RPC server.

Constructor & Destructor Documentation

◆ RpcServer()

ara::com::someip::rpc::RpcServer::RpcServer ( uint8_t  protocolVersion,
uint8_t  interfaceVersion 
)
protectednoexcept

Constructor.

Parameters
protocolVersionSOME/IP protocol header version
interfaceVersionService interface version

Member Function Documentation

◆ SetHandler()

void ara::com::someip::rpc::RpcServer::SetHandler ( uint16_t  serviceId,
uint16_t  methodId,
HandlerType  handler 
)

Set a RPC request handler.

Parameters
serviceIdService ID that contains the requested method
methodIdRequested method ID for invocation
handlerHandler to be invoked at the request arrival

◆ TryInvokeHandler()

bool ara::com::someip::rpc::RpcServer::TryInvokeHandler ( const std::vector< uint8_t > &  requestPayload,
std::vector< uint8_t > &  responsePayload 
) const
protected

Try to invoke corresponding request handler at a message reception.

Parameters
[in]requestPayloadSerialized SOME/IP request payload byte vector
[out]responsePayloadSerialized SOME/IP response payload byte vector
Returns
True if the request is handled; otherwise false
Remarks
The response payload will be untouched if the request is NOT handled.