C# Class XBeeP.CommunicationManager

显示文件 Open project: Skye07/XBeeP Class Usage Examples

Public Methods

Method Description
ClosePort ( ) : bool
CommunicationManager ( ) : System

Comstructor to set the properties of our serial port communicator to nothing

CommunicationManager ( string baud, string par, string sBits, string dBits, string name, System.Windows.Forms.RichTextBox rtb ) : System

Constructor to set the properties of our Manager Class

OpenPort ( ) : bool
SetParityValues ( object obj ) : void
SetPortNameValues ( object obj ) : void
SetStopBitValues ( object obj ) : void
WriteData ( string msg ) : void
comPort_DataReceived ( object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void

method that will be called when theres data waiting in the buffer

Private Methods

Method Description
ByteToHex ( byte comByte ) : string

method to convert a byte array into a hex string

DisplayData ( MessageType type, string msg ) : void
HexToByte ( string msg ) : byte[]

method to convert hex string into a byte array

Method Details

ClosePort() public method

public ClosePort ( ) : bool
return bool

CommunicationManager() public method

Comstructor to set the properties of our serial port communicator to nothing
public CommunicationManager ( ) : System
return System

CommunicationManager() public method

Constructor to set the properties of our Manager Class
public CommunicationManager ( string baud, string par, string sBits, string dBits, string name, System.Windows.Forms.RichTextBox rtb ) : System
baud string Desired BaudRate
par string Desired Parity
sBits string Desired StopBits
dBits string Desired DataBits
name string Desired PortName
rtb System.Windows.Forms.RichTextBox
return System

OpenPort() public method

public OpenPort ( ) : bool
return bool

SetParityValues() public method

public SetParityValues ( object obj ) : void
obj object
return void

SetPortNameValues() public method

public SetPortNameValues ( object obj ) : void
obj object
return void

SetStopBitValues() public method

public SetStopBitValues ( object obj ) : void
obj object
return void

WriteData() public method

public WriteData ( string msg ) : void
msg string
return void

comPort_DataReceived() public method

method that will be called when theres data waiting in the buffer
public comPort_DataReceived ( object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void
sender object
e System.IO.Ports.SerialDataReceivedEventArgs
return void