libdoip  0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
DoIPCloseReason.h
Go to the documentation of this file.
1 #ifndef DOIPCLOSEREASON_H
2 #define DOIPCLOSEREASON_H
3 
4 #include <cstdint>
5 #include <iostream>
6 
7 namespace doip {
8 
9 /**
10  * @brief Reason for connection closure
11  */
12 enum class DoIPCloseReason : uint8_t {
13  None,
21 };
22 
23 inline std::ostream &operator<<(std::ostream &os, DoIPCloseReason event) {
24  switch (event) {
26  return os << "None";
27 
29  return os << "Initial Inactivity Timeout";
31  return os << "General Inactivity Timeout";
33  return os << "AliveCheck Timeout";
35  return os << "Socket Error";
37  return os << "Invalid Message";
39  return os << "Application Request";
41  return os << "Routing Activation Denied";
42  default:
43  return os << "Unknown(" << static_cast<int>(event) << ")";
44  }
45 }
46 
47 } // namespace doip
48 
49 #endif /* DOIPCLOSEREASON_H */
Definition: AnsiColors.h:3
std::ostream & operator<<(std::ostream &os, const ByteArray &arr)
Stream operator for ByteArray.
Definition: ByteArray.h:303
DoIPCloseReason
Reason for connection closure.