CmdMessenger 3.0 CmdMessenger is a serial port messaging library for the Arduino

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Properties | Events | List of all members
CommandMessenger.SerialSettings Class Reference

Class containing properties related to a serial port More...

Inheritance diagram for CommandMessenger.SerialSettings:

## Public Member Functions
void | UpdateBaudRateCollection (int possibleBaudRates)
| Updates the range of possible baud rates for device More...

## Properties
string | PortName`[get, set]`
| The port to use (for example, COM1). More...
int | BaudRate`[get, set]`
| The baud rate. More...
Parity | Parity`[get, set]`
| One of the Parity values. More...
int | DataBits`[get, set]`
| The data bits value. More...
StopBits | StopBits`[get, set]`
| One of the StopBits values. More...
string[] | PortNameCollection`[get, set]`
| Available ports on the computer More...
BindingList< int > | BaudRateCollection`[get]`
| Available baud rates for current serial port More...
int[] | DataBitsCollection`[get, set]`
| Available databits setting More...

## Events
PropertyChangedEventHandler | PropertyChanged

## Detailed Description

Class containing properties related to a serial port

## Member Function Documentation

void CommandMessenger.SerialSettings.UpdateBaudRateCollection | ( | int | possibleBaudRates | ) |
| inline

Updates the range of possible baud rates for device

Parameters

  possibleBaudRates | dwSettableBaud parameter from the COMMPROP Structure

Returns
  An updated list of values

151 {
152 // ReSharper disable InconsistentNaming
153 const int BAUD_075 = 0x00000001; // The fifth baud 07
154 const int BAUD_110 = 0x00000002;
155 const int BAUD_150 = 0x00000008;
156 const int BAUD_300 = 0x00000010;
157 const int BAUD_600 = 0x00000020;
158 const int BAUD_1200 = 0x00000040;
159 const int BAUD_1800 = 0x00000080;
160 const int BAUD_2400 = 0x00000100;
161 const int BAUD_4800 = 0x00000200;
162 const int BAUD_7200 = 0x00000400;
163 const int BAUD_9600 = 0x00000800;
164 const int BAUD_14400 = 0x00001000;
165 const int BAUD_19200 = 0x00002000;
166 const int BAUD_38400 = 0x00004000;
167 const int BAUD_56K = 0x00008000;
168 const int BAUD_57600 = 0x00040000;
169 const int BAUD_115200 = 0x00020000;
170 const int BAUD_128K = 0x00010000;
171 // ReSharper restore InconsistentNaming
172 _baudRateCollection.Clear();
173
174 if ((possibleBaudRates & BAUD_075) > 0)
175 _baudRateCollection.Add(75);
176 if ((possibleBaudRates & BAUD_110) > 0)
177 _baudRateCollection.Add(110);
178 if ((possibleBaudRates & BAUD_150) > 0)
179 _baudRateCollection.Add(150);
180 if ((possibleBaudRates & BAUD_300) > 0)
181 _baudRateCollection.Add(300);
182 if ((possibleBaudRates & BAUD_600) > 0)
183 _baudRateCollection.Add(600);
184 if ((possibleBaudRates & BAUD_1200) > 0)
185 _baudRateCollection.Add(1200);
186 if ((possibleBaudRates & BAUD_1800) > 0)
187 _baudRateCollection.Add(1800);
188 if ((possibleBaudRates & BAUD_2400) > 0)
189 _baudRateCollection.Add(2400);
190 if ((possibleBaudRates & BAUD_4800) > 0)
191 _baudRateCollection.Add(4800);
192 if ((possibleBaudRates & BAUD_7200) > 0)
193 _baudRateCollection.Add(7200);
194 if ((possibleBaudRates & BAUD_9600) > 0)
195 _baudRateCollection.Add(9600);
196 if ((possibleBaudRates & BAUD_14400) > 0)
197 _baudRateCollection.Add(14400);
198 if ((possibleBaudRates & BAUD_19200) > 0)
199 _baudRateCollection.Add(19200);
200 if ((possibleBaudRates & BAUD_38400) > 0)
201 _baudRateCollection.Add(38400);
202 if ((possibleBaudRates & BAUD_56K) > 0)
203 _baudRateCollection.Add(56000);
204 if ((possibleBaudRates & BAUD_57600) > 0)
205 _baudRateCollection.Add(57600);
206 if ((possibleBaudRates & BAUD_115200) > 0)
207 _baudRateCollection.Add(115200);
208 if ((possibleBaudRates & BAUD_128K) > 0)
209 _baudRateCollection.Add(128000);
210
211 SendPropertyChangedEvent("BaudRateCollection");
212 }

## Property Documentation

int CommandMessenger.SerialSettings.BaudRate
| get set

The baud rate.

Referenced by CommandMessenger.SerialPortManager.StartListening().

BindingList<int> CommandMessenger.SerialSettings.BaudRateCollection
| get

Available baud rates for current serial port

int CommandMessenger.SerialSettings.DataBits
| get set

The data bits value.

Referenced by CommandMessenger.SerialPortManager.StartListening().

int [] CommandMessenger.SerialSettings.DataBitsCollection
| get set

Available databits setting

Parity CommandMessenger.SerialSettings.Parity
| get set

One of the Parity values.

Referenced by CommandMessenger.SerialPortManager.StartListening().

string CommandMessenger.SerialSettings.PortName
| get set

The port to use (for example, COM1).

Referenced by CommandMessenger.SerialPortManager.StartListening(), and CommandMessenger.SerialPortManager.UpdateBaudRateCollection().

string [] CommandMessenger.SerialSettings.PortNameCollection
| get set

Available ports on the computer

Referenced by CommandMessenger.SerialPortManager.Initialize().

StopBits CommandMessenger.SerialSettings.StopBits
| get set

One of the StopBits values.

Referenced by CommandMessenger.SerialPortManager.StartListening().

The documentation for this class was generated from the following file:

- D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/SerialSettings.cs