Revision 623
cleanup and colonet debugging
colonet_wireless.cpp | ||
---|---|---|
68 | 68 |
|
69 | 69 |
wl_set_com_port(wl_port); |
70 | 70 |
|
71 |
printf("Calling wl_init(%s)...\n", wl_port);
|
|
71 |
fprintf(stderr, "Calling wl_init(%s)...\n", wl_port);
|
|
72 | 72 |
if (wl_init() != 0) { |
73 | 73 |
fprintf(stderr, "wl_init failed.\n"); |
74 | 74 |
return -1; |
... | ... | |
76 | 76 |
|
77 | 77 |
wl_token_ring_register(); |
78 | 78 |
|
79 |
printf("Joining token ring...\n");
|
|
79 |
fprintf(stderr, "Joining token ring...\n");
|
|
80 | 80 |
if (wl_token_ring_join() != 0) { |
81 | 81 |
fprintf(stderr, "Failed to join token ring.\n"); |
82 | 82 |
return -1; |
83 | 83 |
} |
84 |
printf("Joined token ring.\n");
|
|
84 |
fprintf(stderr, "Joined token ring.\n");
|
|
85 | 85 |
|
86 | 86 |
return 0; |
87 | 87 |
} |
... | ... | |
230 | 230 |
//TODO: These are just here to get rid of compiler warnings |
231 | 231 |
frame = frame; |
232 | 232 |
received = received; |
233 |
//printf("got response.\n");
|
|
233 |
printf("handle_response\n");
|
|
234 | 234 |
} |
235 | 235 |
|
236 | 236 |
static void handle_receive(char type, int source, unsigned char* data, int len) { |
237 | 237 |
type = type; //TODO: This is just here to get rid of compiler warnings. |
238 | 238 |
|
239 |
fprintf(stderr, "***Got packet from robot***\n");
|
|
239 |
printf("***Got packet from robot***\n");
|
|
240 | 240 |
|
241 | 241 |
ColonetRobotServerPacket* pkt = (ColonetRobotServerPacket*)data; |
242 | 242 |
|
... | ... | |
279 | 279 |
char processed_data[80]; |
280 | 280 |
sprintf(processed_data, "%d %d %d %s\n", RESPONSE_TO_CLIENT_REQUEST, pkt->msg_code, source, pkt->data); |
281 | 281 |
|
282 |
fprintf(stderr, "client_id=%d; processed_data: %s\n", pkt->client_id, processed_data); |
|
283 |
|
|
282 | 284 |
colonet_server.process_received_wireless_message(pkt->client_id, processed_data, strlen(processed_data)); |
283 | 285 |
} |
284 | 286 |
} |
... | ... | |
309 | 311 |
usleep(1000); |
310 | 312 |
} |
311 | 313 |
|
314 |
fprintf(stderr, "Listen is returning.\n"); |
|
315 |
|
|
312 | 316 |
wl_terminate(); |
313 | 317 |
return NULL; |
314 | 318 |
} |
Also available in: Unified diff