[Xastir-dev] Inconsistent use of APRS_Types/Record types?

Paul J. Morris mole at morris.net
Wed Feb 27 12:40:17 EST 2008


In trying to solve some problems with retrieving aprs data from
database records (with the db_gis.c code), I found that sometimes 
a DataRow's record_type is set using one of the defined record type
constants (such as NORMAL_APRS 'N', but at other times, uses one of the
enumerated APRS_Types, in particular APRS_WX1 to APRS_WX6.  [See
database.h starting around line 58]

Examples in db.c include:
p_station->record_type = NORMAL_APRS;
p_station->record_type = (char)APRS_WX1;

Since the enumerated APRS_Types don't have defined character constant
values, they don't survive being stored and retrieved from a database.  

As a workaround, I can add definitions to database.h:
#define APRS_WX1        '1'
#define APRS_WX2        '2'
#define APRS_WX3        '3'
#define APRS_WX4        '4'
#define APRS_WX5        '5'
#define APRS_WX6        '6'
I may well be missing something, but I don't see this creating a
problem, but I'm suspicious of the inconsistent use of enumerated
APRS_Types and record type constants.  

Is there a reason why the workaround of defining APRS_WX constants is a
bad idea?

Is the underlying inconsistency something that needs to be looked at
more closely?

-Paul
-- 
Paul J. Morris
Biodiversity Informatics Manager
Harvard University Herbaria/Museum of Comparative Zoölogy
mole at morris.net  AA3SD  PGP public key available



More information about the Xastir-dev mailing list