Bug 348209 - APRS Plugin: Wrong decoding of MIC-E Position
Summary: APRS Plugin: Wrong decoding of MIC-E Position
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: DL9TG
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-25 16:01 UTC by DL9TG
Modified: 2015-06-08 20:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: Applications/15.04.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DL9TG 2015-05-25 16:01:36 UTC
Wrong longitude calculation (latitude is correct) for some MIC-E encoded positions, example:

  MIC-E: DL9TG-7>U1TVP0,WIDE1-1,WIDE2-1,qAR,DL9TG-10:`|^al#D[/>"4J}145.662MHz T110 -060Thomas=

The result is: lon: -96.1115
The result should be: lon: 6.1115

Perhaps the problem is in AprsGatherer.cpp in line 171:
dstCall has only 6 Bytes, so dstCall[6] is out of range.

original:
            qreal longitude =
                calculateLongitude( QString ( mic_e_matcher.cap( 4 ) ),
                                    m_dstCallLongitudeOffset[dstCall[5]],
                                    m_dstCallSouthEast[dstCall[6]] );

my  offer (for my example it works correct):
            qreal longitude =
                calculateLongitude( QString ( mic_e_matcher.cap( 4 ) ),
                                    m_dstCallLongitudeOffset[dstCall[4]],
                                    m_dstCallSouthEast[dstCall[5]] );
Comment 1 Dennis Nienhüser 2015-05-25 17:08:30 UTC
Wes, are you around by chance to look into this? :-)
Comment 2 DL9TG 2015-05-25 18:48:33 UTC
(In reply to Dennis Nienhüser from comment #1)
> Wes, are you around by chance to look into this? :-)

I used this document to read about MIC-E encoding: http://www.aprs.org/doc/APRS101.PDF
On page 43 is the information, that the Destination Address field has 6 bytes. So dstCall[6] must be wrong (valid is 0 to 5).

I am not 100% sure, that my offer is the full solution. To test my offer, I used www.aprs.fi and compared a few random station positions. With my offer I was not longer able to find stations with a wrong position in marble.
Comment 3 wjhns25 2015-05-28 21:21:30 UTC
I agree this looks like the right fix to me, and thanks for finding the bug and more importantly figuring out the fix!
Comment 4 Dennis Nienhüser 2015-06-01 12:12:48 UTC
Thanks a lot.

@Thomas: I'd commit this on your behalf now. To do that I'd need your surname though, are you willing to share it? You can send it to me by mail also if you don't want to have it appear here.
Comment 5 DL9TG 2015-06-05 14:35:28 UTC
My full name is Thomas Grunenberg.
@Dennis Nienhüser Please commit the fix in my behalf. Thank you for your help.
@wjhns25@hardakers.net Thank you for confirming my offer.
Comment 6 Dennis Nienhüser 2015-06-08 20:04:31 UTC
Git commit 7a411f40362675ea6ba4813b8baa0f4128b5860d by Dennis Nienhüser, on behalf of Thomas Grunenberg.
Committed on 08/06/2015 at 20:02.
Pushed by nienhueser into branch 'master'.

Fix wrong decoding (longitude calculation) of some MIC-E positions

M  +2    -2    src/plugins/render/aprs/AprsGatherer.cpp

http://commits.kde.org/marble/7a411f40362675ea6ba4813b8baa0f4128b5860d
Comment 7 Dennis Nienhüser 2015-06-08 20:07:28 UTC
Git commit a7482b5381f22640add20ba1b190e60d7715b400 by Dennis Nienhüser, on behalf of Thomas Grunenberg.
Committed on 08/06/2015 at 20:05.
Pushed by nienhueser into branch 'Applications/15.04'.

Fix wrong decoding (longitude calculation) of some MIC-E positions
FIXED-IN: Applications/15.04.3
(cherry picked from commit 7a411f40362675ea6ba4813b8baa0f4128b5860d)

M  +2    -2    src/plugins/render/aprs/AprsGatherer.cpp

http://commits.kde.org/marble/a7482b5381f22640add20ba1b190e60d7715b400