Add source & address type for Mode A/C

This commit is contained in:
Oliver Jowett 2016-10-11 17:55:02 +01:00
parent eece2a54a0
commit 85d3ecee62
3 changed files with 7 additions and 0 deletions

View file

@ -142,6 +142,7 @@ typedef struct rtlsdr_dev rtlsdr_dev_t;
/* Where did a bit of data arrive from? In order of increasing priority */
typedef enum {
SOURCE_INVALID, /* data is not valid */
SOURCE_MODE_AC, /* A/C message */
SOURCE_MLAT, /* derived from mlat */
SOURCE_MODE_S, /* data from a Mode S message, no full CRC */
SOURCE_MODE_S_CHECKED, /* data from a Mode S message with full CRC */
@ -163,6 +164,8 @@ typedef enum {
ADDR_TISB_TRACKFILE, /* TIS-B, Mode A code + track file number */
ADDR_TISB_OTHER, /* TIS-B, other address format */
ADDR_MODE_A, /* Mode A */
ADDR_UNKNOWN /* unknown address format */
} addrtype_t;

View file

@ -78,6 +78,8 @@ int ModeAToModeC(unsigned int ModeA)
//
void decodeModeAMessage(struct modesMessage *mm, int ModeA)
{
mm->source = SOURCE_MODE_AC;
mm->addrtype = ADDR_MODE_A;
mm->msgtype = 32; // Valid Mode S DF's are DF-00 to DF-31.
// so use 32 to indicate Mode A/C

View file

@ -1381,6 +1381,8 @@ static const char *addrtype_to_string(addrtype_t type) {
return "ADS-R";
case ADDR_ADSR_OTHER:
return "ADS-R, other addressing scheme";
case ADDR_MODE_A:
return "Mode A";
default:
return "unknown addressing scheme";
}