sys_stat_reply.h
Go to the documentation of this file.
1 /*********************************************************************
2 * FSRobo-R Package BSDL
3 * ---------
4 * Copyright (C) 2019 FUJISOFT. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors
14 * may be used to endorse or promote products derived from this software without
15 * specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *********************************************************************/
28 
29 #ifndef FSROBO_R_DRIVER_SIMPLE_MESSAGE_SYS_STAT_REPLY_H
30 #define FSROBO_R_DRIVER_SIMPLE_MESSAGE_SYS_STAT_REPLY_H
31 
32 #include <string>
36 
37 namespace fsrobo_r_driver
38 {
39 namespace simple_message
40 {
41 namespace sys_stat_reply
42 {
43 
47 namespace sys_stat_reply_type
48 {
50 {
51  EMS_STATE = 1,
52  MOTION_ID = 2,
53  INC_MODE = 3,
54  ABS_LOST = 4,
57  SPI_ERROR = 7,
59  PULSE = 0x8000
60 };
61 }
63 
81 {
82 public:
89  SysStatReply(void);
90 
95  ~SysStatReply(void);
96 
101  void init();
102 
107  void init(SysStatReplyType stat_type, industrial::shared_types::shared_int result);
108 
114  void setStatType(SysStatReplyType stat_type)
115  {
116  this->stat_type_ = static_cast<industrial::shared_types::shared_int>(stat_type);
117  }
118 
125  {
126  this->result_ = result;
127  }
128 
134  SysStatReplyType getStatType() const
135  {
136  return static_cast<SysStatReplyType>(this->stat_type_);
137  }
138 
145  {
146  return this->result_;
147  }
148 
154  void copyFrom(SysStatReply &src);
155 
161  bool operator==(SysStatReply &rhs);
162 
163  // Overrides - SimpleSerialize
164  bool load(industrial::byte_array::ByteArray *buffer);
165  bool unload(industrial::byte_array::ByteArray *buffer);
166  unsigned int byteLength()
167  {
168  return 2 * sizeof(industrial::shared_types::shared_int);
169  }
170 
171 private:
180 };
181 }
182 }
183 }
184 
185 #endif // FSROBO_R_DRIVER_SIMPLE_MESSAGE_SYS_STAT_REPLY_H
industrial::shared_types::shared_int stat_type_
The stat type.
industrial::shared_types::shared_int getResult() const
Returns the result data.
void setStatType(SysStatReplyType stat_type)
Sets the result type.
void setResult(industrial::shared_types::shared_int result)
Sets the result data.
Class encapsulated set io reply data. These messages are sent by the FSRobo-R controller in response ...
SysStatReplyType getStatType() const
Returns the stat type.
industrial::shared_types::shared_int result_
The result value.
bool operator==(const Rotation &a, const Rotation &b)


fsrobo_r_driver
Author(s): F-ROSROBO
autogenerated on Sun Feb 9 2020 03:58:29