I subscribe to a service that allows me to login ( via Net::Telnet ) and download a small message containing the gps position of a number of platforms we have deployed in oceans around the world. The gps positions are triangulated using the ARGOS satellite constellation.

In addition to this ASCII encoded message, each platform transmits a 32 byte message from the platform itself, ( containing the position as measured by the platform's gps unit, status messages, etc ) are encoded according to a know specification. Here's an example:

05 F9 AD F4 EC 9E 00 05 05 F9 E2 F4 EC A6 02 5B 05 FF 28 F4 AF 84 FF FF 0B 5C 00 06 06 FD 74 2F

The first piece of the message contains the gps position of the platform. The latitude is encoded as a 3 byte signed integer:

05F9AD

the longitude as a 3 byte signed integer:

F4EC9E

and the relative number of seconds since the measurement was made as a 2 byte unsigned integer:

0005

At first glance, I figured pack/unpack was the way to go. I read over pfaut's pack/unpack tutorial, but I still can't seem to get my hands around how to decode this message.

Any help would be greatly appreciated.

njcodewarrior


In reply to Decoding binary information by njcodewarrior

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.