read NMEA sentences from GPS
问题 I have a Mio P550 device, which has a GPS included. I try to use SerialPort to get NMEA sentences, by simply use SerialPort.Read(). Data is returned in some weird encoding. GPS should return NMEA sentences in ASCII, but it doesn't. Here is my code for reading: dataLength = this.serialPort.Read(buffor, 0, Gps.BUFFOR_LENGTH); Debug.WriteLine("data length: " + dataLength); if (dataLength > 0) { for (int i = 0; i < dataLength; i++) { char c = Convert.ToChar(buffor[i]); if (c == '\r' || c == '\n')