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  (void) version;
84  message & status;
85  message & erase_progress;
86 
87  switch(status) {
88  case STATUS_IDLE:
89  case STATUS_SUCCESS:
90  case STATUS_FAILURE:
91  case STATUS_ERASE_IN_PROGRESS:
92  break;
93  default:
94  CRL_EXCEPTION("unknown status (%d)", (int)status);
95  }
96  }
97 };
98 
99 }}}} // namespaces
100 
101 #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:200
#define CRL_CONSTEXPR
Definition: Portability.hh:51


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50