strange bug printing data from xbee packet

Hi,

Next time I'll post the whole code - I just wanted to avoid doing that because it's a fairly long program, and the problem was just in printing out the received log packets.

rx is an instance of ZBRxResponse. I know that it's meant to be uint8_t. The first thing I tried was to do the cast at the end, in the usb.print function (I.e. usb.print((char)test); ), but I was trying casting the pointer to see if it worked any better.

The other thing I tried since I posted this was to print 'test' in both formats at once. I.e. using this code:

      usb.print((char)test);
      usb.print(",");
      usb.print(test);
      usb.print(" ");

If I do that, neither the characters nor the numerical values come out right, apart from the first character in the packet.

I have managed to find a workaround for this problem, which is to copy the bytes from the xbee receive buffer into another buffer before printing them. If I do it this way, they will print as characters or decimal ascii codes perfectly well.

Thanks,

andy (highfellow)