87 lines
2.7 KiB
Plaintext
87 lines
2.7 KiB
Plaintext
|
|
using DTS.Common.Enums.Communication;
|
||
|
|
using DTS.Common.Enums.DASFactory;
|
||
|
|
using DTS.Common.Interface.Communication;
|
||
|
|
using DTS.Common.Interface.Connection;
|
||
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Threading;
|
||
|
|
|
||
|
|
namespace DTS.Common.Interface.DASFactory
|
||
|
|
{
|
||
|
|
public interface ICommunication: IComparable<ICommunication>, IComparable<string>
|
||
|
|
{
|
||
|
|
IConnection Transport { get; set; }
|
||
|
|
/// <summary>
|
||
|
|
/// setups the receivebuffer and callback, this needs to be done whenever
|
||
|
|
/// the sock is connected
|
||
|
|
/// </summary>
|
||
|
|
void SetupReader();
|
||
|
|
int ReceiveBufferSize { get; set; }
|
||
|
|
|
||
|
|
string SerialNumber { get; set; }
|
||
|
|
|
||
|
|
string FirmwareVersion { get; set; }
|
||
|
|
|
||
|
|
byte ProtocolVersion { get; set; }
|
||
|
|
|
||
|
|
ICommunication_DASInfo DASInfo { get; set; }
|
||
|
|
|
||
|
|
Dictionary<DFConstantsAndEnums.ProtocolLimitedCommands, byte> MinimumProtocols { get; set; }
|
||
|
|
|
||
|
|
void InitMinProto();
|
||
|
|
|
||
|
|
bool IsCommandSupported(DFConstantsAndEnums.ProtocolLimitedCommands command);
|
||
|
|
|
||
|
|
byte GetMinProto(DFConstantsAndEnums.ProtocolLimitedCommands command);
|
||
|
|
|
||
|
|
event EventHandler OnDisconnected;
|
||
|
|
|
||
|
|
string ConnectString { get; }
|
||
|
|
|
||
|
|
bool Connected { get; }
|
||
|
|
|
||
|
|
void Connect(string ConnectString,
|
||
|
|
CommunicationConstantsAndEnums.CommunicationCallback Callback,
|
||
|
|
object CallbackObject,
|
||
|
|
int CallbackTimeout, string ipAddress);
|
||
|
|
|
||
|
|
void Disconnect(bool reuseSocket,
|
||
|
|
CommunicationConstantsAndEnums.CommunicationCallback Callback,
|
||
|
|
object CallbackObject,
|
||
|
|
int CallbackTimeout);
|
||
|
|
|
||
|
|
void Close(int Timeout);
|
||
|
|
|
||
|
|
void Flush(int Timeout);
|
||
|
|
|
||
|
|
bool ExecuteIsBusy { get; set; }
|
||
|
|
|
||
|
|
void Execute(byte[] byteData,
|
||
|
|
CommunicationConstantsAndEnums.CommunicationCallback Callback,
|
||
|
|
object CallbackObject,
|
||
|
|
int CallbackTimeout);
|
||
|
|
|
||
|
|
void PseudoExecute(byte[] byteData,
|
||
|
|
CommunicationConstantsAndEnums.CommunicationCallback Callback,
|
||
|
|
object CallbackObject,
|
||
|
|
int CallbackTimeout);
|
||
|
|
|
||
|
|
byte[] SyncExecute(byte[] byteData,
|
||
|
|
int Timeout);
|
||
|
|
|
||
|
|
void Cancel();
|
||
|
|
void ForceCancel();
|
||
|
|
|
||
|
|
bool IsCanceled();
|
||
|
|
|
||
|
|
void ClearCancel();
|
||
|
|
/// <summary>
|
||
|
|
/// event that will signal if cancel has happened
|
||
|
|
/// prior to this IsCanceled would have to be checked
|
||
|
|
/// or polled
|
||
|
|
/// 17600 Communication class improvements from 3.2
|
||
|
|
/// </summary>
|
||
|
|
ManualResetEvent CancelEvent { get; }
|
||
|
|
}
|
||
|
|
}
|