libdoip  0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
DoIPTimes.h
Go to the documentation of this file.
1 #ifndef DOIPTIMES_H
2 #define DOIPTIMES_H
3 
4 #include <stdint.h>
5 
6 // Table 12
7 namespace doip::times {
8 
9 /**
10  * @brief Client-specific times.
11  */
12 namespace client {
13 /**
14  * @brief Minimum time in ms to wait for a response after an UDP message was sent.
15  * @ note tA_DoIP_Ctrl
16  */
17 constexpr std::chrono::milliseconds UdpMessageTimeout(2000);
18 
19 /**
20  * @brief Maximum time in ms to wait for
21  * @note tA_DoIP_Routing_Activation
22  */
23 constexpr std::chrono::milliseconds RoutingActivationResponseTimeout(2000);
24 
25 /**
26  * @brief Time to wait before sending the next message after a client sent a message which requires no response.
27  * @note tA_Processing_Time
28  */
29 constexpr std::chrono::milliseconds IntermessageDelay(2000);
30 
31 } // namespace client
32 
33 /**
34  * @brief Server-specific times.
35  */
36 namespace server {
37 /**
38  * @brief Max. time in ms to wait before a server responds to
39  * a vehicle announcement request. The server should use a *random number*
40  * between 0 and `VehicleAnnouncementDelay`.
41  * @note tA_DoIP_Announce_Wait
42  */
43 constexpr std::chrono::milliseconds VehicleAnnouncementDelay(500);
44 
45 /**
46  * @brief Interval between vehicle announcements in ms.
47  * @note tA_DoIP_Announce_Interval
48  */
49 constexpr std::chrono::milliseconds VehicleAnnouncementInterval(500);
50 
51 /**
52  * @brief Number of vehicle announcements to be send.
53  * @note tA_DoIP_Announce_Num
54  */
55 constexpr uint8_t VehicleAnnouncementNumber = 3;
56 
57 /**
58  * @brief Maximum inactivity time in ms after a TCP connection was accepted. If no
59  * routing activation request is received within this period, the socket shall be closed
60  * @note tT_TCP_Initial_Inactivity
61  */
62 #ifndef NDEBUG
63 constexpr std::chrono::milliseconds InitialInactivityTimeout(200);
64 #else
65 constexpr std::chrono::milliseconds InitialInactivityTimeout(2000);
66 #endif
67 
68 /**
69  * @brief Maximum inactivity time in ms after a TCP message was sent or received.
70  * @note tT_TCP_General_Inactivity
71  */
72 #ifndef NDEBUG
73 constexpr std::chrono::milliseconds GeneralInactivityTimeout(500);
74 #else
75 constexpr std::chrono::milliseconds GeneralInactivityTimeout(300000);
76 #endif
77 
78 /**
79  * @brief Time in ms to wait for a alive check response.
80  * @note tT_TCP_Alive_Check
81  */
82 constexpr std::chrono::milliseconds AliveCheckResponseTimeout(500);
83 
84 /**
85  * @brief Time in ms to wait for sync after server has sent a vehicle identification response
86  * with sync status 'incomplete' (0x10).
87  * @note tT_TCP_Alive_Check
88  */
89 constexpr std::chrono::milliseconds VehicleDiscoveryTimer(500);
90 } // namespace server
91 
92 
93 /**
94  * @brief Maximum time in ms to wait for a response (ACK/NACK) after a diagnostic message
95  * has been sent.
96  * @note tA_DoIP_Diagnostic_Message
97  */
98 constexpr std::chrono::milliseconds DiagnosticMessageResponseTimeout(2000);
99 
100 } // namespace doip::times
101 
102 #endif /* DOIPTIMES_H */
constexpr std::chrono::milliseconds RoutingActivationResponseTimeout(2000)
Maximum time in ms to wait for.
constexpr std::chrono::milliseconds IntermessageDelay(2000)
Time to wait before sending the next message after a client sent a message which requires no response...
constexpr std::chrono::milliseconds UdpMessageTimeout(2000)
Minimum time in ms to wait for a response after an UDP message was sent.
constexpr std::chrono::milliseconds VehicleDiscoveryTimer(500)
Time in ms to wait for sync after server has sent a vehicle identification response with sync status ...
constexpr std::chrono::milliseconds VehicleAnnouncementInterval(500)
Interval between vehicle announcements in ms.
constexpr uint8_t VehicleAnnouncementNumber
Number of vehicle announcements to be send.
Definition: DoIPTimes.h:55
constexpr std::chrono::milliseconds AliveCheckResponseTimeout(500)
Time in ms to wait for a alive check response.
constexpr std::chrono::milliseconds InitialInactivityTimeout(200)
Maximum inactivity time in ms after a TCP connection was accepted.
constexpr std::chrono::milliseconds GeneralInactivityTimeout(500)
Maximum inactivity time in ms after a TCP message was sent or received.
constexpr std::chrono::milliseconds VehicleAnnouncementDelay(500)
Max.
constexpr std::chrono::milliseconds DiagnosticMessageResponseTimeout(2000)
Maximum time in ms to wait for a response (ACK/NACK) after a diagnostic message has been sent.