开发者

Sync class library for async serial port calls in C#

I need to write a .NET 2.0 C# class library to wrap some calls to a serial port.

I already know that using DataReceived event of the SerialPort object is (probably) the best way to read data from the port just when they are available for read.

Nevertheless, calls to my class library should be sync and then I can't use DataRe开发者_JAVA技巧ceived that is async.

Is there a suggested develop pattern to do a thing like that?

Thanks, Manuel


Just use a while loop while waiting for your data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜