Files
DP44/Common/DTS.Common/.svn/pristine/27/270a589ae1834f2182b5281e2e1d6a87314f8b16.svn-base
2026-04-17 14:55:32 -04:00

92 lines
3.0 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>
{
/// <summary>
/// Indicates an error occurred during setup
/// http://manuscript.dts.local/f/cases/43289/SW-no-longer-warns-when-hardware-is-in-bootloader-mode
/// </summary>
bool ErrorInSetup { get; set; }
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; }
}
}