gpt4 book ai didi

c# - 从 Teltonika FM4200 读取 GPS 数据

转载 作者:太空宇宙 更新时间:2023-11-03 16:22:21 25 4
gpt4 key购买 nike

我已经配置了 GPS 设备并用 C# 创建了一个监听器应用程序。我只从设备收到 IMEI 号码,没有收到任何 GPS NMEA 数据。但是为了检查当我在 GPS Gate Server 中检查相同内容时,它会显示 map 中的移动。任何建议!!!

下面是数据的处理方式

TcpClient client = (TcpClient)tcpClient;
Byte[] bytes = new Byte[10000];
String data = null;
int i;

NetworkStream stream = client.GetStream();

while ((i = stream.Read(bytes, 0, bytes.Length)) != 0)
{
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
}

Console.WriteLine(data);

当它进入 while 循环时,它只是等待并休眠 :(

最佳答案

我认为该设备具有类似

的模式

Step1:收到IMEI号后

Step2:重放“01”状态到同一个新作品

代码:

TcpClient newClient = (TcpClient)client;

NetworkStream ns = newClient.GetStream()

byte[] bytes = new byte[1024];

bytes = Encoding.ASCII.GetBytes("X");

Console.WriteLine("X");

ns.Write(bytes, 0, bytes.Length);

关于c# - 从 Teltonika FM4200 读取 GPS 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13524210/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com