I have an application that is receiving GPS data on a serial port. It works as expected in Debug mode, but if I end the debug session and reset the Fez Hydra, the LineReceived event never gets triggered and I get a buffer overflow.
I am using a local copy of serial.cs to avoid the memory overflow problem previously reported.
My setup code is:
GT.Socket socket = GT.Socket.GetSocket(7, true, null, "U"); ResetPin = new GTI.DigitalOutput(socket, GT.Socket.Pin.Three, true, null); serial = new GTI.Serial(socket, 57600, GTI.Serial.SerialParity.None, GTI.Serial.SerialStopBits.One, 8, GTI.Serial.HardwareFlowControl.NotRequired, null); serial.LineReceivedEventDelimiter = DELIMITER; serial.AutoReadLineEnabled = true; serial.Open(); serial.LineReceived += new GTI.Serial.LineReceivedEventHandler(serial_LineReceived);
I found a previous post with a similar issue and the solution was to open the port before defining the DataReceived event. I have tried putting the open statement before and after defining the LineReceived event but it makes no difference.