-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICommunicator.cs
30 lines (25 loc) · 1.03 KB
/
ICommunicator.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
using CommsLIB.Base;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace CommsLIB
{
public delegate void DataReadyEventHandler(string ip, int port, long time, byte[] bytes, int offset, int length, string ID, ushort[] ipChunks);
public delegate void ConnectionStateDelegate(string ID, ConnUri uri, bool connected);
public delegate void DataRateDelegate(string ID, float MbpsRX, float MbpsTX);
public interface ICommunicator : IDisposable
{
public event DataRateDelegate DataRateEvent;
public event ConnectionStateDelegate ConnectionStateEvent;
public event DataReadyEventHandler DataReadyEvent;
string ID { get; set; }
ushort[] IpChunks { get; }
ConnUri CommsUri {get;}
void Init(ConnUri uri, bool persistent, string ID, int inactivityMS, int sendGAP = 0);
void Start();
Task Stop();
void SendASync(byte[] bytes, int length);
bool SendSync(byte[] bytes, int offset, int length);
}
}