1#ifndef SOMEIP_SD_CLIENT
2#define SOMEIP_SD_CLIENT
4#include "../../../core/optional.h"
5#include "../../helper/ipv4_address.h"
6#include "../../helper/ttl_timer.h"
7#include "../../entry/service_entry.h"
8#include "./fsm/service_notseen_state.h"
9#include "./fsm/service_seen_state.h"
10#include "./fsm/client_initial_wait_state.h"
11#include "./fsm/client_repetition_state.h"
12#include "./fsm/service_ready_state.h"
13#include "./fsm/stopped_state.h"
14#include "./someip_sd_agent.h"
30 std::mutex mOfferingMutex;
31 std::unique_lock<std::mutex> mOfferingLock;
32 std::condition_variable mOfferingConditionVariable;
33 std::mutex mStopOfferingMutex;
34 std::unique_lock<std::mutex> mStopOfferingLock;
35 std::condition_variable mStopOfferingConditionVariable;
43 const uint16_t mServiceId;
44 std::mutex mEndpointMutex;
45 std::unique_lock<std::mutex> mEndpointLock;
50 bool matchRequestedService(
52 bool tryExtractOfferedEndpoint(
54 std::string &ipAddress, uint16_t &port)
const;
55 void onOfferChanged(uint32_t ttl);
77 int repetitionBaseDelay = 30,
78 uint32_t repetitionMax = 3);
99 std::string &ipAddress, uint16_t &port);
Time To Live countdown timer.
Definition: ttl_timer.h:17
SOME/IP service discovery agent (i.e., a server or a client)
Definition: someip_sd_agent.h:21
SOME/IP service discovery client.
Definition: someip_sd_client.h:26
void StopAgent() override
Stop the service discovery agent.
Definition: someip_sd_client.cpp:174
bool TryWaitUntiServiceOfferStopped(int duration)
Try to wait unitl the server stops offering the service.
Definition: someip_sd_client.cpp:226
void StartAgent(helper::SdClientState state) override
Start the service discovery agent.
Definition: someip_sd_client.cpp:159
bool TryWaitUntiServiceOffered(int duration)
Try to wait unitl the server offers the service.
Definition: someip_sd_client.cpp:188
bool TryGetOfferedEndpoint(std::string &ipAddress, uint16_t &port)
Try to the offered unicast endpoint from the SD server.
Definition: someip_sd_client.cpp:266
SOME/IP service discovery message.
Definition: someip_sd_message.h:18
Client's service initial wait state.
Definition: client_initial_wait_state.h:19
Client's service repetition state.
Definition: client_repetition_state.h:19
Client's service state when the service is not seen.
Definition: service_notseen_state.h:20
Client's state when the service is requested and also up.
Definition: service_ready_state.h:19
Client's state when the service is seen (up) but not requested.
Definition: service_seen_state.h:19
Client state when the service is stopped.
Definition: stopped_state.h:19
A wrapper around a possible value.
Definition: optional.h:16
SdClientState
Service discovery client machine state.
Definition: machine_state.h:24