Statistics
| Branch: | Revision:

root / quad2 / arduino / src / ros_lib / roscpp / SetLoggerLevel.h @ c1426757

History | View | Annotate | Download (2.32 KB)

1
#ifndef _ROS_SERVICE_SetLoggerLevel_h
2
#define _ROS_SERVICE_SetLoggerLevel_h
3
#include <stdint.h>
4
#include <string.h>
5
#include <stdlib.h>
6
#include "ros/msg.h"
7

    
8
namespace roscpp
9
{
10

    
11
static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel";
12

    
13
  class SetLoggerLevelRequest : public ros::Msg
14
  {
15
    public:
16
      char * logger;
17
      char * level;
18

    
19
    virtual int serialize(unsigned char *outbuffer) const
20
    {
21
      int offset = 0;
22
      uint32_t * length_logger = (uint32_t *)(outbuffer + offset);
23
      *length_logger = strlen( (const char*) this->logger);
24
      offset += 4;
25
      memcpy(outbuffer + offset, this->logger, *length_logger);
26
      offset += *length_logger;
27
      uint32_t * length_level = (uint32_t *)(outbuffer + offset);
28
      *length_level = strlen( (const char*) this->level);
29
      offset += 4;
30
      memcpy(outbuffer + offset, this->level, *length_level);
31
      offset += *length_level;
32
      return offset;
33
    }
34

    
35
    virtual int deserialize(unsigned char *inbuffer)
36
    {
37
      int offset = 0;
38
      uint32_t length_logger = *(uint32_t *)(inbuffer + offset);
39
      offset += 4;
40
      for(unsigned int k= offset; k< offset+length_logger; ++k){
41
          inbuffer[k-1]=inbuffer[k];
42
      }
43
      inbuffer[offset+length_logger-1]=0;
44
      this->logger = (char *)(inbuffer + offset-1);
45
      offset += length_logger;
46
      uint32_t length_level = *(uint32_t *)(inbuffer + offset);
47
      offset += 4;
48
      for(unsigned int k= offset; k< offset+length_level; ++k){
49
          inbuffer[k-1]=inbuffer[k];
50
      }
51
      inbuffer[offset+length_level-1]=0;
52
      this->level = (char *)(inbuffer + offset-1);
53
      offset += length_level;
54
     return offset;
55
    }
56

    
57
    const char * getType(){ return SETLOGGERLEVEL; };
58
    const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; };
59

    
60
  };
61

    
62
  class SetLoggerLevelResponse : public ros::Msg
63
  {
64
    public:
65

    
66
    virtual int serialize(unsigned char *outbuffer) const
67
    {
68
      int offset = 0;
69
      return offset;
70
    }
71

    
72
    virtual int deserialize(unsigned char *inbuffer)
73
    {
74
      int offset = 0;
75
     return offset;
76
    }
77

    
78
    const char * getType(){ return SETLOGGERLEVEL; };
79
    const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
80

    
81
  };
82

    
83
  class SetLoggerLevel {
84
    public:
85
    typedef SetLoggerLevelRequest Request;
86
    typedef SetLoggerLevelResponse Response;
87
  };
88

    
89
}
90
#endif