Click here to Skip to main content
15,122,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hex string in Big Endian notation received from GPS Device through UDP is as follows:


Please help me in converting it to meaningful ASCII.
Updated 5-Feb-14 7:54am
Kornfeld Eliyahu Peter 2-Feb-14 4:31am
What GPS device? You may search for info on the device's page...
(Who told it has a meaningful ASCII conversation?)
Richard MacCutchan 2-Feb-14 7:23am
If it's from a GPS device then you need a copy of the message protocol so you can split it into its constituent parts, such as latitude, longitude, timestamp etc.

Endian-ness is important, but it has nothing to do with ASCII: ASCII is a display code based on 7 or 8 bit values, and Endian ness is concerned with how 8-bit values are assembled i9nto a larger number. Big Endian stores the most significant byte first in memory, Little Endian store the Least significant first.

For example:
Hex:            32333435
As ASCII        "2345"
Big endian      32333435 or decimal 842216501
Little Endian   35343332 or decimal 892613426

Looking at the sample data quickly, it does not look like "good" ASCII, but what it is exactly is a mystery.
You should talk to the people who created the GPS device - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
BillWoodruff 2-Feb-14 5:21am
I am sure that "32333435" is LittleEndian which is Windows standard; wouldn't BigEndian be "23334353" ?
OriginalGriff 2-Feb-14 5:54am
No - it's byte oriented, rather than nibble, thankfully!
BillWoodruff 2-Feb-14 6:59am
You are a river unto your people ! thanks, Bill
Dave Kreskowiak 2-Feb-14 8:51am
Did you just say he pisses upon his people?
OriginalGriff 2-Feb-14 8:56am
I don't have a pot to... :laugh:
Nelek 2-Feb-14 7:05am
I don't agree... In the industry world the big and little endian is not like described in that wiki.

0xABCD in Big-Endian it is 0xBADC in little endian if the system is word-based, as Profibus, Can-Bus and many other industrial communication in the PLC world.

In you example: If I want to have the end-result "32333435" in a Robot, I have to send "23334353" from the PLC and not "35343332" as you suggest.
Nelek 2-Feb-14 7:08am
I agree with you, no matter what that wiki says. In my world is like that, see my comment to Griff.
supplier is encrypting the hex string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900