00001
00002 #ifndef WIIMOTE_MESSAGE_LEDCONTROL_H
00003 #define WIIMOTE_MESSAGE_LEDCONTROL_H
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 #include "ros/serialization.h"
00008 #include "ros/builtin_message_traits.h"
00009 #include "ros/message_operations.h"
00010 #include "ros/message.h"
00011 #include "ros/time.h"
00012
00013 #include "wiimote/TimedSwitch.h"
00014
00015 namespace wiimote
00016 {
00017 template <class ContainerAllocator>
00018 struct LEDControl_ : public ros::Message
00019 {
00020 typedef LEDControl_<ContainerAllocator> Type;
00021
00022 LEDControl_()
00023 : timed_switch_array()
00024 {
00025 }
00026
00027 LEDControl_(const ContainerAllocator& _alloc)
00028 : timed_switch_array(_alloc)
00029 {
00030 }
00031
00032 typedef std::vector< ::wiimote::TimedSwitch_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::wiimote::TimedSwitch_<ContainerAllocator> >::other > _timed_switch_array_type;
00033 std::vector< ::wiimote::TimedSwitch_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::wiimote::TimedSwitch_<ContainerAllocator> >::other > timed_switch_array;
00034
00035
00036 ROS_DEPRECATED uint32_t get_timed_switch_array_size() const { return (uint32_t)timed_switch_array.size(); }
00037 ROS_DEPRECATED void set_timed_switch_array_size(uint32_t size) { timed_switch_array.resize((size_t)size); }
00038 ROS_DEPRECATED void get_timed_switch_array_vec(std::vector< ::wiimote::TimedSwitch_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::wiimote::TimedSwitch_<ContainerAllocator> >::other > & vec) const { vec = this->timed_switch_array; }
00039 ROS_DEPRECATED void set_timed_switch_array_vec(const std::vector< ::wiimote::TimedSwitch_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::wiimote::TimedSwitch_<ContainerAllocator> >::other > & vec) { this->timed_switch_array = vec; }
00040 private:
00041 static const char* __s_getDataType_() { return "wiimote/LEDControl"; }
00042 public:
00043 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00044
00045 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00046
00047 private:
00048 static const char* __s_getMD5Sum_() { return "d0477eee2c164b8a9582a596f92c6f08"; }
00049 public:
00050 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00051
00052 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00053
00054 private:
00055 static const char* __s_getMessageDefinition_() { return "# Message to request Wiimote LED operations. The Wiimote has four\n\
00056 # LEDs. This message enables its user to turn each individual LED\n\
00057 # on or off, and to define a blink pattern for each LEDs.\n\
00058 # See TimedSwitch.msg for details.\n\
00059 \n\
00060 TimedSwitch[] timed_switch_array \n\
00061 \n\
00062 ================================================================================\n\
00063 MSG: wiimote/TimedSwitch\n\
00064 # TimedSwitch allows sender to:\n\
00065 # o turn a switch on,\n\
00066 # o turn a switch off, and\n\
00067 # o repeat an on/off pattern forever or for a\n\
00068 # given number of times.\n\
00069 # Fields (refer to definitions of constants in the definition body):\n\
00070 # o switch_mode:\n\
00071 # ON: turn on (num_cycles and pulse_pattern fields are ignored)\n\
00072 # OFF: turn off (num_cycles and pulse_pattern fields are ignored)\n\
00073 # NO_CHANGE: leave LED in its current state\n\
00074 # REPEAT: repeat an on/off pattern for as long\n\
00075 # as is indicated in the num_cycles field. The\n\
00076 # pattern is defined in the pulse_pattern field.\n\
00077 #\n\
00078 # o num_cycles:\n\
00079 # n>=0: run the pattern that is defined in pulse_pattern\n\
00080 # n times.\n\
00081 # n==FOREVER: run the pattern that is defined in pulse_pattern\n\
00082 # until a new TimedSwitch message is sent. \n\
00083 #\n\
00084 # o pulse_pattern:\n\
00085 # A series of time durations in fractions of a second. The\n\
00086 # first number is the duration for having the switch on.\n\
00087 # The second number is the duration for which the switch\n\
00088 # is off. The third is an 'on' period again, etc.\n\
00089 # A pattern is terminated with the end of the array.\n\
00090 # \n\
00091 # Example: [1,1] specifies an on-off sequence of 1 second. \n\
00092 \n\
00093 int8 ON = 1\n\
00094 int8 OFF = 0\n\
00095 int8 NO_CHANGE = -2\n\
00096 int8 REPEAT = -1\n\
00097 int8 FOREVER = -1\n\
00098 \n\
00099 int8 switch_mode\n\
00100 int32 num_cycles\n\
00101 float32[] pulse_pattern\n\
00102 \n\
00103 "; }
00104 public:
00105 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00106
00107 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00108
00109 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00110 {
00111 ros::serialization::OStream stream(write_ptr, 1000000000);
00112 ros::serialization::serialize(stream, timed_switch_array);
00113 return stream.getData();
00114 }
00115
00116 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00117 {
00118 ros::serialization::IStream stream(read_ptr, 1000000000);
00119 ros::serialization::deserialize(stream, timed_switch_array);
00120 return stream.getData();
00121 }
00122
00123 ROS_DEPRECATED virtual uint32_t serializationLength() const
00124 {
00125 uint32_t size = 0;
00126 size += ros::serialization::serializationLength(timed_switch_array);
00127 return size;
00128 }
00129
00130 typedef boost::shared_ptr< ::wiimote::LEDControl_<ContainerAllocator> > Ptr;
00131 typedef boost::shared_ptr< ::wiimote::LEDControl_<ContainerAllocator> const> ConstPtr;
00132 };
00133 typedef ::wiimote::LEDControl_<std::allocator<void> > LEDControl;
00134
00135 typedef boost::shared_ptr< ::wiimote::LEDControl> LEDControlPtr;
00136 typedef boost::shared_ptr< ::wiimote::LEDControl const> LEDControlConstPtr;
00137
00138
00139 template<typename ContainerAllocator>
00140 std::ostream& operator<<(std::ostream& s, const ::wiimote::LEDControl_<ContainerAllocator> & v)
00141 {
00142 ros::message_operations::Printer< ::wiimote::LEDControl_<ContainerAllocator> >::stream(s, "", v);
00143 return s;}
00144
00145 }
00146
00147 namespace ros
00148 {
00149 namespace message_traits
00150 {
00151 template<class ContainerAllocator>
00152 struct MD5Sum< ::wiimote::LEDControl_<ContainerAllocator> > {
00153 static const char* value()
00154 {
00155 return "d0477eee2c164b8a9582a596f92c6f08";
00156 }
00157
00158 static const char* value(const ::wiimote::LEDControl_<ContainerAllocator> &) { return value(); }
00159 static const uint64_t static_value1 = 0xd0477eee2c164b8aULL;
00160 static const uint64_t static_value2 = 0x9582a596f92c6f08ULL;
00161 };
00162
00163 template<class ContainerAllocator>
00164 struct DataType< ::wiimote::LEDControl_<ContainerAllocator> > {
00165 static const char* value()
00166 {
00167 return "wiimote/LEDControl";
00168 }
00169
00170 static const char* value(const ::wiimote::LEDControl_<ContainerAllocator> &) { return value(); }
00171 };
00172
00173 template<class ContainerAllocator>
00174 struct Definition< ::wiimote::LEDControl_<ContainerAllocator> > {
00175 static const char* value()
00176 {
00177 return "# Message to request Wiimote LED operations. The Wiimote has four\n\
00178 # LEDs. This message enables its user to turn each individual LED\n\
00179 # on or off, and to define a blink pattern for each LEDs.\n\
00180 # See TimedSwitch.msg for details.\n\
00181 \n\
00182 TimedSwitch[] timed_switch_array \n\
00183 \n\
00184 ================================================================================\n\
00185 MSG: wiimote/TimedSwitch\n\
00186 # TimedSwitch allows sender to:\n\
00187 # o turn a switch on,\n\
00188 # o turn a switch off, and\n\
00189 # o repeat an on/off pattern forever or for a\n\
00190 # given number of times.\n\
00191 # Fields (refer to definitions of constants in the definition body):\n\
00192 # o switch_mode:\n\
00193 # ON: turn on (num_cycles and pulse_pattern fields are ignored)\n\
00194 # OFF: turn off (num_cycles and pulse_pattern fields are ignored)\n\
00195 # NO_CHANGE: leave LED in its current state\n\
00196 # REPEAT: repeat an on/off pattern for as long\n\
00197 # as is indicated in the num_cycles field. The\n\
00198 # pattern is defined in the pulse_pattern field.\n\
00199 #\n\
00200 # o num_cycles:\n\
00201 # n>=0: run the pattern that is defined in pulse_pattern\n\
00202 # n times.\n\
00203 # n==FOREVER: run the pattern that is defined in pulse_pattern\n\
00204 # until a new TimedSwitch message is sent. \n\
00205 #\n\
00206 # o pulse_pattern:\n\
00207 # A series of time durations in fractions of a second. The\n\
00208 # first number is the duration for having the switch on.\n\
00209 # The second number is the duration for which the switch\n\
00210 # is off. The third is an 'on' period again, etc.\n\
00211 # A pattern is terminated with the end of the array.\n\
00212 # \n\
00213 # Example: [1,1] specifies an on-off sequence of 1 second. \n\
00214 \n\
00215 int8 ON = 1\n\
00216 int8 OFF = 0\n\
00217 int8 NO_CHANGE = -2\n\
00218 int8 REPEAT = -1\n\
00219 int8 FOREVER = -1\n\
00220 \n\
00221 int8 switch_mode\n\
00222 int32 num_cycles\n\
00223 float32[] pulse_pattern\n\
00224 \n\
00225 ";
00226 }
00227
00228 static const char* value(const ::wiimote::LEDControl_<ContainerAllocator> &) { return value(); }
00229 };
00230
00231 }
00232 }
00233
00234 namespace ros
00235 {
00236 namespace serialization
00237 {
00238
00239 template<class ContainerAllocator> struct Serializer< ::wiimote::LEDControl_<ContainerAllocator> >
00240 {
00241 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00242 {
00243 stream.next(m.timed_switch_array);
00244 }
00245
00246 ROS_DECLARE_ALLINONE_SERIALIZER;
00247 };
00248 }
00249 }
00250
00251 namespace ros
00252 {
00253 namespace message_operations
00254 {
00255
00256 template<class ContainerAllocator>
00257 struct Printer< ::wiimote::LEDControl_<ContainerAllocator> >
00258 {
00259 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::wiimote::LEDControl_<ContainerAllocator> & v)
00260 {
00261 s << indent << "timed_switch_array[]" << std::endl;
00262 for (size_t i = 0; i < v.timed_switch_array.size(); ++i)
00263 {
00264 s << indent << " timed_switch_array[" << i << "]: ";
00265 s << std::endl;
00266 s << indent;
00267 Printer< ::wiimote::TimedSwitch_<ContainerAllocator> >::stream(s, indent + " ", v.timed_switch_array[i]);
00268 }
00269 }
00270 };
00271
00272
00273 }
00274 }
00275
00276 #endif // WIIMOTE_MESSAGE_LEDCONTROL_H
00277