You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jv...@apache.org on 2007/04/06 17:13:09 UTC
svn commit: r526193 - in
/mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial:
SerialAddress.java SerialSessionConfig.java
Author: jvermillard
Date: Fri Apr 6 08:13:08 2007
New Revision: 526193
URL: http://svn.apache.org/viewvc?view=rev&rev=526193
Log:
Serial commnunication javadoc
Modified:
mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialAddress.java
mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialSessionConfig.java
Modified: mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialAddress.java
URL: http://svn.apache.org/viewvc/mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialAddress.java?view=diff&rev=526193&r1=526192&r2=526193
==============================================================================
--- mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialAddress.java (original)
+++ mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialAddress.java Fri Apr 6 08:13:08 2007
@@ -63,6 +63,16 @@
private FlowControl flowControl;
+ /**
+ * Create an address for a serial communication, associating a serial interface and
+ * various serial signal carcteristics.
+ * @param name name of the device, COM1 COM2 for Windows, /dev/ttyS0 for Unix
+ * @param bauds baud rate for the communication
+ * @param dataBits number of data bits per bytes
+ * @param stopBits number of stop bits
+ * @param parity parity used
+ * @param flowControl flow control used
+ */
public SerialAddress(String name, int bauds, int dataBits,
StopBits stopBits, Parity parity, FlowControl flowControl) {
super();
@@ -74,30 +84,56 @@
this.flowControl = flowControl;
}
+ /**
+ * Bauds rate for the communication.
+ * @return the bauds (bits per seconds) for this serial link
+ */
public int getBauds() {
return bauds;
}
+ /**
+ * Number of data bits for each communicated bytes.
+ * @return the data bits
+ */
public int getDataBits() {
return dataBits;
}
+ /**
+ * The flow control policie used for this communication.
+ * @return the flow control
+ */
public FlowControl getFlowControl() {
return flowControl;
}
+ /**
+ * The name of the device. Can be COM1, COM2, /dev/ttyS0, /dev/ttyUSB1, etc..
+ * @return name
+ */
public String getName() {
return name;
}
-
+
+ /**
+ * The parity check for this communication.
+ * @return parity type
+ */
public Parity getParity() {
return parity;
}
+ /**
+ * Number of stop bits used.
+ * @return stop bits number
+ */
public StopBits getStopBits() {
return stopBits;
}
-
+ /**
+ * Convert this serial address to a human readable string.
+ */
public String toString() {
return "serial(" + name + ",bauds:" + bauds + ",databits:" + dataBits
+ ",stopbits:" + stopBits + ",parity:" + parity
Modified: mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialSessionConfig.java
URL: http://svn.apache.org/viewvc/mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialSessionConfig.java?view=diff&rev=526193&r1=526192&r2=526193
==============================================================================
--- mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialSessionConfig.java (original)
+++ mina/sandbox/jvermillard/serial/src/main/java/org/apache/mina/transport/serial/SerialSessionConfig.java Fri Apr 6 08:13:08 2007
@@ -23,25 +23,60 @@
/**
* An {@link IoSessionConfig} for serial transport type.
- *
+ * All those parameters are extracted from rxtx.org API for more details :
+ * http://www.rxtx.org
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev: 0 $, $Date: 0 $
*/
public interface SerialSessionConfig extends IoSessionConfig {
+ /**
+ * Gets the input buffer size. Note that this method is advisory and the underlying OS
+ * may choose not to report correct values for the buffer size.
+ * @return input buffer size in bytes
+ */
int getInputBufferSize();
+ /**
+ * Sets the input buffer size. Note that this is advisory and memory availability may
+ * determine the ultimate buffer size used by the driver.
+ * @param bufferSize the buffer size in bytes
+ */
void setInputBufferSize(int bufferSize);
+ /**
+ * Is the low latency mode is enabled.
+ * @return low latency on
+ */
boolean isLowLantecy();
+ /**
+ * Set the low latency mode, be carefull it's not supported by all the OS/hardware.
+ * @param lowLatency
+ */
void setLowLatency(boolean lowLatency);
+ /**
+ * TODO : to test if it's usefull for MINA
+ * @return
+ */
int getReceiveThreshold();
+ /**
+ * TODO : to test if it's usefull for MINA
+ * @param bytes
+ */
void setReceiveThreshold(int bytes);
+ /**
+ * TODO : to test if it's usefull for MINA
+ * @param bytes
+ */
int getReceiveTimeout();
+ /**
+ * TODO : to test if it's usefull for MINA
+ * @param bytes
+ */
void setReceiveTimeout(int milliseconds);
}