Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SerialParameters.java

Go to the documentation of this file.
00001 /*
00002  * SerialParameters.java
00003  *
00004  * Copyright (C) 2005 Project SQUID, http://www.cs.helsinki.fi/group/squid/
00005  *
00006  * This file is part of Ikayaki.
00007  *
00008  * Ikayaki is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * Ikayaki is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with Ikayaki; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00021  */
00022 
00023 package ikayaki.squid;
00024 
00025 import javax.comm.SerialPort;
00026 
00032 public class SerialParameters {
00033 
00037     private String portName;
00038 
00042     private int baudRate;
00043 
00047     private int flowControlIn;
00048 
00052     private int flowControlOut;
00053 
00057     private int databits;
00058 
00062     private int stopbits;
00063 
00067     private int parity;
00068 
00080     public SerialParameters(String portName, int baudRate, int flowControlIn, int flowControlOut,
00081                             int databits, int stopbits, int parity) {
00082         this.portName = portName;
00083         this.baudRate = baudRate;
00084         this.flowControlIn = flowControlIn;
00085         this.flowControlOut = flowControlOut;
00086         this.databits = databits;
00087         this.stopbits = stopbits;
00088         this.parity = parity;
00089     }
00090 
00097     public SerialParameters(String portName) {
00098         this.portName = portName;
00099         this.baudRate = 1200;
00100         this.flowControlIn = SerialPort.FLOWCONTROL_NONE;
00101         this.flowControlOut = SerialPort.FLOWCONTROL_NONE;
00102         this.databits = SerialPort.DATABITS_8;
00103         this.stopbits = SerialPort.STOPBITS_1;
00104         this.parity = SerialPort.PARITY_NONE;
00105     }
00106 
00107     public String getPortName() {
00108         return portName;
00109     }
00110 
00111     public int getBaudRate() {
00112         return baudRate;
00113     }
00114 
00115     public int getFlowControlIn() {
00116         return flowControlIn;
00117     }
00118 
00119     public int getFlowControlOut() {
00120         return flowControlOut;
00121     }
00122 
00123     public int getDatabits() {
00124         return databits;
00125     }
00126 
00127     public int getStopbits() {
00128         return stopbits;
00129     }
00130 
00131     public int getParity() {
00132         return parity;
00133     }
00134 }

Generated on Fri May 6 16:00:33 2005 for Squid by  doxygen 1.4.1