Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Serial Input Buffer Size?? (http://www.go4expert.com/forums/serial-input-buffer-size-t22338/)

reppig 7Jun2010 18:48

Serial Input Buffer Size??
I am trying to write a program to read GPS data coming from a balloon payload and use it to point my antennas to stay with the balloon.

My problem is I wrote the program assuming the input buffer would contain a whole set of GPS NEMA sentences (GGA, GSA, RMC, etc).

But no matter what I do when I read the buffer I only get something like this:
$GPGGA,123937.095,2831.4487,N,08041.0200,W,0,00,50 .0,10.0,M,-31.2,M,0.0,0000*41

Which is not a buffer size of 4096 the default. So, I changed the buffer size to 16384.

When I was counting on something like this:
$GPGGA,124025.092,2831.4615,N,08040.9801,W,1,06,1. 0,5.5,M,-31.2,M,0.0,0000*43
$GPRMC,124033.092,A,2831.4613,N,08040.9790,W,0.08, 168.54,130510,,*1E
$GPGGA,124033.092,2831.4613,N,08040.9790,W,1,05,2. 0,2.0,M,-31.2,M,0.0,0000*47

Can anyone tell me how I can read in more data?? or If it is not possible??

In my Main.Designer.cs file I have:
this.serialInput.BaudRate = 1200;
this.serialInput.DiscardNull = true;
this.serialInput.ReadBufferSize = 16384;

I try and read it it like this:

// Check if serial port is open
if (serialInput.IsOpen)
// Read buffer into a string
string inputBuffer = serialInput.ReadExisting();
... Using Microsoft Visual C# 2008 Express Edition


All times are GMT +5.5. The time now is 13:57.