SysFlashResponseMessage.h
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_SysFlashResponseMessage
41 #define LibMultiSense_SysFlashResponseMessage
42 
44 
45 namespace crl {
46 namespace multisense {
47 namespace details {
48 namespace wire {
49 
51 public:
54 
55  //
56  // Parameters representing the desired flash operation
57 
58  static CRL_CONSTEXPR uint32_t STATUS_IDLE = 0;// no operation in progress or requested
59  static CRL_CONSTEXPR uint32_t STATUS_SUCCESS = 1;// requested operation succeeded/started
60  static CRL_CONSTEXPR uint32_t STATUS_FAILURE = 2;// requested operation failed
61  static CRL_CONSTEXPR uint32_t STATUS_ERASE_IN_PROGRESS = 3;// operation not possible
62 
63  uint32_t status;
64 
65  //
66  // Only for ERASE_IN_PROGRESS status
67 
68  int32_t erase_progress;
69 
70  //
71  // Constructors
72 
74  SysFlashResponse() : status(STATUS_IDLE), erase_progress(0) {};
75 
76  //
77  // Serialization routine
78 
79  template<class Archive>
80  void serialize(Archive& message,
81  const VersionType version)
82  {
83  message & status;
84  message & erase_progress;
85 
86  switch(status) {
87  case STATUS_IDLE:
88  case STATUS_SUCCESS:
89  case STATUS_FAILURE:
90  case STATUS_ERASE_IN_PROGRESS:
91  break;
92  default:
93  CRL_EXCEPTION("unknown status (%d)", (int)status);
94  }
95  }
96 };
97 
98 }}}}; // namespaces
99 
100 #endif
#define CRL_EXCEPTION(fmt,...)
Definition: Exception.hh:71
void serialize(Archive &message, const VersionType version)
SysFlashResponse(utility::BufferStreamReader &r, VersionType v)
Definition: channel.cc:56
static CRL_CONSTEXPR IdType ID_DATA_SYS_FLASH_RESPONSE
Definition: Protocol.h:189
#define CRL_CONSTEXPR
Definition: Portability.hh:38


multisense_lib
Author(s):
autogenerated on Sat Apr 6 2019 02:16:46