forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUDPStream.cs
49 lines (36 loc) · 1.27 KB
/
UDPStream.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
using System.IO;
namespace MissionPlanner.Comms
{
public class UDPStream : Stream
{
private UdpSerial udpSerial;
public UDPStream(UdpSerial udpSerial)
{
this.udpSerial = udpSerial;
}
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => true;
public override long Length => throw new System.NotImplementedException();
public override long Position { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
public override void Flush()
{
}
public override int Read(byte[] buffer, int offset, int count)
{
return udpSerial.Read(buffer,offset,count);
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new System.NotImplementedException();
}
public override void SetLength(long value)
{
throw new System.NotImplementedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
udpSerial.Write(buffer,offset,count);
}
}
}