libdoip
0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
DoIPServerState.h
Go to the documentation of this file.
1
#ifndef DOIPSTATE_H
2
#define DOIPSTATE_H
3
4
#include <iostream>
5
6
namespace
doip
{
7
// DoIP Protocol States
8
// Figure 26
9
enum class
DoIPServerState
{
10
SocketInitialized
,
// Initial state after socket creation
11
WaitRoutingActivation
,
// Waiting for routing activation request
12
RoutingActivated
,
// Routing is active, ready for diagnostics
13
WaitAliveCheckResponse
,
// D& config Waiting for alive check response
14
WaitDownstreamResponse
,
// Waiting for response from downstream device
15
Finalize
,
// Cleanup state
16
Closed
// Connection closed
17
};
18
19
// Stream operator for DoIPServerState
20
inline
std::ostream &
operator<<
(std::ostream &os,
DoIPServerState
state) {
21
switch
(state) {
22
case
DoIPServerState::SocketInitialized
:
23
return
os <<
"SocketInitialized"
;
24
case
DoIPServerState::WaitRoutingActivation
:
25
return
os <<
"WaitRoutingActivation"
;
26
case
DoIPServerState::RoutingActivated
:
27
return
os <<
"RoutingActivated"
;
28
case
DoIPServerState::WaitAliveCheckResponse
:
29
return
os <<
"WaitAliveCheckResponse"
;
30
case
DoIPServerState::WaitDownstreamResponse
:
31
return
os <<
"WaitDownstreamResponse"
;
32
case
DoIPServerState::Finalize
:
33
return
os <<
"Finalize"
;
34
case
DoIPServerState::Closed
:
35
return
os <<
"Closed"
;
36
default
:
37
return
os <<
"Unknown("
<<
static_cast<
int
>
(state) <<
")"
;
38
}
39
}
40
41
}
// namespace doip
42
43
#endif
/* DOIPSTATE_H */
doip
Definition:
AnsiColors.h:3
doip::DoIPServerState
DoIPServerState
Definition:
DoIPServerState.h:9
doip::DoIPServerState::Closed
@ Closed
doip::DoIPServerState::SocketInitialized
@ SocketInitialized
doip::DoIPServerState::WaitRoutingActivation
@ WaitRoutingActivation
doip::DoIPServerState::WaitDownstreamResponse
@ WaitDownstreamResponse
doip::DoIPServerState::RoutingActivated
@ RoutingActivated
doip::DoIPServerState::WaitAliveCheckResponse
@ WaitAliveCheckResponse
doip::DoIPServerState::Finalize
@ Finalize
doip::operator<<
std::ostream & operator<<(std::ostream &os, const ByteArray &arr)
Stream operator for ByteArray.
Definition:
ByteArray.h:303
inc
DoIPServerState.h
Generated by
1.9.1