-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathICommunicationLayer.cs
More file actions
176 lines (155 loc) · 6.43 KB
/
ICommunicationLayer.cs
File metadata and controls
176 lines (155 loc) · 6.43 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
using System;
using System.Collections.Generic;
using Waher.Events;
using Waher.Networking.Sniffers;
namespace Waher.Networking
{
/// <summary>
/// Interface for observable classes implementing communication protocols.
/// </summary>
public interface ICommunicationLayer : IObservableLayer, IEnumerable<ISniffer>
{
/// <summary>
/// Adds a sniffer to the node.
/// </summary>
/// <param name="Sniffer">Sniffer to add.</param>
void Add(ISniffer Sniffer);
/// <summary>
/// Adds a range of sniffers to the node.
/// </summary>
/// <param name="Sniffers">Sniffers to add.</param>
void AddRange(IEnumerable<ISniffer> Sniffers);
/// <summary>
/// Removes a sniffer, if registered.
/// </summary>
/// <param name="Sniffer">Sniffer to remove.</param>
/// <returns>If the sniffer was found and removed.</returns>
bool Remove(ISniffer Sniffer);
/// <summary>
/// Registered sniffers.
/// </summary>
ISniffer[] Sniffers
{
get;
}
/// <summary>
/// If there are sniffers registered on the object.
/// </summary>
bool HasSniffers
{
get;
}
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="Count">Number of bytes received.</param>
void ReceiveBinary(int Count);
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="Count">Number of bytes received.</param>
void ReceiveBinary(DateTime Timestamp, int Count);
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
void ReceiveBinary(bool ConstantBuffer, byte[] Data);
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data);
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
/// <param name="Offset">Offset into buffer where received data begins.</param>
/// <param name="Count">Number of bytes received.</param>
void ReceiveBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count);
/// <summary>
/// Called when binary data has been received.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
/// <param name="Offset">Offset into buffer where received data begins.</param>
/// <param name="Count">Number of bytes received.</param>
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="Count">Number of bytes transmitted.</param>
void TransmitBinary(int Count);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="Count">Number of bytes transmitted.</param>
void TransmitBinary(DateTime Timestamp, int Count);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
void TransmitBinary(bool ConstantBuffer, byte[] Data);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
/// <param name="Offset">Offset into buffer where transmitted data begins.</param>
/// <param name="Count">Number of bytes transmitted.</param>
void TransmitBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count);
/// <summary>
/// Called when binary data has been transmitted.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="ConstantBuffer">If the contents of the buffer remains constant (true),
/// or if the contents in the buffer may change after the call (false).</param>
/// <param name="Data">Binary Data.</param>
/// <param name="Offset">Offset into buffer where transmitted data begins.</param>
/// <param name="Count">Number of bytes transmitted.</param>
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count);
/// <summary>
/// Called when text has been received.
/// </summary>
/// <param name="Text">Text</param>
void ReceiveText(string Text);
/// <summary>
/// Called when text has been received.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="Text">Text</param>
void ReceiveText(DateTime Timestamp, string Text);
/// <summary>
/// Called when text has been transmitted.
/// </summary>
/// <param name="Text">Text</param>
void TransmitText(string Text);
/// <summary>
/// Called when text has been transmitted.
/// </summary>
/// <param name="Timestamp">Timestamp of event.</param>
/// <param name="Text">Text</param>
void TransmitText(DateTime Timestamp, string Text);
}
}