example.TestTCPServer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panstamp Show documentation
Show all versions of panstamp Show documentation
A Java library for working with a network of panStamp Arduino devices
The newest version!
package example;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import me.legrange.swap.SwapModem;
import me.legrange.swap.SerialModem;
import me.legrange.swap.tcp.TcpServer;
/**
*
* @author gideon
*/
public class TestTCPServer {
public static final String PORT = "/dev/tty.usbserial-A800HNMV";
public static void main(String...args) throws Exception {
SwapModem m = new SerialModem(PORT,38400);
m.open();
TcpServer s = new TcpServer(m, 3333);
System.out.println("Press enter to quit");
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
r.readLine();
s.close();
m.close();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy