Welcome to Radarspotting. Please login or sign up.

April 19, 2026, 12:11:26 AM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

DF5 Squawk code

Started by I_Need_help, February 24, 2017, 07:52:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

I_Need_help

hi, not sure where to post this so sorry if it is in the wrong place!

I want to try and decode some messages myself but cant find a spec for the message that contains the Squawk code, after a lot of googling I believe it is in DF5 and possibly DF11 ?

I cant find any document that break these messages down, can anyone point me in the right direction?

I have found this document that decodes DF17 http://www.anteni.net/adsb/Doc/1090-WP30-18-DRAFT_DO-260B-V42.pdf

thanks

atty

#1
Hi,
you can get squawk as below, where *data2, *data3 are pointers to third and fourth byte in DF5 packet data.


unsigned int find_squawk(unsigned char *data2, unsigned char *data3) {
unsigned int squawk = (((*data3 >> 7) & 0x01) << 11) | (((*data2 >> 1) & 0x01) << 10)
| (((*data2 >> 3) & 0x01) << 9) |

(((*data3 >> 1) & 0x01) << 8) | (((*data3 >> 3) & 0x01) << 7)
| (((*data3 >> 5) & 0x01) << 6) |

((*data2 & 0x01) << 5) | (((*data2 >> 2) & 0x01) << 4)
| (((*data2 >> 4) & 0x01) << 3) |

((*data3 & 0x01) << 2) | (((*data3 >> 2) & 0x01) << 1)
| (((*data3 >> 4) & 0x01));

return squawk;
}