Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
someip_sd_server.h
1#ifndef SOMEIP_SD_SERVER
2#define SOMEIP_SD_SERVER
3
4#include "../../helper/concurrent_queue.h"
5#include "../../helper/ipv4_address.h"
6#include "../../entry/service_entry.h"
7#include "../../option/ipv4_endpoint_option.h"
8#include "./fsm/notready_state.h"
9#include "./fsm/initial_wait_state.h"
10#include "./fsm/repetition_state.h"
11#include "./fsm/main_state.h"
12#include "./someip_sd_agent.h"
13
14namespace ara
15{
16 namespace com
17 {
18 namespace someip
19 {
20 namespace sd
21 {
23 class SomeIpSdServer : public SomeIpSdAgent<helper::SdServerState>
24 {
25 private:
27 SomeIpSdMessage mOfferServiceMessage;
28 SomeIpSdMessage mStopOfferMessage;
29 fsm::NotReadyState mNotReadyState;
32 fsm::MainState mMainState;
33 const uint16_t mServiceId;
34 const uint16_t mInstanceId;
35 const uint8_t mMajorVersion;
36 const uint32_t mMinorVersion;
37
38 void sendOffer();
39 bool matchOfferingService(const SomeIpSdMessage &message) const;
40 void receiveFind(SomeIpSdMessage &&message);
41 void onServiceStopped();
42
43 protected:
44 void StartAgent(helper::SdServerState state) override;
45 void StopAgent() override;
46
47 public:
48 SomeIpSdServer() = delete;
49
65 uint16_t serviceId,
66 uint16_t instanceId,
67 uint8_t majorVersion,
68 uint32_t minorVersion,
69 helper::Ipv4Address ipAddress,
70 uint16_t port,
71 int initialDelayMin,
72 int initialDelayMax,
73 int repetitionBaseDelay = 30,
74 int cycleOfferDelay = 1000,
75 uint32_t repetitionMax = 3);
76
77 ~SomeIpSdServer() override;
78 };
79 }
80 }
81 }
82}
83
84#endif
Thread-safe wrapper around STL queue using locking mechanism.
Definition: concurrent_queue.h:18
SOME/IP service discovery agent (i.e., a server or a client)
Definition: someip_sd_agent.h:21
SOME/IP service discovery message.
Definition: someip_sd_message.h:18
SOME/IP service discovery server.
Definition: someip_sd_server.h:24
void StopAgent() override
Stop the service discovery agent.
Definition: someip_sd_server.cpp:173
void StartAgent(helper::SdServerState state) override
Start the service discovery agent.
Definition: someip_sd_server.cpp:160
Server's or client's service initial wait state.
Definition: initial_wait_state.h:24
Server's main state.
Definition: main_state.h:19
Machine state when the server's service is down or stopped.
Definition: notready_state.h:19
Server's or client's service repetition state.
Definition: repetition_state.h:24
SdServerState
Service discovery server machine state.
Definition: machine_state.h:15
IPv4 address wrapper helper.
Definition: ipv4_address.h:16