Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-generate asn1c #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

re-generate asn1c #21

wants to merge 3 commits into from

Conversation

swthorn
Copy link

@swthorn swthorn commented Jan 23, 2025

This PR re-generates the asn1c code based on the mouse fork. It's mostly that and changing the CMake to include the new files generated by that compiler.

The examples don't quite work and I'm not sure why:

swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position /MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7
/MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7
-- Malformed CPDLC message (not a downlink?)
swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position '/SOUCAYA.AT1.HL8251243F880C3D903BB412903604FE326C2479F4A64F7F62528B1A9CF8382738186AC28B16668E013DF464D8A7F0'
/SOUCAYA.AT1.HL8251243F880C3D903BB412903604FE326C2479F4A64F7F62528B1A9CF8382738186AC28B16668E013DF464D8A7F0
-- Malformed CPDLC message (not a downlink?)

If I comment this block

	if(msg->err == true) {
		printf("-- Malformed CPDLC message (not a downlink?)\n");
		goto cleanup;
	}

then it prints

swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position /MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7
/MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7
-- No latitude/longitude data present in this position report

@szpajder would you have any thoughts on what could be wrong here so I can try to address it?

@szpajder
Copy link
Owner

It probably means the new code is worse than the current one. Newer is not always better.

It fails to decode most position reports and it misdecodes error information code in error messages.

I do not currently see any benefits of merging this.

@swthorn
Copy link
Author

swthorn commented Jan 27, 2025

I've resolved this issue and now the example messages decode properly. I'm not really sure what the issue was, I just re-generated with a few different options to asn1c. If you have a larger corpus of messages that fail, let me know and I can try to fix those.

swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position '/SOUCAYA.AT1.HL8251243F880C3D903BB412903604FE326C2479F4A64F7F62528B1A9CF8382738186AC28B16668E013DF464D8A7F0'
/SOUCAYA.AT1.HL8251243F880C3D903BB412903604FE326C2479F4A64F7F62528B1A9CF8382738186AC28B16668E013DF464D8A7F0
 Latitude: 52.123333
 Longitude: 3.641667
 Altitude: 34000 ft
 Time: 15:56
swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position /MSTEC7X.AT1.VT-ANKA094D88C3D903BB465D0723053B2E5123CFA53279400014B0894A2C6A73CBD8F52447AF1244CB4C9B94600089D65C84314892694587510528B1A9CF41169D440C1AB36A08B42
/MSTEC7X.AT1.VT-ANKA094D88C3D903BB465D0723053B2E5123CFA53279400014B0894A2C6A73CBD8F52447AF1244CB4C9B94600089D65C84314892694587510528B1A9CF41169D440C1AB36A08B42
 Latitude: 52.678333
 Longitude: 7.233333
 Altitude: 40000 ft
 Time: 05:14
swthorn@algonquin:/data/libacars/libacars/build/examples$ ./cpdlc_get_position "/MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7"
/MELCAYA.AT1.ZK-OKC253C21CC3D903BA178F96618F0B28024B83127CD7886A12E9D85266B927584A9169C1A8EEB2800EEA7
 Latitude: -33.805000
 Longitude: 150.650000
 Altitude: 35000 ft
 Time: 15:02

This PR fixes invalid ACARS messages from decoding correctly. e.g:

./cpdlc_get_position /MELCAYA.AT1.ZK-OKC253B21CC3D903BFFFFFFFFFFFFF7F025B83128CD7886A12E9D85266B927584A9169C1A8EEB3800EEA7

Outputs:
 Latitude: -128.705000
 Longitude: -256.705000
 Altitude: 104600 ft
 Time: 31:63 

After this PR, this messages produces:
-- Malformed CPDLC message (not a downlink?)

as it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants