comparison DDS_Fox.c @ 175:e5ad3ed47d2c

Code cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 21 Feb 2014 18:38:44 +0100
parents 8e6a2ec85169
children 12df3a2b18de
comparison
equal deleted inserted replaced
174:d96f0b04f7fe 175:e5ad3ed47d2c
307 307
308 // TCP communication 308 // TCP communication
309 309
310 static unsigned int timeout = 0; // milliseconds 310 static unsigned int timeout = 0; // milliseconds
311 311
312 int OnTCPEvent(unsigned handle, int xType, int errCode, void *callbackData)
313 {
314 return 0;
315 }
316 312
317 static int SendCmd(char *Buffer, DDSParameter *Param) 313 static int SendCmd(char *Buffer, DDSParameter *Param)
318 { 314 {
319 unsigned int hConv=0; 315 unsigned int hConv=0;
320 char Response[255]; 316 char Response[255];
321 #ifdef DEBUG 317 #ifdef DEBUG
322 fprintf(stderr, "> %s\n", Buffer); 318 fprintf(stderr, "> %s\n", Buffer);
323 #endif 319 #endif
324 if (ConnectToTCPServer (&hConv, Param->Port, Param->ip, OnTCPEvent, Response, timeout) < 0) { 320 if (ConnectToTCPServer (&hConv, Param->Port, Param->ip, NULL, NULL, timeout) < 0) {
325 error("Connect failed"); 321 error("Connect failed");
326 return -1; 322 return -1;
327 } 323 }
328 if (ClientTCPWrite (hConv, Buffer, strlen(Buffer)+1, timeout) < 0) { 324 if (ClientTCPWrite (hConv, Buffer, strlen(Buffer)+1, timeout) < 0) {
329 error("Write failed"); 325 error("Write failed");
350 char parsebuf[255]; 346 char parsebuf[255];
351 char Response[255]; 347 char Response[255];
352 #ifdef DEBUG 348 #ifdef DEBUG
353 fprintf(stderr, "> %s\n", Buffer); 349 fprintf(stderr, "> %s\n", Buffer);
354 #endif 350 #endif
355 if (ConnectToTCPServer (&hConv, Param->Port, Param->ip, OnTCPEvent, Response, timeout) < 0) { 351 if (ConnectToTCPServer (&hConv, Param->Port, Param->ip, NULL, NULL, timeout) < 0) {
356 error("Connect failed"); 352 error("Connect failed");
357 return -1; 353 return -1;
358 } 354 }
359 if (ClientTCPWrite (hConv, Buffer, strlen(Buffer)+1, timeout) < 0) { 355 if (ClientTCPWrite (hConv, Buffer, strlen(Buffer)+1, timeout) < 0) {
360 error("Write failed"); 356 error("Write failed");