Quote:
Originally Posted by yash101
What about UDP/TCP 1234, etc. Does it mean that that port is blocked?
|
Yes; Section 2.2.8 of the manual specifies the open ports on the field:
Quote:
Once plugged in to the Field Management System (FMS) via the Ethernet cable provided, the only open ports in the ARENA network are as follows:
TCP 1180: This port is typically used for camera data from the cRIO to the Driver Station (DS) when the camera is connected to port 2 on the 8-slot cRIO (P/N: cRIO-FRC). This port is bidirectional.
TCP 1735: SmartDashboard, bidirectional
UDP 1130: Dashboard-to-ROBOT control data, directional
UDP 1140: ROBOT-to-Dashboard status data, directional
HTTP 80: Camera connected via switch on the ROBOT, bidirectional
HTTP 443: Camera connected via switch on the ROBOT, bidirectional
Teams may use these ports as they wish if they do not employ them as outlined above (i.e. TCP 1180 can be used to pass data back and forth between the ROBOT and the DS if the team chooses not to use the camera on port 2).
|
It looks like Java ME sockets work a bit differently than Java SE sockets. You use the Connector class to open a StreamConnection or SocketConnection object. The Javadocs give an example:
Code:
SocketConnection sc = (SocketConnection) Connector.open("socket://10.xx.yy.5:1180");
sc.setSocketOption(SocketConnection.LINGER, 5);
InputStream is = sc.openInputStream();
OutputStream os = sc.openOutputStream();
os.write("\r\n".getBytes());
int ch = 0;
while(ch != -1) {
ch = is.read();
}
is.close();
os.close();
sc.close();
Note that I have not used these classes, so YMMV.