-
Notifications
You must be signed in to change notification settings - Fork 9
/
Packet.cs
50 lines (38 loc) · 1.13 KB
/
Packet.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
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace GeoFramework.Gps
{
/// <summary>
/// Represents a base class for designing GPS data packets.
/// </summary>
public abstract class Packet : IFormattable
{
#region Abstract Properties
/// <summary>
/// Returns whether the pack data is well-formed.
/// </summary>
public abstract bool IsValid { get; }
#endregion
#region Abstract Methods
/// <summary>
/// Converts the packet into an array of bytes.
/// </summary>
/// <returns></returns>
public abstract byte[] ToByteArray();
#endregion
#region Overrides
public override string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
#endregion
#region IFormattable Members
public virtual string ToString(string format, IFormatProvider formatProvider)
{
return base.ToString();
}
#endregion
}
}