forked from GideonLeGrange/panstamp-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestTCPServer.java
More file actions
28 lines (23 loc) · 751 Bytes
/
TestTCPServer.java
File metadata and controls
28 lines (23 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
}
}