Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::someip::sd::SomeIpSdClient Class Reference

SOME/IP service discovery client. More...

#include <someip_sd_client.h>

Inheritance diagram for ara::com::someip::sd::SomeIpSdClient:
ara::com::someip::sd::SomeIpSdAgent< helper::SdClientState >

Public Member Functions

 SomeIpSdClient (helper::NetworkLayer< SomeIpSdMessage > *networkLayer, uint16_t serviceId, int initialDelayMin, int initialDelayMax, int repetitionBaseDelay=30, uint32_t repetitionMax=3)
 Constructor. More...
 
bool TryWaitUntiServiceOffered (int duration)
 Try to wait unitl the server offers the service. More...
 
bool TryWaitUntiServiceOfferStopped (int duration)
 Try to wait unitl the server stops offering the service. More...
 
bool TryGetOfferedEndpoint (std::string &ipAddress, uint16_t &port)
 Try to the offered unicast endpoint from the SD server. More...
 
- Public Member Functions inherited from ara::com::someip::sd::SomeIpSdAgent< helper::SdClientState >
 SomeIpSdAgent (helper::NetworkLayer< SomeIpSdMessage > *networkLayer)
 Constructor. More...
 
void Start ()
 Start the service discovery agent.
 
helper::SdClientState GetState () const noexcept
 Get the current server state. More...
 
void Join ()
 Join to the timer's thread.
 
void Stop ()
 Stop the service discovery agent. More...
 

Protected Member Functions

void StartAgent (helper::SdClientState state) override
 Start the service discovery agent. More...
 
void StopAgent () override
 Stop the service discovery agent. More...
 

Additional Inherited Members

- Protected Attributes inherited from ara::com::someip::sd::SomeIpSdAgent< helper::SdClientState >
helper::FiniteStateMachine< helper::SdClientStateStateMachine
 Agent's FSM.
 
std::future< void > Future
 Agent running state future object.
 
helper::NetworkLayer< SomeIpSdMessage > * CommunicationLayer
 Network communication abstraction layer.
 

Detailed Description

SOME/IP service discovery client.

Constructor & Destructor Documentation

◆ SomeIpSdClient()

ara::com::someip::sd::SomeIpSdClient::SomeIpSdClient ( helper::NetworkLayer< SomeIpSdMessage > *  networkLayer,
uint16_t  serviceId,
int  initialDelayMin,
int  initialDelayMax,
int  repetitionBaseDelay = 30,
uint32_t  repetitionMax = 3 
)

Constructor.

Parameters
networkLayerNetwork communication abstraction layer
serviceIdServer's service ID
initialDelayMinMinimum initial delay
initialDelayMaxMaximum initial delay
repetitionBaseDelayRepetition phase delay
repetitionMaxMaximum message count in the repetition phase

Member Function Documentation

◆ StartAgent()

void ara::com::someip::sd::SomeIpSdClient::StartAgent ( helper::SdClientState  state)
overrideprotectedvirtual

Start the service discovery agent.

Parameters
stateCurrent FSM state before start

Implements ara::com::someip::sd::SomeIpSdAgent< helper::SdClientState >.

◆ StopAgent()

void ara::com::someip::sd::SomeIpSdClient::StopAgent ( )
overrideprotectedvirtual

Stop the service discovery agent.

Parameters
stateCurrent FSM state before stop

Implements ara::com::someip::sd::SomeIpSdAgent< helper::SdClientState >.

◆ TryGetOfferedEndpoint()

bool ara::com::someip::sd::SomeIpSdClient::TryGetOfferedEndpoint ( std::string &  ipAddress,
uint16_t &  port 
)

Try to the offered unicast endpoint from the SD server.

Parameters
[out]ipAddressOffered unicast IPv4 address
[out]portOffered TCP port number
Returns
True if the SD server has already offered the endpoint; otherwise false
Remarks
The arguments won't be touched while returning 'false'.
Note
The endpoint WON'T be invalidated after receiving the stop offer.

◆ TryWaitUntiServiceOffered()

bool ara::com::someip::sd::SomeIpSdClient::TryWaitUntiServiceOffered ( int  duration)

Try to wait unitl the server offers the service.

Parameters
durationWaiting timeout in milliseconds
Returns
True, if the service is offered before the timeout; otherwise false
Note
Zero duration means wait until the service is offered.

◆ TryWaitUntiServiceOfferStopped()

bool ara::com::someip::sd::SomeIpSdClient::TryWaitUntiServiceOfferStopped ( int  duration)

Try to wait unitl the server stops offering the service.

Parameters
durationWaiting timeout in milliseconds
Returns
True, if the service offering is stopped before the timeout; otherwise false
Note
Zero duration means wait until the service offering stops.