Repository navigation
Expand file tree
/
Copy pathDataBlock.cs
More file actions
64 lines (63 loc) · 2.57 KB
/
Copy pathDataBlock.cs
File metadata and controls
64 lines (63 loc) · 2.57 KB
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
61
62
63
64
namespace ModemAPI
{
/// <summary>
/// Represents a data block (a packet sequence), that is transferred by the TetroNet.
/// </summary>
public class DataBlock
{
/// <summary>
/// TetroNet subscriber address, that transmitted this data block.
/// </summary>
public Address Transmitter = new Address();
/// <summary>
/// TetroNet subscriber address, that is going to receive this data block.
/// </summary>
public Address Receiver = new Address();
/// <summary>
/// Data of the block, that was transferred in it.
/// </summary>
public List<byte> DataBytes = new List<byte>();
/// <summary>
/// String representation of the data of the block, that was transferred in it.
/// </summary>
public string DataString = "";
/// <summary>
/// Metadata string that was received, metadata may not exist, then value will be set to null.
/// </summary>
public string? Metadata = null;
/// <summary>
/// Query type of that data block.
/// </summary>
public string QueryType = "";
/// <summary>
/// ConnectionID for that data block.
/// </summary>
public uint ConnectionID = 0;
/// <summary>
/// Initializes a new instance of DataBlock with default values
/// </summary>
public DataBlock()
{
}
/// <summary>
/// Initializes a new instance of DataBlock with values, that will be taken from arguments
/// </summary>
/// <param name="transmitter">Address for transmitter</param>
/// <param name="receiver">Address for receiver</param>
/// <param name="data">Data for this data block</param>
/// <param name="data_">String representation of data for this data block</param>
/// <param name="metadata">String, that contains metadata for this data block</param>
/// <param name="qtype">Query type for this data block</param>
/// <param name="connectid">Connection ID for this data block</param>
public DataBlock(Address transmitter, Address receiver, List<byte> data, string data_, string? metadata, string qtype, uint connectid)
{
Transmitter = transmitter;
Receiver = receiver;
DataBytes = data;
DataString = data_;
Metadata = metadata;
QueryType = qtype;
ConnectionID = connectid;
}
}
}