Serial Port Complete - Latest Microcontroller projects

(lily) #1
Managing Ports and Transfers in .NET

10


 


 


!


"
  2,!


The .NET Framework and its SerialPort class provide many properties, meth-
ods, and events that are useful in managing transfers. Applications can define
buffers to hold data, implement flow control to prevent lost data, and use tim-
ers or DataReceived events to detect received data. Parity bits can enable detect-
ing errors in received data. This chapter demonstrates how to use these
capabilities to transfer data efficiently and without errors.
The code in this chapter uses resources in the following namespaces:

 Imports System.IO.Ports
Imports System.Runtime.Remoting.Messaging ' used with asynchronous delegates


 using System.IO.Ports;
using System.Runtime.Remoting.Messaging; // used with asynchronous delegates
Several of the examples in this chapter use delegates to perform event-driven or
asynchronous (non-blocking) operations. A delegate is an object that defines
the number and type(s) of parameters a method accepts and the type of value

Free download pdf