S Morita / mbed-mros2

Dependents:   mbed-os-example-mros2 example-mbed-mros2-sub-pose example-mbed-mros2-pub-twist example-mbed-mros2-mturtle-teleop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers u_int16.hpp Source File

u_int16.hpp

00001 #include <string>
00002 
00003 namespace std_msgs
00004 {
00005 namespace msg
00006 {
00007 class UInt16
00008 {
00009 public:
00010   std::string getTypeName();
00011   uint16_t data;
00012   void copyToBuf(uint8_t *addrPtr)
00013   {
00014     memcpy(addrPtr, &data, 2);
00015     addrPtr += 2;
00016   }
00017 
00018   void copyFromBuf(const uint8_t *addrPtr)
00019   {
00020     memcpy(&data, addrPtr, 2);
00021     addrPtr += 2;
00022   }
00023 
00024   void memAlign(uint8_t *addrPtr){
00025     return;
00026   }
00027 
00028   uint8_t getTotalSize()
00029   {
00030     return 2;
00031   }
00032 private:
00033   std::string type_name = "std_msgs::msg::dds_::UInt16";
00034 };
00035 }//namspace msg
00036 }//namespace std_msgs
00037 
00038 namespace message_traits
00039 {
00040 
00041 template<>
00042 struct TypeName<std_msgs::msg::UInt16*> {
00043   static const char* value()
00044   {
00045     return "std_msgs::msg::dds_::UInt16_";
00046   }
00047 };
00048 
00049 }