Table of Contents

Interface ISerialPortClient

Namespace
AT.Librarys.Container.Toolkit.Communication
Assembly
AT.Librarys.Container.dll

串口客户端

public interface ISerialPortClient : IToolkitBase, IModuleBase
Inherited Members
Extension Methods

Properties

Connected

是否是连接状态

bool Connected { get; }

Property Value

bool

Methods

Connect()

连接

bool Connect()

Returns

bool

Disconnect()

断开连接

bool Disconnect()

Returns

bool

OnDataReceived(string, byte[])

触发数据接收事件

void OnDataReceived(string strContent, byte[] byteContent = null)

Parameters

strContent string

字符串内容

byteContent byte[]

字节内容

ReadBytes()

读取字节数组

byte[] ReadBytes()

Returns

byte[]

Send(byte[])

发送

bool Send(byte[] content)

Parameters

content byte[]

发送内容

Returns

bool

Send(string)

发送

bool Send(string content)

Parameters

content string

发送内容

Returns

bool

SendWait(byte[])

发送等待结果

byte[] SendWait(byte[] content)

Parameters

content byte[]

发送内容

Returns

byte[]

SendWait(byte[], int)

发送等待结果

byte[] SendWait(byte[] content, int waitTimeOut)

Parameters

content byte[]

发送内容

waitTimeOut int

等待超时

Returns

byte[]

SendWait(string)

发送等待结果

string SendWait(string content)

Parameters

content string

发送内容

Returns

string

SendWait(string, int)

发送等待结果

string SendWait(string content, int waitTimeOut)

Parameters

content string

发送内容

waitTimeOut int

等待超时

Returns

string

UseConfig()

应用配置

bool UseConfig()

Returns

bool

Events

DataReceived

数据接收事件

event EventHandler<ClientReceivedEventArgs> DataReceived

Event Type

EventHandler<ClientReceivedEventArgs>