-
Notifications
You must be signed in to change notification settings - Fork 0
/
UInt16.cs
60 lines (51 loc) · 1.79 KB
/
UInt16.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
//////////////////////////////////////////////////
///// AUTOGENERATED MESSAGE DEFINITION /////
//////////////////////////////////////////////////
///// DO NOT MODIFY BY HAND! /////
//////////////////////////////////////////////////
namespace ROS_CS
{
namespace std_msgs
{
public class UInt16 : ROS_CS.Core.BaseMessage
{
public readonly string typeID = "UInt16";
public readonly string md5sum = "1df79edf208b629fe6b81923a544552d";
public System.UInt16 data;
public UInt16 ()
{
data = 0;
}
public override string ToString ()
{
return ROS_CS.Core.PrettyPrinter.PrettyPrint(ToStringRaw());
}
public override string ToStringRaw ()
{
string string_rep = typeID + ":\n";
string_rep += "data: " + Convert.ToString(data) + "\n";
return string_rep;
}
public override void Serialize(MemoryStream stream)
{
System.Byte[] data_bytes = BitConverter.GetBytes(data);
stream.Write(data_bytes, 0, data_bytes.Length);
}
public override int Deserialize(System.Byte[] serialized)
{
return Deserialize(serialized, 0);
}
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
data = BitConverter.ToUInt16(serialized, curIndex);
curIndex += BitConverter.GetBytes(data).Length;
return (curIndex - startIndex);
}
}
}
}