RXTX -> Rxtx for consistent naming convention
This commit is contained in:
parent
b9b2366361
commit
0007e91923
6
pom.xml
6
pom.xml
|
@ -281,12 +281,8 @@
|
|||
<configuration>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<logViolationsToConsole>true</logViolationsToConsole>
|
||||
<!-- Disabled temporarily until all violations are fixed.
|
||||
<failsOnError>true</failsOnError>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
-->
|
||||
<failsOnError>false</failsOnError>
|
||||
<failOnViolation>false</failOnViolation>
|
||||
<configLocation>io/netty/checkstyle.xml</configLocation>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -295,7 +291,7 @@
|
|||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>netty-build</artifactId>
|
||||
<version>1</version>
|
||||
<version>2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
|
@ -29,26 +29,26 @@ import io.netty.channel.ChannelSink;
|
|||
/**
|
||||
* A channel to a serial device using the RXTX library.
|
||||
*/
|
||||
public class RRXTXChannel extends AbstractChannel {
|
||||
public class RxtxChannel extends AbstractChannel {
|
||||
|
||||
RRXTXChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline,
|
||||
final ChannelSink sink) {
|
||||
RxtxChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline,
|
||||
final ChannelSink sink) {
|
||||
super(parent, factory, pipeline, sink);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelConfig getConfig() {
|
||||
return ((RRXTXChannelSink) getPipeline().getSink()).getConfig();
|
||||
return ((RxtxChannelSink) getPipeline().getSink()).getConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBound() {
|
||||
return ((RRXTXChannelSink) getPipeline().getSink()).isBound();
|
||||
return ((RxtxChannelSink) getPipeline().getSink()).isBound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return ((RRXTXChannelSink) getPipeline().getSink()).isConnected();
|
||||
return ((RxtxChannelSink) getPipeline().getSink()).isConnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +58,7 @@ public class RRXTXChannel extends AbstractChannel {
|
|||
|
||||
@Override
|
||||
public SocketAddress getRemoteAddress() {
|
||||
return ((RRXTXChannelSink) getPipeline().getSink()).getRemoteAddress();
|
||||
return ((RxtxChannelSink) getPipeline().getSink()).getRemoteAddress();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -23,7 +23,7 @@ import io.netty.util.internal.ConversionUtil;
|
|||
/**
|
||||
* A configuration class for RXTX device connections.
|
||||
*/
|
||||
public class RRXTXChannelConfig extends DefaultChannelConfig {
|
||||
public class RxtxChannelConfig extends DefaultChannelConfig {
|
||||
|
||||
public enum Stopbits {
|
||||
|
||||
|
@ -112,18 +112,18 @@ public class RRXTXChannelConfig extends DefaultChannelConfig {
|
|||
|
||||
private boolean rts;
|
||||
|
||||
private Stopbits stopbits = RRXTXChannelConfig.Stopbits.STOPBITS_1;
|
||||
private Stopbits stopbits = RxtxChannelConfig.Stopbits.STOPBITS_1;
|
||||
|
||||
private Databits databits = RRXTXChannelConfig.Databits.DATABITS_8;
|
||||
private Databits databits = RxtxChannelConfig.Databits.DATABITS_8;
|
||||
|
||||
private Paritybit paritybit = RRXTXChannelConfig.Paritybit.NONE;
|
||||
private Paritybit paritybit = RxtxChannelConfig.Paritybit.NONE;
|
||||
|
||||
public RRXTXChannelConfig() {
|
||||
public RxtxChannelConfig() {
|
||||
// work with defaults ...
|
||||
}
|
||||
|
||||
public RRXTXChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits,
|
||||
final Databits databits, final Paritybit paritybit) {
|
||||
public RxtxChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits,
|
||||
final Databits databits, final Paritybit paritybit) {
|
||||
this.baudrate = baudrate;
|
||||
this.dtr = dtr;
|
||||
this.rts = rts;
|
|
@ -27,22 +27,22 @@ import io.netty.channel.group.DefaultChannelGroup;
|
|||
import io.netty.util.internal.ExecutorUtil;
|
||||
|
||||
/**
|
||||
* A {@link ChannelFactory} for creating {@link RRXTXChannel} instances.
|
||||
* A {@link ChannelFactory} for creating {@link RxtxChannel} instances.
|
||||
*/
|
||||
public class RRXTXChannelFactory implements ChannelFactory {
|
||||
public class RxtxChannelFactory implements ChannelFactory {
|
||||
|
||||
private final ChannelGroup channels = new DefaultChannelGroup("RXTXChannelFactory-ChannelGroup");
|
||||
|
||||
private final ExecutorService executor;
|
||||
|
||||
public RRXTXChannelFactory(ExecutorService executor) {
|
||||
public RxtxChannelFactory(ExecutorService executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Channel newChannel(final ChannelPipeline pipeline) {
|
||||
RRXTXChannelSink sink = new RRXTXChannelSink(executor);
|
||||
RRXTXChannel channel = new RRXTXChannel(null, this, pipeline, sink);
|
||||
RxtxChannelSink sink = new RxtxChannelSink(executor);
|
||||
RxtxChannel channel = new RxtxChannel(null, this, pipeline, sink);
|
||||
sink.setChannel(channel);
|
||||
channels.add(channel);
|
||||
return channel;
|
|
@ -48,17 +48,17 @@ import io.netty.channel.UpstreamMessageEvent;
|
|||
/**
|
||||
* A {@link ChannelSink} implementation of the RXTX support for Netty.
|
||||
*/
|
||||
public class RRXTXChannelSink extends AbstractChannelSink {
|
||||
public class RxtxChannelSink extends AbstractChannelSink {
|
||||
|
||||
private static class WriteRunnable implements Runnable {
|
||||
|
||||
private final DefaultChannelFuture future;
|
||||
|
||||
private final RRXTXChannelSink channelSink;
|
||||
private final RxtxChannelSink channelSink;
|
||||
|
||||
private final ChannelBuffer message;
|
||||
|
||||
public WriteRunnable(final DefaultChannelFuture future, final RRXTXChannelSink channelSink,
|
||||
public WriteRunnable(final DefaultChannelFuture future, final RxtxChannelSink channelSink,
|
||||
final ChannelBuffer message) {
|
||||
this.future = future;
|
||||
this.channelSink = channelSink;
|
||||
|
@ -83,9 +83,9 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
|
||||
private final DefaultChannelFuture channelFuture;
|
||||
|
||||
private final RRXTXChannelSink channelSink;
|
||||
private final RxtxChannelSink channelSink;
|
||||
|
||||
ConnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) {
|
||||
ConnectRunnable(final DefaultChannelFuture channelFuture, final RxtxChannelSink channelSink) {
|
||||
this.channelFuture = channelFuture;
|
||||
this.channelSink = channelSink;
|
||||
}
|
||||
|
@ -145,9 +145,9 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
|
||||
private final DefaultChannelFuture channelFuture;
|
||||
|
||||
private final RRXTXChannelSink channelSink;
|
||||
private final RxtxChannelSink channelSink;
|
||||
|
||||
public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) {
|
||||
public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RxtxChannelSink channelSink) {
|
||||
this.channelFuture = channelFuture;
|
||||
this.channelSink = channelSink;
|
||||
}
|
||||
|
@ -203,20 +203,20 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
|
||||
private final Executor executor;
|
||||
|
||||
final RRXTXChannelConfig config;
|
||||
final RxtxChannelConfig config;
|
||||
|
||||
RRXTXChannel channel;
|
||||
RxtxChannel channel;
|
||||
|
||||
public RRXTXChannelSink(final Executor executor) {
|
||||
public RxtxChannelSink(final Executor executor) {
|
||||
this.executor = executor;
|
||||
config = new RRXTXChannelConfig();
|
||||
config = new RxtxChannelConfig();
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return inputStream != null && outputStream != null;
|
||||
}
|
||||
|
||||
public RRXTXDeviceAddress getRemoteAddress() {
|
||||
public RxtxDeviceAddress getRemoteAddress() {
|
||||
return remoteAddress;
|
||||
}
|
||||
|
||||
|
@ -228,15 +228,15 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
return config;
|
||||
}
|
||||
|
||||
public void setChannel(final RRXTXChannel channel) {
|
||||
public void setChannel(final RxtxChannel channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
private static class RXTXSerialPortEventListener implements SerialPortEventListener {
|
||||
|
||||
private final RRXTXChannelSink channelSink;
|
||||
private final RxtxChannelSink channelSink;
|
||||
|
||||
public RXTXSerialPortEventListener(final RRXTXChannelSink channelSink) {
|
||||
public RXTXSerialPortEventListener(final RxtxChannelSink channelSink) {
|
||||
this.channelSink = channelSink;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
}
|
||||
}
|
||||
|
||||
RRXTXDeviceAddress remoteAddress;
|
||||
RxtxDeviceAddress remoteAddress;
|
||||
|
||||
BufferedOutputStream outputStream;
|
||||
|
||||
|
@ -302,7 +302,7 @@ public class RRXTXChannelSink extends AbstractChannelSink {
|
|||
|
||||
case CONNECTED:
|
||||
if (value != null) {
|
||||
remoteAddress = (RRXTXDeviceAddress) value;
|
||||
remoteAddress = (RxtxDeviceAddress) value;
|
||||
executor.execute(new ConnectRunnable((DefaultChannelFuture) future, this));
|
||||
} else {
|
||||
executor.execute(new DisconnectRunnable((DefaultChannelFuture) future, this));
|
|
@ -21,7 +21,7 @@ import java.net.SocketAddress;
|
|||
* A {@link SocketAddress} subclass to wrap the serial port address of a RXTX
|
||||
* device (e.g. COM1, /dev/ttyUSB0).
|
||||
*/
|
||||
public class RRXTXDeviceAddress extends SocketAddress {
|
||||
public class RxtxDeviceAddress extends SocketAddress {
|
||||
|
||||
private static final long serialVersionUID = -2907820090993709523L;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class RRXTXDeviceAddress extends SocketAddress {
|
|||
*
|
||||
* @param deviceAddress the address of the device (e.g. COM1, /dev/ttyUSB0, ...)
|
||||
*/
|
||||
public RRXTXDeviceAddress(String deviceAddress) {
|
||||
public RxtxDeviceAddress(String deviceAddress) {
|
||||
this.deviceAddress = deviceAddress;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user