Hi Guys,
I am faced by a rather odd problem, and I am at the verge of setting fire to my Panda board. Been up all night trying to fix it.
Two Fez Pandas linked by a fully functional radio link.
static byte[] message = UTF8Encoding.UTF8.GetBytes("9999999999");
Being sent continuously returns bytes with values 202 on the other side (a 9 is a 57). 87s return 230s, etc.
Whilst:
static byte[] message = new byte[5]{57,57,57,57,57};
Returns 57 as expected on the other side.
Why oh why does assigning the byte value from UTF encode somehow change the value of the byte during transmission, and manual assignment works a charm?
The radio link has been previously used with a PICAXE chip, and worked a treat - absolutely no problems.
Any ideas? This seems rather strange… Is there anything special about the inner workings of UTF8ENCODE that may somehow cause the data to be distorted in transmission?
Edit: Also, tried different radio modules. Same exact problem persists. Data assigned manually is sent through undistorted. Data assigned through UTF8 is shifted along by around 200 each time. Furthermore tried a different board - A FEZ Panda 1 instead of FEZ Panda 2 - Same problem persists. Firmware up to date.
More Info: When debugging, and checking the value of the message byte after assigning with with UTF8.GetBytes the values do indeed appear correct, e.g. 57 in aforementioned case.
Currently bypassing the issue by making my own encoding class - Also manages bit balancing etc, but I’d love to know why the UTF8 Encoding class acts up.