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