libdoip  0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
DoIPServerEvent.h
Go to the documentation of this file.
1 #ifndef DOIPEVENT_H
2 #define DOIPEVENT_H
3 
4 #include <iostream>
5 
6 namespace doip {
7 
8 // DoIP Events
9 enum class DoIPServerEvent {
10  // Message events
16 
17  // Timer events
22 
23  // Error events
26 };
27 
28 // Stream operator for DoIPServerEvent
29 inline std::ostream &operator<<(std::ostream &os, DoIPServerEvent event) {
30  switch (event) {
32  return os << "RoutingActivationReceived";
34  return os << "AliveCheckResponseReceived";
36  return os << "DiagnosticMessageReceived";
38  return os << "DiagnosticMessageReceivedDownstream";
40  return os << "CloseRequestReceived";
42  return os << "Initial_inactivity_timeout";
44  return os << "GeneralInactivityTimeout";
46  return os << "AliveCheckTimeout";
48  return os << "InvalidMessage";
50  return os << "SocketError";
52  return os << "DownstreamTimeout";
53  default:
54  return os << "Unknown(" << static_cast<int>(event) << ")";
55  }
56 }
57 } // namespace doip
58 
59 #endif /* DOIPEVENT_H */
Definition: AnsiColors.h:3
DoIPServerEvent
std::ostream & operator<<(std::ostream &os, const ByteArray &arr)
Stream operator for ByteArray.
Definition: ByteArray.h:303