This was working fine but for some reason has quit working. I can see all 512 members in the debugger when it halts. I am using 4.1 on the Mini.
#### Exception System.Exception - CLR_E_WRONG_TYPE (3) ####
#### Message:
#### System.Text.UTF8Encoding::GetChars [IP: 0000] ####
#### Cortana.MTK3339::ProcessData [IP: 006e] ####
#### Cortana.MTK3339::DataReceived [IP: 00b0] ####
#### System.IO.Ports.SerialPort::DataEventHandler [IP: 0016] ####
A first chance exception of type 'System.Exception' occurred in mscorlib.dll
An unhandled exception of type 'System.Exception' occurred in mscorlib.dll
occurs in these lines of code.
lock(readBuffer)
Error-> char[] buffer = Encoding.UTF8.GetChars(readBuffer);
*readBuffer is an array of bytes of a set size (512)
As a workaround I used a for loop: buffer[i] = (char)readBuffer[i];