IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18277


Ignore:
Timestamp:
Jun 22, 2008, 8:54:26 PM (18 years ago)
Author:
eugene
Message:

add some debug entries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libkapa/src/IOfuncs.c

    r16466 r18277  
    11# include <kapa_internal.h>
     2# define DEBUG 0
    23
    34/** these function expect to operate with a BLOCKing socket **/
     
    6364  status = read (device, buffer, 16);
    6465  buffer[16] = 0;
    65   if (status != 16) fprintf (stderr, "dropped message length\n");
     66  if (status != 16) {
     67      fprintf (stderr, "dropped message length\n");
     68  }
     69  if (DEBUG) fprintf (stderr, "recv buffer: %s\n", buffer);
    6670
    6771  /* find the message length, allocate space */
     
    7175  /* read Nbytes from the device */
    7276  status = read (device, message, Nbytes);
    73   if (status != Nbytes) fprintf (stderr, "Kii/Kapa comm error\n");
     77  if (status != Nbytes) {
     78      fprintf (stderr, "Kii/Kapa comm error\n");
     79  }
    7480  message[status] = 0;
    7581  /* make the string easy to parse */
    7682
    77   // fprintf (stderr, "recv: %s\n", message);
     83  if (DEBUG) fprintf (stderr, "recv: %s\n", message);
    7884
    7985  /* scan the incoming message */
     
    112118  write (device, string, length);
    113119
    114   // fprintf (stderr, "send: %s\n", string);
     120  if (DEBUG) fprintf (stderr, "send: %s\n", string);
    115121
    116122  free (string);
     
    129135  /* read Nbytes from the device */
    130136  status = read (device, message, length);
     137  if (DEBUG) fprintf (stderr, "recv message: %s\n", message);
    131138
    132139  if (status != length) {
Note: See TracChangeset for help on using the changeset viewer.