Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

binary - Get unreadable string from GPS tracker

I'm getting this unreadable string from a GPS tracking device and I need to decode these information so I can use it in my application (c#).

$A  grQ05Ah@‘)????????????°#~à??U

But in fact what i expect is something like below :

*HQ,XXXXXX,41,4#V1,time,A,**Lat**,N/S,**Lng**,W/E,000.00,000,date,FFFFFBFF,432,35,32448,334

How can i convert the string to standard format in c# ?

I convert data to byte as you can see :

24-41-20-20-67-72-51-30-35-41-68-40-91-29-3F-3F-3F-FF-FF-FB-FF-FF-3F-3F-3F-3F-B0-23-7E-C0-82-A1-55
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Its really some binary information and If you have clearly read out the product manual then it says formation of this binaries.

Converting the data to hex will give something like this..

24-41-20-20-67-72-51-30-35-41-68-40-91-29-3F-3F-3F-FF-FF-FB-FF-FF-3F-3F-

And then you need to refer the manual for exact meaning of these hex numbers

ex--(in some chinese devices)

2 bytes(24),  stand for standard mode
10 bytes,  is device'ID (41 20 20 67 72)
6 bytes, is time 
6 bytes, is data
8 bytes, is latitude
2 bytes, battery like this 06= 100% 05=80% 04=60% 03=40% 02=20% 01=10%
10 bytes is  longitude

** You are receiving these binaries because you've asked it to send the info in binary mode.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...