root / trunk / code / projects / colonet / client / cgi / ColonetCGI.java @ 1390
History | View | Annotate | Download (884 Bytes)
1 | 603 | gtress | |
---|---|---|---|
2 | 608 | gtress | import java.io.*; |
3 | import java.net.*; |
||
4 | |||
5 | 603 | gtress | public class ColonetCGI { |
6 | |||
7 | 608 | gtress | public static void main (String [] args) |
8 | throws IOException, UnknownHostException, java.security.AccessControlException { |
||
9 | if (args.length < 1) { |
||
10 | System.out.println("No command specified. Terminating."); |
||
11 | 603 | gtress | return;
|
12 | 608 | gtress | } |
13 | 603 | gtress | ColonetCGI ccgi = new ColonetCGI(args[0]); |
14 | } |
||
15 | |||
16 | 608 | gtress | public ColonetCGI (String strCommand) |
17 | throws IOException, UnknownHostException, java.security.AccessControlException { |
||
18 | 606 | gtress | System.out.println("Attempting to connect to server..."); |
19 | 603 | gtress | ColonetCGIServerInterface ccsi = new ColonetCGIServerInterface(this); |
20 | ccsi.connect("128.2.99.176", "10123"); |
||
21 | 606 | gtress | System.out.println("Sending data..."); |
22 | 603 | gtress | ccsi.sendData(ColonetCGIServerInterface.MOTOR2_SET + " 0 225", "200"); |
23 | ccsi.sendData(ColonetCGIServerInterface.MOTOR1_SET + " 0 225", "200"); |
||
24 | 606 | gtress | System.out.println("Sent data successfully."); |
25 | 603 | gtress | } |
26 | |||
27 | } |