我有一个跟踪设备 Meiligao VT310,它通过 gprs 向我发送消息。我使用此代码成功读取了消息,但与我预期的不一样。
private void ReadCallback(IAsyncResult result)
{
Client client = result.AsyncState as Client;
NetworkStream networkStream = client.NetworkStream;
int read = networkStream.EndRead(result);
string data = this.Encoding.GetString(client.Buffer, 0, read);
networkStream.BeginRead(client.Buffer, 0, client.Buffer.Length, ReadCallback, client);
}
我希望以 NMEA 格式输出,但输出是这样的:
$$\0}E!@ 5/??U154108.000,V,4619.3051,N,01549.5325,E,0.00,0,040112,,*1B|0.0|244|0000|0008,0006|0125004600323C97|0E| 0000099C??\r\n