61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using ChamChat.Models;
|
|
|
|
namespace ChamChat
|
|
{
|
|
public enum InterfaceType
|
|
{
|
|
Undefined,
|
|
FDTI_USB_COM422,
|
|
FDTI_USB_COM485,
|
|
FDTI_USB_RS232,
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract class Interface
|
|
{
|
|
public Interface()
|
|
{
|
|
_ID = null;
|
|
}
|
|
public Interface(String ID )
|
|
{
|
|
_ID = ID;
|
|
}
|
|
|
|
protected string _ID = null; public String ID { get { return _ID; }}
|
|
protected InterfaceType _Type = InterfaceType.Undefined; public InterfaceType Type { get { return _Type; } }
|
|
protected InterfaceStatus _InterfaceStatus; public InterfaceStatus InterfaceStatus { get { return _InterfaceStatus; } }
|
|
|
|
|
|
/// <summary>
|
|
/// Datatransfer sends to and reads from interface.
|
|
/// </summary>
|
|
/// <param name="Command">Command to send</param>
|
|
/// <param name="Data">Data read from client</param>
|
|
/// <param name="ReturnDataWaitms">Client dependent wait time in ms after sending command prior to reading reply</param>
|
|
public abstract DataTransferLog DataTransfer(String Command, out String Data, Int32 ReturnDataWaitms);
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Open static connection to the interface
|
|
/// </summary>
|
|
abstract public Boolean Open();
|
|
|
|
|
|
/// <summary>
|
|
/// Close connection to the interface
|
|
/// </summary>
|
|
abstract public Boolean Close();
|
|
}
|
|
|
|
|
|
|
|
}
|