Revision 155
minor updates to gui
ColonetServerInterface.java | ||
---|---|---|
43 | 43 |
public static final String REQUEST_FROM_SERVER = "1"; |
44 | 44 |
public static final String RESPONSE_TO_CLIENT_REQUEST = "2"; |
45 | 45 |
public static final String REQUEST_BOM_MATRIX = "144"; |
46 |
public static final String REQUEST_XBEE_IDS = "144";
|
|
46 |
public static final String REQUEST_XBEE_IDS = "145";
|
|
47 | 47 |
|
48 | 48 |
public static final String COLONET_COMMAND = "13"; //0x0D |
49 | 49 |
public static final String COLONET_REQUEST = "14"; //0x0E |
... | ... | |
176 | 176 |
} |
177 | 177 |
|
178 | 178 |
try { |
179 |
log.append("Attempting to connect to " + strHost + "\n"); |
|
180 | 179 |
socket = new Socket(strHost, port); |
181 | 180 |
} catch (UnknownHostException e) { |
182 | 181 |
log.append("Unknown host exception.\n"); |
... | ... | |
196 | 195 |
log.append("Connection is not ready. Try connecting again."); |
197 | 196 |
return; |
198 | 197 |
} |
199 |
log.append("Connected to " + strHost + " on port " + port + "\n"); |
|
200 | 198 |
try { |
201 | 199 |
out = new OutputStreamWriter(socket.getOutputStream()); |
202 | 200 |
reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
... | ... | |
353 | 351 |
} |
354 | 352 |
|
355 | 353 |
public void parseData (String line) { |
356 |
log.append("Incoming data: [" + line + "]\n"); |
|
354 |
//log.append("Incoming data: [" + line + "]\n");
|
|
357 | 355 |
if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
358 | 356 |
ColonetServerInterface.REQUEST_BOM_MATRIX)) |
359 | 357 |
colonet.parseMatrix(line); |
360 |
if (line.startsWith(ColonetServerInterface.COLONET_QUEUE)) |
|
358 |
else if (line.startsWith(ColonetServerInterface.COLONET_QUEUE))
|
|
361 | 359 |
colonet.parseQueue(line); |
362 |
if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
|
360 |
else if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " +
|
|
363 | 361 |
ColonetServerInterface.REQUEST_XBEE_IDS)) |
364 | 362 |
colonet.parseXBeeIDs(line); |
365 | 363 |
} |
Also available in: Unified diff