org.wcb.autohome.implementations
Class SerialPortBean

java.lang.Object
  extended byorg.wcb.autohome.implementations.SerialPortBean
All Implemented Interfaces:
java.io.Serializable

public class SerialPortBean
extends java.lang.Object
implements java.io.Serializable

Copyright (C) 1999 Walter Bogaardt This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 SerialPortBean.java Created on February 2, 2004, 7:59 PM

Author:
wbogaardt Project: Home Automation Interface Filename: $Id: SerialPortBean.java,v 1.2 2004/02/24 23:16:19 wbogaardt Exp $ Abstract: This allows persistence of centeralized values accross the sessions and gateways. $Log: SerialPortBean.java,v $ Revision 1.2 2004/02/24 23:16:19 wbogaardt fixed formating to be compliant with checkstyles Revision 1.1 2004/02/03 00:35:10 wbogaardt reogranized files so that serial port settings are maintained in a bean to interface with config file
See Also:
Serialized Form

Constructor Summary
SerialPortBean(java.lang.String sPortName)
          Takes in the port id value of the serial port this can be either COM1 for windows or /dev/TTYS01 for unix.
 
Method Summary
 int getBaud()
          Returns the baud rate.
 int getDataBit()
          Returns the data bit.
 java.lang.String getParity()
          Returns the parity of the serial connection.
 java.lang.String getPort()
          Returns the string name of the serial port.
 int getStopBit()
          Returns the stop bit of the interface's serial connection.
 void setBaud(int iB)
          Allows interface to set the baud rate of the serial port
 void setDataBit(int idata)
          Sets the data bit value for the serial port.
 void setParity(java.lang.String sparity)
          Sets the serial port party to a string value.
 void setPort(java.lang.String sPortName)
          Sets the serial port to the passed in string value.
 void setStopBit(int iStop)
          Sets the serial port stop bit value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialPortBean

public SerialPortBean(java.lang.String sPortName)
Takes in the port id value of the serial port this can be either COM1 for windows or /dev/TTYS01 for unix.

Parameters:
sPortName - Serial port identifier as a string
Method Detail

setPort

public void setPort(java.lang.String sPortName)
Sets the serial port to the passed in string value. In windows environment this would be the string of COM1 or COM2. For Unix based it would be something like /dev/ttys0 or /dev/ttys1.

Parameters:
sPortName - SerialPortBean representation of the port and values

setBaud

public void setBaud(int iB)
Allows interface to set the baud rate of the serial port

Parameters:
iB - should be one of these values 300, 2400, 4800, 9600, 14400, 28800, 38400, 57600, 115200

setDataBit

public void setDataBit(int idata)
Sets the data bit value for the serial port.

Parameters:
idata - should be a value of 5, 6, 7, or 8

setStopBit

public void setStopBit(int iStop)
Sets the serial port stop bit value

Parameters:
iStop - should be int value of 1 or 2

setParity

public void setParity(java.lang.String sparity)
Sets the serial port party to a string value.

Parameters:
sparity - should be a string value of None, Even, or Odd

getPort

public java.lang.String getPort()
Returns the string name of the serial port.

Returns:
defaults to null value.

getBaud

public int getBaud()
Returns the baud rate.

Returns:
defaults to 4800

getDataBit

public int getDataBit()
Returns the data bit.

Returns:
defaults to 8

getStopBit

public int getStopBit()
Returns the stop bit of the interface's serial connection.

Returns:
defaults to 1.

getParity

public java.lang.String getParity()
Returns the parity of the serial connection.

Returns:
defaults to "None"


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.