Handling intergers, hex and 2's compliment

If you change the negative number to a positive number you can't distinguish the two at the receiving end.
The problem is that when printing an integer Serial.print seems to default to a 32 bit-integer so it sign-extends the negative numbers. You can use either this:

 Serial.println((uint16_t)result,HEX);

or this:

 Serial.println(result & 0xffff,HEX);

to force it to send four hex digits. E.g. -45 will be sent as FFD3 which is the correct HEX representation of the 16-bit twos complement number.

Pete