strange bug printing data from xbee packet

I'm having trouble printing out numerical data from a packet sent over a couple of xbee radios.

It would be nice to know what kind.

I have a coordinator which is sending out regular heartbeat broadcast packets

But, I'm not going to show you that code.

The relevant code on the transmitter looks like this:

That may seem like the relevant code, but there are a lot of instances that we can only guess at what there are an instance of.

  unsigned char* rxPayload;
    rxPayload = (unsigned char*) rx.getData();

Why are you using unsigned char as the type?

Assuming (yes, I know that is dangerous) that rx is an instance of RxDataResponse, the getData() method that returns a pointer is defined:

	/**
	 * Returns the payload array.  This may be accessed from index 0 to getDataLength() - 1
	 */
	uint8_t* getData();

Casting is often safe enough, but using the correct type is almost always better.

Whereas if I print the characters cast into 'char' instead of 'unsigned char', it prints as it should.

So, what's the problem? Was the data on the other end char or unsigned char? What is the problem with using char as the data type on the receiver?

What cast did you use to put the character data into the uint_8 array to be sent?