在收到FM1100的imei代码后,我不会从Teltonika FM1100获得gps nmea数据帮助我。
类程序{静态IPAddress ipAd = IPAddress.Parse("192.168.1.107");
static TcpListener myList = new TcpListener(ipAd, 3306);
static Socket s;
public void start()
{
myList.Start();
Console.WriteLine("The server is running at port 3306...");
Console.WriteLine("The local End point is :" +
myList.LocalEndpoint);
Console.WriteLine("Waiting for a connection.....");
s = myList.AcceptSocket();
Console.WriteLine("Connection accepted from " + s.RemoteEndPoint);
byte[] b = new byte[s.ReceiveBufferSize];
int k = s.Receive(b);
Console.WriteLine("Recieved...");
for (int i = 0; i < k; i++)
Console.Write(Convert.ToChar(b[i]));
ASCIIEncoding asen = new ASCIIEncoding();发送1字节数据作为确认
s.Send(asen.GetBytes("T"));
//确认byte[] ack =新bytes.ReceiveBufferSize后获取全球定位系统数据;
int y = Program.s.Receive(ack);
for (int q = 0; q < y; q++)
{
Console.WriteLine(Convert.ToChar(ack[q]));
}
s.Close();
myList.Stop();
}
static void Main(string[] args)
{
Program pg = new Program();
Thread th = new Thread(new ThreadStart(pg.start));
th.Start();
}
}}
发布于 2013-12-03 09:42:16
发送1字节数据作为确认
s.Send(asen.GetBytes("T"));你得把01送到这里
喜欢
byte[] msg = new byte[] { 0x01 };
s.Send(msg );发布于 2014-01-22 10:36:16
Teltonika FM1100不发送ASCII NMEA数据,您必须知道协议Codec12才能从teltonika读取GPS数据。
https://stackoverflow.com/questions/20284496
复制相似问题