GPS4Palm

Source Code Documentation


Garmin.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * $RCSfile: Garmin_8h-source.html,v $
00004  *
00005  * GPS4Palm
00006  * Garmin Data Type Definitions
00007  * According to GARMIN GPS Interface Specification Rev. 3 1999-12-06
00008  *
00009  * Imported from gpslib-1.31 by Christian Claveleira
00010  * <Christian.Claveleira@fnac.net>
00011  *
00012  * This program is Copyright (C) 03/2003 Matthias Prinke
00013  * <matthias.prinke@surfeu.de> and covered by GNU's GPL.
00014  * In particular, this program is free software and comes WITHOUT
00015  * ANY WARRANTY.
00016  *
00017  * $Author: mp $
00018  *
00019  * $Date: 2007-10-08 20:40:33 $
00020  *
00021  * $Revision: 1.7.2.1 $
00022  *
00023  * $Log: Garmin_8h-source.html,v $
00023  * Revision 1.7.2.1  2007-10-08 20:40:33  mp
00023  * updated for gps4palm V0.9.5 beta
00023  *
00024  * Revision 1.2  2004-02-08 18:07:43  mp
00025  * minor editorial changes
00026  *
00027  *
00028  ****************************************************************************/
00029 
00030 /*  Garmin types :
00031 
00032 G_boolean  : 8 bit int
00033 G_byte     : unsigned 8 bits int or char
00034 G_char     : signed   8 bits int or char
00035 G_word     : little-endian unsigned 16 bits int
00036 G_int      : little-endian signed 16 bits int
00037 G_longword : little-endian unsigned 32 bits int
00038 G_long     : little-endian signed 32 bits int
00039 G_float    : little-endian 32 bits IEEE-format floating point data
00040 G_double   : little-endian 64 bits IEEE-format floating point data
00041 
00042 */
00043 #ifndef __GARMIN_H__
00044 #define __GARMIN_H__
00045 
00046 #if defined __palmos__  // type castings for PalmOS
00047 typedef unsigned char G_boolean;
00048 typedef unsigned char G_byte;
00049 typedef char G_char;
00050 typedef UInt16 G_word;
00051 typedef Int16 G_int;
00052 typedef UInt32 G_longword;
00053 typedef Int32 G_long;
00054 typedef float G_float;
00055 typedef double G_double;
00056 typedef G_int Symbol_Type;
00057 
00058 #elif defined GLIB_MAJOR_VERSION  // type castings for glib
00059 
00060 typedef guchar G_boolean;
00061 typedef guchar G_byte;
00062 typedef char G_char;
00063 typedef guint16 G_word;
00064 typedef gint16 G_int;
00065 typedef guint32 G_longword;
00066 typedef gint32 G_long;
00067 typedef float G_float;
00068 typedef double G_double;
00069 typedef G_int Symbol_Type;
00070 
00071 #else    // default
00072 #endif
00073 
00074 typedef unsigned char byte;
00075 typedef unsigned char boolean;
00076 
00077 typedef struct
00078 {                                      /* packet structure */
00079     byte dle;                          /* start delimiter */
00080     byte type;                         /* type */
00081     byte length;                       /* size of packet data */
00082     byte datas[514];                   /* packet data (with large 
00083                                           additional space in case
00084                                           of many DLEs */
00085 }
00086 Garmin_Packet;
00087 
00088 
00089 enum                                   /* Basic Packet IDs */
00090 {
00091     Pid_Ack_Byte        = 6,
00092     Pid_Nack_Byte       = 21,
00093     Pid_Protocol_Array  = 253,
00094     Pid_Product_Rqst    = 254,
00095     Pid_Product_Data    = 255
00096 };
00097 
00098 enum                                   /* L001 - Link Protocol 1 */
00099 {
00100     Pid_Command_Data    = 10,
00101     Pid_Xfer_Cmplt      = 12,
00102     Pid_Date_Time_Data  = 14,
00103     Pid_Position_Data   = 17,
00104     Pid_Prx_Wpt_Data    = 19,
00105     Pid_Records         = 27,
00106     Pid_Rte_Hdr         = 29,
00107     Pid_Rte_Wpt_Data    = 30,
00108     Pid_Almanac_Data    = 31,
00109     Pid_Trk_Data        = 34,
00110     Pid_Wpt_Data        = 35,
00111     Pid_Speed_Req       = 48,  /* speed proposal ? */
00112     Pid_Speed_Ack       = 49,  /* speed ack ? */
00113     Pid_Pvt_Data        = 51,
00114     Pid_Rte_Link_Data   = 98,
00115     Pid_Trk_Hdr         = 99
00116 };
00117 
00118 enum                                   /* A010 - Device Command Protocol 1 */
00119 {
00120     Cmnd_Abort_Transfer = 0,           /* abort current transfer */
00121     Cmnd_Transfer_Alm   = 1,           /* transfer almanac */
00122     Cmnd_Transfer_Posn  = 2,           /* transfer position */
00123     Cmnd_Transfer_Prx   = 3,           /* transfer proximity waypoints */
00124     Cmnd_Transfer_Rte   = 4,           /* transfer routes */
00125     Cmnd_Transfer_Time  = 5,           /* transfer time */
00126     Cmnd_Transfer_Trk   = 6,           /* transfer track log */
00127     Cmnd_Transfer_Wpt   = 7,           /* transfer waypoints */
00128     Cmnd_Turn_Off_Pwr   = 8,           /* turn off power */
00129     Cmnd_Start_Pvt_Data = 49,          /* start transmitting PVT data */
00130     Cmnd_Stop_Pvt_Data  = 50           /* stop transmitting PVT data */
00131 };
00132 
00133 
00134 #ifdef DEVICE_COMMAND_PROTOCOL_2
00135 enum                            /* A011 - Device Command Protocol 2 */
00136 {
00137     Cmnd_Abort_Transfer = 0,    /* abort current transfer */
00138     Cmnd_Transfer_Alm   = 4,    /* transfer almanac */
00139     Cmnd_Transfer_Rte   = 8,    /* transfer routes */
00140     Cmnd_Transfer_Time  = 20,   /* transfer time */
00141     Cmnd_Transfer_Wpt   = 21,   /* transfer waypoints */
00142     Cmnd_Turn_Off_Pwr   = 26    /* turn off power */
00143 };
00144 #endif
00145 
00146 typedef struct
00147 {
00148     G_long lat;                        /* latitude in semicircles */
00149     G_long lon;                        /* longitude in semicircles */
00150 }
00151 Semicircle_Type;
00152 
00153 typedef struct
00154 {
00155     G_double lat;                              /* latitude in radians */
00156     G_double lon;                              /* longitude in radians */
00157 }
00158 Radian_Type;
00159 
00160 typedef struct 
00161 { 
00162   G_int product_ID; 
00163   G_int software_version; 
00164   /* char product_description[]; null-terminated string */ 
00165   /* ... zero or more additional null-terminated strings */ 
00166 } Product_Data_Type;
00167 
00168 typedef struct 
00169 { 
00170   G_byte tag; 
00171   G_word data; 
00172 } Protocol_Data_Type;
00173 
00174 typedef Protocol_Data_Type Protocol_Array_Type[];
00175 
00176 // id of Garmin data formats (sent in Protocol_Data_Type) :
00177 enum GarminDataFormatID
00178 {
00179     Garmin100Type = 100,
00180     Garmin101Type,
00181     Garmin102Type,
00182     Garmin103Type,
00183     Garmin104Type,
00184     Garmin105Type,
00185     Garmin106Type,
00186     Garmin107Type,
00187     Garmin108Type,
00188     Garmin109Type,
00189     Garmin200Type = 200, Garmin201Type, Garmin202Type, Garmin210Type = 210,
00190     Garmin300Type = 300, Garmin301Type, Garmin310Type = 310,
00191     Garmin600Type = 600,
00192     Garmin700Type = 700,
00193     Garmin800Type = 800
00194 };
00195 typedef enum GarminDataFormatID GarminDataFormatID;
00196 
00197 // id of Garmin protocols (sent in Protocol_Data_Type) :
00198 enum GarminProtoID
00199 {
00200     A000 = 0, A001,
00201     A010 = 10, A011,
00202     A100 = 100,
00203     A200 = 200, A201,
00204     A300 = 300, A301,
00205     A400 = 400,
00206     A500 = 500,
00207     A600 = 600,
00208     A700 = 700,
00209     A800 = 800
00210 };
00211 typedef enum GarminProtoID GarminProtoID;
00212 
00213 enum
00214 {
00215 /*--------------------------------------------------------------- 
00216 Symbols for marine (group 0...0-8191...bits 15-13=000). 
00217 ---------------------------------------------------------------*/
00218     sym_anchor = 0,                    /* white anchor symbol */
00219     sym_bell = 1,                      /* white bell symbol */
00220     sym_diamond_grn = 2,               /* green diamond symbol */
00221     sym_diamond_red = 3,               /* red diamond symbol */
00222     sym_dive1 = 4,                     /* diver down flag 1 */
00223     sym_dive2 = 5,                     /* diver down flag 2 */
00224     sym_dollar = 6,                    /* white dollar symbol */
00225     sym_fish = 7,                      /* white fish symbol */
00226     sym_fuel = 8,                      /* white fuel symbol */
00227     sym_horn = 9,                      /* white horn symbol */
00228     sym_house = 10,                    /* white house symbol */
00229     sym_knife = 11,                    /* white knife & fork symbol */
00230     sym_light = 12,                    /* white light symbol */
00231     sym_mug = 13,                      /* white mug symbol */
00232     sym_skull = 14,                    /* white skull and crossbones symbol */
00233     sym_square_grn = 15,               /* green square symbol */
00234     sym_square_red = 16,               /* red square symbol */
00235     sym_wbuoy = 17,                    /* white buoy waypoint symbol */
00236     sym_wpt_dot = 18,                  /* waypoint dot */
00237     sym_wreck = 19,                    /* white wreck symbol */
00238     sym_null = 20,                     /* null symbol (transparent) */
00239     sym_mob = 21,                      /* man overboard symbol */
00240 /*------------------------------------------------------ 
00241 marine navaid symbols 
00242 ------------------------------------------------------*/
00243     sym_buoy_ambr = 22,                /* amber map buoy symbol */
00244     sym_buoy_blck = 23,                /* black map buoy symbol */
00245     sym_buoy_blue = 24,                /* blue map buoy symbol */
00246     sym_buoy_grn = 25,                 /* green map buoy symbol */
00247     sym_buoy_grn_red = 26,             /* green/red map buoy symbol */
00248     sym_buoy_grn_wht = 27,             /* green/white map buoy symbol */
00249     sym_buoy_orng = 28,                /* orange map buoy symbol */
00250     sym_buoy_red = 29,                 /* red map buoy symbol */
00251     sym_buoy_red_grn = 30,             /* red/green map buoy symbol */
00252     sym_buoy_red_wht = 31,             /* red/white map buoy symbol */
00253     sym_buoy_violet = 32,              /* violet map buoy symbol */
00254     sym_buoy_wht = 33,                 /* white map buoy symbol */
00255     sym_buoy_wht_grn = 34,             /* white/green map buoy symbol */
00256     sym_buoy_wht_red = 35,             /* white/red map buoy symbol */
00257     sym_dot = 36,                      /* white dot symbol */
00258     sym_rbcn = 37,                     /* radio beacon symbol */
00259 /*------------------------------------------------------ 
00260 leave space for more navaids (up to 128 total) 
00261 ------------------------------------------------------*/
00262     sym_boat_ramp = 150,               /* boat ramp symbol */
00263     sym_camp = 151,                    /* campground symbol */
00264     sym_restrooms = 152,               /* restrooms symbol */
00265     sym_showers = 153,                 /* shower symbol */
00266     sym_drinking_wtr = 154,            /* drinking water symbol */
00267     sym_phone = 155,                   /* telephone symbol */
00268     sym_1st_aid = 156,                 /* first aid symbol */
00269     sym_info = 157,                    /* information symbol */
00270     sym_parking = 158,                 /* parking symbol */
00271     sym_park = 159,                    /* park symbol */
00272     sym_picnic = 160,                  /* picnic symbol */
00273     sym_scenic = 161,                  /* scenic area symbol */
00274     sym_skiing = 162,                  /* skiing symbol */
00275     sym_swimming = 163,                /* swimming symbol */
00276     sym_dam = 164,                     /* dam symbol */
00277     sym_controlled = 165,              /* controlled area symbol */
00278     sym_danger = 166,                  /* danger symbol */
00279     sym_restricted = 167,              /* restricted area symbol */
00280     sym_null_2 = 168,                  /* null symbol */
00281     sym_ball = 169,                    /* ball symbol */
00282     sym_car = 170,                     /* car symbol */
00283     sym_deer = 171,                    /* deer symbol */
00284     sym_shpng_cart = 172,              /* shopping cart symbol */
00285     sym_lodging = 173,                 /* lodging symbol */
00286     sym_mine = 174,                    /* mine symbol */ 
00287     sym_trail_head = 175,              /* trail head symbol */ 
00288     sym_truck_stop = 176,              /* truck stop symbol */ 
00289     sym_user_exit = 177,               /* user exit symbol */ 
00290     sym_flag = 178,                    /* flag symbol */ 
00291     sym_circle_x = 179,                /* circle with x in the center */
00292 
00293 /*--------------------------------------------------------------- 
00294  Symbols for land (group 1...8192-16383...bits 15-13=001). 
00295  ---------------------------------------------------------------*/
00296     sym_is_hwy = 8192,                 /* interstate hwy symbol */
00297     sym_us_hwy = 8193,                 /* us hwy symbol */
00298     sym_st_hwy = 8194,                 /* state hwy symbol */
00299     sym_mi_mrkr = 8195,                /* mile marker symbol */
00300     sym_trcbck = 8196,                 /* TracBack (feet) symbol */
00301     sym_golf = 8197,                   /* golf symbol */
00302     sym_sml_cty = 8198,                /* small city symbol */
00303     sym_med_cty = 8199,                /* medium city symbol */
00304     sym_lrg_cty = 8200,                /* large city symbol */
00305     sym_freeway = 8201,                /* intl freeway hwy symbol */
00306     sym_ntl_hwy = 8202,                /* intl national hwy symbol */
00307     sym_cap_cty = 8203,                /* capitol city symbol (star) */
00308     sym_amuse_pk = 8204,               /* amusement park symbol */
00309     sym_bowling = 8205,                /* bowling symbol */
00310     sym_car_rental = 8206,             /* car rental symbol */
00311     sym_car_repair = 8207,             /* car repair symbol */
00312     sym_fastfood = 8208,               /* fast food symbol */
00313     sym_fitness = 8209,                /* fitness symbol */
00314     sym_movie = 8210,                  /* movie symbol */
00315     sym_museum = 8211,                 /* museum symbol */
00316     sym_pharmacy = 8212,               /* pharmacy symbol */
00317     sym_pizza = 8213,                  /* pizza symbol */
00318     sym_post_ofc = 8214,               /* post office symbol */
00319     sym_rv_park = 8215,                /* RV park symbol */
00320     sym_school = 8216,                 /* school symbol */
00321     sym_stadium = 8217,                /* stadium symbol */
00322     sym_store = 8218,                  /* dept. store symbol */
00323     sym_zoo = 8219,                    /* zoo symbol */
00324     sym_gas_plus = 8220,               /* convenience store symbol */ 
00325     sym_faces = 8221,                  /* live theater symbol */ 
00326     sym_ramp_int = 8222,               /* ramp intersection symbol */ 
00327     sym_st_int = 8223,                 /* street intersection symbol */ 
00328     sym_weigh_sttn = 8226,             /* inspection/weigh station symbol */ 
00329     sym_toll_booth = 8227,             /* toll booth symbol */ 
00330     sym_elev_pt = 8228,                /* elevation point symbol */ 
00331     sym_ex_no_srvc = 8229,             /* exit without services symbol */ 
00332     sym_geo_place_mm = 8230,           /* Geographic place name, man-made */ 
00333     sym_geo_place_wtr = 8231,          /* Geographic place name, water */ 
00334     sym_geo_place_lnd = 8232,          /* Geographic place name, land */ 
00335     sym_bridge = 8233,                 /* bridge symbol */ 
00336     sym_building = 8234,               /* building symbol */ 
00337     sym_cemetery = 8235,               /* cemetery symbol */ 
00338     sym_church = 8236,                 /* church symbol */ 
00339     sym_civil = 8237,                  /* civil location symbol */ 
00340     sym_crossing = 8238,               /* crossing symbol */ 
00341     sym_hist_town = 8239,              /* historical town symbol */ 
00342     sym_levee = 8240,                  /* levee symbol */ 
00343     sym_military = 8241,               /* military location symbol */ 
00344     sym_oil_field = 8242,              /* oil field symbol */ 
00345     sym_tunnel = 8243,                 /* tunnel symbol */ 
00346     sym_beach = 8244,                  /* beach symbol */ 
00347     sym_forest = 8245,                 /* forest symbol */ 
00348     sym_summit = 8246,                 /* summit symbol */ 
00349     sym_lrg_ramp_int = 8247,           /* large ramp intersection symbol */ 
00350     sym_lrg_ex_no_srvc = 8248,         /* large exit without services smbl */ 
00351     sym_badge = 8249,                  /* police/official badge symbol */ 
00352     sym_cards = 8250,                  /* gambling/casino symbol */
00353     sym_snowski = 8251,                /* snow skiing symbol */ 
00354     sym_iceskate = 8252,               /* ice skating symbol */ 
00355     sym_wrecker = 8253,                /* tow truck (wrecker) symbol */ 
00356     sym_border = 8254,                 /* border crossing (port of entry) */
00357 
00358 /* --------------------------------------------- 
00359    Symbols for aviation (group 2...16383-24575...bits 15-13=010). 
00360    --------------------------------------------------------------- */
00361     sym_airport = 16384,               /* airport symbol */
00362     sym_int = 16385,                   /* intersection symbol */
00363     sym_ndb = 16386,                   /* non-directional beacon symbol */
00364     sym_vor = 16387,                   /* VHF omni-range symbol */
00365     sym_heliport = 16388,              /* heliport symbol */
00366     sym_private = 16389,               /* private field symbol */
00367     sym_soft_fld = 16390,              /* soft field symbol */
00368     sym_tall_tower = 16391,            /* tall tower symbol */
00369     sym_short_tower = 16392,           /* short tower symbol */
00370     sym_glider = 16393,                /* glider symbol */
00371     sym_ultralight = 16394,            /* ultralight symbol */
00372     sym_parachute = 16395,             /* parachute symbol */
00373     sym_vortac = 16396,                /* VOR/TACAN symbol */
00374     sym_vordme = 16397,                /* VOR-DME symbol */
00375     sym_faf = 16398,                   /* first approach fix */
00376     sym_lom = 16399,                   /* localizer outer marker */
00377     sym_map = 16400,                   /* missed approach point */
00378     sym_tacan = 16401,                 /* TACAN symbol */
00379     sym_seaplane = 16402,              /* Seaplane Base */
00380 };
00381 
00382 typedef struct
00383 {
00384   G_char ident[6];              /* identifier */
00385   Semicircle_Type posn;         /* position */
00386   G_longword unused;            /* should be set to zero */
00387   G_char cmnt[40];              /* comment */
00388 }
00389 D100_Wpt_Type;
00390  
00391 typedef struct
00392 {
00393   G_char ident[6];              /* identifier */
00394   Semicircle_Type posn;         /* position */
00395   G_longword unused;            /* should be set to zero */
00396   G_char cmnt[40];              /* comment */
00397   G_float dst;                  /* proximity distance (meters) */
00398   G_byte smbl;                  /* symbol id */
00399 }
00400 D101_Wpt_Type;
00401 
00402 typedef struct
00403 {
00404   G_char ident[6];              /* identifier */
00405   Semicircle_Type posn;         /* position */
00406   G_longword unused;            /* should be set to zero */
00407   G_char cmnt[40];              /* comment */
00408   G_float dst;                  /* proximity distance (meters) */
00409   Symbol_Type smbl;             /* symbol id */
00410 }
00411 D102_Wpt_Type;
00412 
00413 
00414 typedef struct
00415 {
00416     G_char ident[6];            /* identifier */
00417     Semicircle_Type posn;       /* position */
00418     G_longword unused;          /* should be set to zero */
00419     G_char cmnt[40];            /* comment */
00420     G_byte smbl;                /* symbol id */
00421     G_byte dspl;                /* display option */
00422 }
00423 D103_Wpt_Type;
00424 
00425 enum
00426 {
00427     smbl_dot = 0,                      /* dot symbol */
00428     smbl_house = 1,                    /* house symbol */
00429     smbl_gas = 2,                      /* gas symbol */
00430     smbl_car = 3,                      /* car symbol */
00431     smbl_fish = 4,                     /* fish symbol */
00432     smbl_boat = 5,                     /* boat symbol */
00433     smbl_anchor = 6,                   /* anchor symbol */
00434     smbl_wreck = 7,                    /* wreck symbol */
00435     smbl_exit = 8,                     /* exit symbol */
00436     smbl_skull = 9,                    /* skull symbol */
00437     smbl_flag = 10,                    /* flag symbol */
00438     smbl_camp = 11,                    /* camp symbol */
00439     smbl_duck = 12,                    /* duck symbol */
00440     smbl_deer = 13,                    /* deer symbol */
00441     smbl_buoy = 14,                    /* buoy symbol */
00442     smbl_back_track = 15               /* back track symbol */
00443 };
00444 
00445 enum
00446 {
00447     dspl_name = 0,                     /* Display symbol with waypoint name */
00448     dspl_none = 1,                     /* Display symbol by itself */
00449     dspl_cmnt = 2                      /* Display symbol with comment */
00450 };
00451 
00452 typedef struct
00453 {
00454   G_char ident[6];              /* identifier */
00455   Semicircle_Type posn;         /* position */
00456   G_longword unused;            /* should be set to zero */
00457   G_char cmnt[40];              /* comment */
00458   G_float dst;                  /* proximity distance (meters) */
00459   Symbol_Type smbl;             /* symbol id */
00460   G_byte dspl;                  /* display option */
00461 }
00462 D104_Wpt_Type;
00463 
00464 typedef struct { 
00465   Semicircle_Type posn;         /* position */ 
00466   Symbol_Type smbl;             /* symbol id */ 
00467   /* G_char wpt_ident[]; null-terminated string */ 
00468 } D105_Wpt_Type;
00469 
00470 enum
00471 {
00472     dspl_smbl_none = 0,                 /* Display symbol by itself */
00473     dspl_smbl_only = 1,                 /* Display symbol by itself */
00474     dspl_smbl_name = 3,                 /* Display symbol with waypoint name */
00475     dspl_smbl_cmnt = 5,                 /* Display symbol with comment */
00476 };
00477 
00478 typedef struct                          /*                             size */
00479 {
00480     G_byte wpt_class;                   /* class (see below)            1 */
00481     G_byte color;                       /* color (see below)            1 */
00482     G_byte dspl;                        /* display options (see below)  1 */
00483     G_byte attr;                        /* attributes (see below)       1 */
00484     Symbol_Type smbl;                   /* waypoint symbol              2 */
00485     G_byte subclass[18];                /* subclass                    18 */
00486     Semicircle_Type posn;               /* 32 bit semicircle            8 */
00487     G_float alt;                        /* altitude in meters           4 */
00488     G_float dpth;                       /* depth in meters              4 */
00489     G_float dist;                       /* proximity distance in meters 4 */
00490     G_char state[2];                    /* state                        2 */
00491     G_char cc[2];                       /* country code                 2 */
00492     /* G_char ident[]; variable length string 1-51       */
00493     /* G_char comment[]; waypoint user comment 1-51      */
00494     /* G_char facility[]; facility name 1-31             */
00495     /* G_char city[]; city name 1-25                     */
00496     /* G_char addr[]; address number 1-51                */
00497     /* G_char cross_road[]; intersecting road label 1-51 */
00498 }
00499 D108_Wpt_Type;
00500 
00501 /*  The enumerated values for the "wpt_class" member
00502     of the D108_Wpt_Type are defined as follows:  */
00503 enum
00504 {
00505     USER_WPT = 0x00,                   /* User waypoint */
00506     AVTN_APT_WPT = 0x40,               /* Aviation Airport waypoint */
00507     AVTN_INT_WPT = 0x41,               /* Aviation Intersection waypoint */
00508     AVTN_NDB_WPT = 0x42,               /* Aviation NDB waypoint */
00509     AVTN_VOR_WPT = 0x43,               /* Aviation VOR waypoint */
00510     AVTN_ARWY_WPT = 0x44,              /* Aviation Airport Runway waypoint */
00511     AVTN_AINT_WPT = 0x45,              /* Aviation Airport Intersection */
00512     AVTN_ANDB_WPT = 0x46,              /* Aviation Airport NDB waypoint */
00513     MAP_PNT_WPT = 0x80,                /* Map Point waypoint */
00514     MAP_AREA_WPT = 0x81,               /* Map Area waypoint */
00515     MAP_INT_WPT = 0x82,                /* Map Intersection waypoint */
00516     MAP_ADRS_WPT = 0x83,               /* Map Address waypoint */
00517     MAP_LABEL_WPT = 0x84,              /* Map Label Waypoint */
00518     MAP_LINE_WPT = 0x85,               /* Map Line Waypoint */
00519 };
00520 /*  The "color" member can be one of the following values:  */
00521 enum
00522 {
00523     Black, Dark_Red, Dark_Green, Dark_Yellow,
00524     Dark_Blue, Dark_Magenta, Dark_Cyan, Light_Gray,
00525     Dark_Gray, Red, Green, Yellow,
00526     Blue, Magenta, Cyan, White,
00527     Default_Color = 0xFF
00528 };
00529 
00530 /*  The enumerated values for the "dspl" member of the D108_Wpt_Type are the same as the the "dspl" member of the D103_Wpt_Type.  */
00531 /*  The "attr" member should be set to a value of 0x60.  */
00532 /*  The "subclass" member of the D108_Wpt_Type is used for map waypoints only, and should be set to 0x0000 0x00000000 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF for other classes of waypoints.  */
00533 /*  The "alt" and "dpth" members may or may not be supported on a given unit. A value of 1.0e25 in either of these fields indicates that this parameter is not supported or is unknown for this waypoint. */
00534 
00535 typedef struct                  /*                                 size */
00536 {
00537     G_byte dtyp;                /* data packet type (0x01 for D109)1    */
00538     G_byte wpt_class;           /* class                           1    */
00539     G_byte dspl_color;          /* display & color (see below)     1    */
00540     G_byte attr;                /* attributes (0x70 for D109)      1    */
00541     Symbol_Type smbl;           /* waypoint symbol                 2    */
00542     G_byte subclass[18];        /* subclass                        18   */
00543     Semicircle_Type posn;       /* 32 bit semicircle               8    */
00544     G_float alt;                /* altitude in meters              4    */
00545     G_float dpth;               /* depth in meters                 4    */
00546     G_float dist;               /* proximity distance in meters    4    */
00547     G_char state[2];            /* state                           2    */
00548     G_char cc[2];               /* country code                    2    */
00549     G_longword ete;             /* outbound link ete in seconds    4    */
00550     /*  G_char  ident[];           variable length string          1-51 */
00551     /*  G_char  comment[];         waypoint user comment           1-51 */
00552     /*  G_char  facility[];        facility name                   1-31 */
00553     /*  G_char  city[];            city name                       1-25 */
00554     /*  G_char  addr[];            address number                  1-51 */
00555     /*  G_char  cross_road[];      intersecting road label         1-51 */
00556 }
00557 D109_Wpt_Type;
00558 
00559 /*  All fields are defined the same as D108 except as noted below.                    */
00560 /*  dtyp      - Data packet type, must be 0x01 for D109.                              */
00561 /*  dsp_color - The 'dspl_color' member contains three fields; bits 0-4 specify       */
00562 /*    the color, bits 5-6 specify the waypoint display attribute and bit 7 is unused  */
00563 /*    and must be 0. Color values are as specified for D108 except that the default   */
00564 /*    value is 0x1f. Display attribute values are as specified for D108.              */
00565 /*  attr      - Attribute. Must be 0x70 for D109.                                     */
00566 /*  ete       - Estimated time en route in seconds to next waypoint. Default value is */
00567 /*  0xffffffff.                                                                       */
00568 
00569 
00570 typedef G_byte D200_Rte_Hdr_Type;              /* route number */
00571 
00572 typedef struct
00573 {
00574     G_byte nmbr;                /* route number */
00575     G_char cmnt[20];            /* comment */
00576 }
00577 D201_Rte_Hdr_Type;
00578 
00579 typedef struct
00580 {
00581     G_char rte_ident[254];      /* null-terminated string */
00582 }
00583 D202_Rte_Hdr_Type;
00584 
00585 typedef struct
00586 {
00587     G_word class;               /* link class; see below */
00588     G_byte subclass[18];        /* sublcass */
00589     G_char ident[50];           /* variable length string */
00590 }
00591 D210_Rte_Link_Type;
00592 
00593 typedef struct
00594 {
00595     Semicircle_Type posn;       /* position */
00596     G_longword time;            /* time */
00597     G_boolean new_trk;          /* new track segment? */
00598 }
00599 D300_Trk_Point_Type;
00600 
00601 typedef struct
00602 {
00603   Semicircle_Type posn;         /* position */
00604   G_longword time;              /* time */
00605   G_float alt;                  /* altitude in meters */
00606   G_float dpth;                 /* depth in meters */
00607   G_boolean new_trk;            /* new track segment? */
00608 }
00609 D301_Trk_Point_Type;
00610 
00611 typedef struct
00612 {
00613   G_boolean dspl;               /* display on the map? */
00614   G_byte color;                 /* color (same as D108) */
00615   G_char trk_ident[50];         /* null-terminated string */
00616 }
00617 D310_Trk_Hdr_Type;
00618 
00619 typedef struct
00620 {
00621   G_int wn;                     /* week number (weeks) */
00622   G_float toa;                  /* almanac data reference time (s) */
00623   G_float af0;                  /* clock correction coefficient (s) */
00624   G_float af1;                  /* clock correction coefficient (s/s) */
00625   G_float e;                    /* eccentricity (-) */
00626   G_float sqrta;                /* square root of semi-major axis (a) (m**1/2) */
00627   G_float m0;                   /* mean anomaly at reference time (r) */
00628   G_float w;                    /* argument of perigee (r) */
00629   G_float omg0;                 /* right ascension (r) */
00630   G_float odot;                 /* rate of right ascension (r/s) */
00631   G_float i;                    /* inclination angle (r) */
00632   G_byte hlth;                  /* almanac health */
00633 }
00634 D501_Almanac_Type;
00635 
00636 typedef struct
00637 {
00638     G_byte month;               /* month (1-12) */
00639     G_byte day;                 /* day (1-31) */
00640     G_word year;                /* year (1990 means 1990) */
00641     G_int hour;                 /* hour (0-23) */
00642     G_byte minute;              /* minute (0-59) */
00643     G_byte second;              /* second (0-59) */
00644 }
00645 D600_Date_Time_Type;
00646 
00647 typedef struct
00648 {
00649     G_float alt;                /* altitude above WGS 84 ellipsoid (meters) */
00650     G_float epe;                /* estimated position error, 2 sigma (meters) */
00651     G_float eph;                /* epe, but horizontal only (meters) */
00652     G_float epv;                /* epe, but vertical only (meters) */
00653     G_int fix;                  /* type of position fix */
00654     G_double tow;               /* time of week (seconds) */
00655     Radian_Type posn;           /* latitude and longitude (radians) */
00656     G_float east;               /* velocity east (meters/second) */
00657     G_float north;              /* velocity north (meters/second) */
00658     G_float up;                 /* velocity up (meters/second) */
00659     G_float msl_hght;           /* height of WGS 84 ellipsoid above MSL (meters) */
00660     G_int leap_scnds;           /* difference between GPS and UTC (seconds) */
00661     G_long wn_days;             /* week number days */
00662 }
00663 D800_Pvt_Data_Type;
00664 
00665 enum
00666 {
00667     unusable = 0,                      /* failed integrity check */
00668     invalid = 1,                       /* invalid or unavailable */
00669     _2D = 2,                           /* two dimensional */
00670     _3D = 3,                           /* three dimensional */
00671     _2D_diff = 4,                      /* two dimensional differential */
00672     _3D_diff = 5                       /* three dimensional differential */
00673 };
00674 
00675 
00676 /*                   Overlays :                              */
00677 
00678 
00679 typedef struct
00680 {
00681     byte id_l,                         /* product_ID */
00682       id_h,
00683       v_l,                             /* soft version */
00684       v_h,
00685       ident[24];
00686 }
00687 Raw_Product_Data_Type;                 /* overlay of type Product_Data_Type */
00688 
00689 typedef struct
00690 {
00691   byte tag,
00692   d_l,
00693   d_h;
00694 }
00695 Raw_Protocol_Data_type;                /* overlay of type Protocol_Data_Type */
00696 
00697 typedef struct
00698 {                                      /* version transmitted (packed) */
00699     char ident[6];
00700     byte lat[sizeof(G_long)];          /* latitude                         4 */
00701     byte lon[sizeof(G_long)];          /* longitude                        4 */
00702     byte unused[sizeof(G_longword)];
00703     char cmnt[40];
00704 }
00705 Raw_D100_Wpt_Type;
00706 
00707 typedef struct
00708 {                                       /* version transmitted (packed) */
00709     char ident[6];
00710     byte lat[sizeof(G_long)];           /* latitude                         4 */
00711     byte lon[sizeof(G_long)];           /* longitude                        4 */
00712     byte unused[sizeof(G_longword)];
00713     char cmnt[40];
00714     byte dst[sizeof(G_float)];          /* proximity distance (meters) */
00715     byte smbl[sizeof(Symbol_Type)];     /* symbol id */
00716 }
00717 Raw_D102_Wpt_Type;
00718 
00719 typedef struct
00720 {                                      /* version transmitted (packed) */
00721     char ident[6];
00722     byte lat[sizeof(G_long)];          /* latitude                         4 */
00723     byte lon[sizeof(G_long)];          /* longitude                        4 */
00724     byte unused[sizeof(G_longword)];
00725     char cmnt [40];
00726     byte smbl;
00727     byte dspl;
00728 }
00729 Raw_D103_Wpt_Type;
00730 
00731 typedef struct
00732 {                                      /* version transmitted (packed) */
00733     char ident[6];
00734     byte lat[sizeof(G_long)];          /* latitude                         4 */
00735     byte lon[sizeof(G_long)];          /* longitude                        4 */
00736     byte  unused[sizeof(G_longword)];
00737     char cmnt[40];
00738     byte dst[4];                       /* proximity distance (meters) */
00739     byte smbl[sizeof(Symbol_Type)];    /* symbol id */
00740     byte dspl;                         /* display option */
00741 }
00742 Raw_D104_Wpt_Type;
00743 
00744 typedef struct
00745 {
00746     byte lat[sizeof(G_long)];          /* latitude                         4 */
00747     byte lon[sizeof(G_long)];          /* longitude                        4 */
00748     byte smbl[sizeof(Symbol_Type)];    /* symbol id */
00749     char wpt_ident[244];               /* don't know how much exactly */
00750 }
00751 Raw_D105_Wpt_Type;
00752 
00753 typedef struct
00754 {
00755     char ident[6];                     /* identifier */
00756     byte lat[sizeof(G_long)];          /* latitude                         4 */
00757     byte lon[sizeof(G_long)];          /* longitude                        4 */
00758     byte  unused[sizeof(G_longword)];
00759     char cmnt[40];                     /* comment */
00760     byte smbl;                         /* symbol id */
00761     byte dspl;                         /* display option */
00762     byte dst[4];                       /* proximity distance (meters) */
00763     byte color;                        /* waypoint color */
00764 }
00765 Raw_D107_Wpt_Type;
00766 
00767 typedef struct
00768 {
00769     byte wpt_class;                    /* class  1 */
00770     byte color;                        /* color  1 */
00771     byte dspl;                         /* display options  1 */
00772     byte attr;                         /* attributes  1 */
00773     byte smbl[sizeof(Symbol_Type)];    /* waypoint symbol 2 */
00774     byte subclass[18];                 /* subclass 18 */
00775     byte lat[sizeof(G_long)];          /* latitude                         4 */
00776     byte lon[sizeof(G_long)];          /* longitude                        4 */
00777     byte alt[sizeof(G_float)];         /* altitude in meters               4 */
00778     byte dpth[sizeof(G_float)];        /* depth in meters                  4 */
00779     byte dist[sizeof(G_float)];        /* proximity distance in meters     4 */
00780     char state[2];                     /* state 2 */
00781     char cc[2];                        /* country code 2 */
00782     /* char ident[]; variable length string 1-51 */
00783     /* char comment[]; waypoint user comment 1-51 */
00784     /* char facility[]; facility name 1-31 */
00785     /* char city[]; city name 1-25 */
00786     /* char addr[]; address number 1-51 */
00787     /* char cross_road[]; intersecting road label 1-51 */
00788 }
00789 Raw_D108_Wpt_Type;
00790 
00791 typedef struct
00792 {
00793     byte dtyp;                         /* data packet type (0x01 for D109) 1 */
00794     byte wpt_class;                    /* class                            1 */
00795     byte dspl_color;                   /* display & color                  1 */
00796     byte attr;                         /* attributes (0x70 for D109)       1 */
00797     byte smbl[sizeof(Symbol_Type)];    /* waypoint symbol                  2 */
00798     byte subclass[18];                 /* subclass                        18 */
00799     byte lat[sizeof(G_long)];          /* latitude                         4 */
00800     byte lon[sizeof(G_long)];          /* longitude                        4 */
00801     byte alt[sizeof(G_float)];         /* altitude in meters               4 */
00802     byte dpth[sizeof(G_float)];        /* depth in meters                  4 */
00803     byte dist[sizeof(G_float)];        /* proximity distance in meters     4 */
00804     char state[2];                     /* state                            2 */
00805     char cc[2];                        /* country code                     2 */
00806     byte ete[sizeof(G_longword)];      /* outbound link ete in seconds     4 */
00807     /* char ident[];                      variable length string 1-51 */
00808     /* char comment[];                    waypoint user comment 1-51 */
00809     /* char facility[];                   facility name 1-31 */
00810     /* char city[];                       city name 1-25 */
00811     /* char addr[];                       address number 1-51 */
00812     /* char cross_road[];                 intersecting road label 1-51 */
00813 }
00814 Raw_D109_Wpt_Type;  /* overlay of D109_Wpt_Type */
00815 
00816 typedef struct
00817 {
00818     byte class[sizeof(G_word)];         /* link class; see below */
00819     byte subclass[18];                  /* sublcass */
00820     char ident[1];                      /* variable length string */
00821 }
00822 Raw_D210_Rte_Link_Type;
00823 
00824 typedef struct
00825 {
00826     byte month;                        /* month (1-12) */
00827     byte day;                          /* day (1-31) */
00828     byte year_l;                       /* year (1990 means 1990) */
00829     byte year_h;
00830     byte hour_l;                       /* hour (0-23) */
00831     byte hour_h;
00832     byte minute;                       /* minute (0-59) */
00833     byte second;                       /* second (0-59) */
00834 }
00835 Raw_D600_Date_Time_Type;
00836 
00837 typedef struct
00838 {
00839   byte lat[sizeof(G_long)],            /* Semicircle_Type posn */
00840   lon[sizeof(G_long)],
00841   time[sizeof(G_longword)];            /* time */
00842   boolean new_trk;                     /* new track segment? */
00843 }
00844 Raw_D300_Trk_Point_Type;
00845 
00846 typedef struct
00847 {
00848   byte lat[sizeof(G_long)],            /* Semicircle_Type posn */
00849   lon[sizeof(G_long)],
00850   time[sizeof(G_longword)];            /* time */
00851   byte alt[sizeof(G_float)],           /* altitude */
00852   dpth[sizeof(G_float)];               /* depth */
00853   boolean new_trk;                     /* new track segment? */
00854 }
00855 Raw_D301_Trk_Point_Type;
00856 
00857 typedef struct
00858 {
00859     byte lat[sizeof (double)];         /* latitude in radians */
00860     byte lon[sizeof (double)];         /* longitude in radians */
00861 }
00862 Raw_Radian_Type;  /* overlay of the type Radian_Type */
00863 
00864 typedef struct
00865 {                                      /* version transmise */
00866   byte alt[sizeof(G_float)],
00867   epe[sizeof(G_float)],
00868   eph[sizeof(G_float)],
00869   epv[sizeof(G_float)],
00870   fix[sizeof(G_int)],
00871   tow[sizeof(G_double)],
00872   posn[sizeof(Radian_Type)],
00873   east[sizeof(G_float)],
00874   north[sizeof(G_float)],
00875   up[sizeof(G_float)],
00876   msl_hght[sizeof(G_float)],
00877   leap_scnds[sizeof(G_int)],
00878   wn_days[sizeof(G_long)];
00879 }
00880 Raw_D800_Pvt_Data_Type;  /* overlay of D800_Pvt_Data_Type */
00881 
00882 
00883 typedef struct
00884 {                                      /* speed negociation */
00885   byte speed[4];
00886 }
00887 Raw_Speed_Req_Type;
00888 
00889 
00890 union GarminObject
00891 {
00892     Raw_D100_Wpt_Type d100;
00893     Raw_D102_Wpt_Type d102;
00894     Raw_D103_Wpt_Type d103;
00895     Raw_D104_Wpt_Type d104;
00896     Raw_D105_Wpt_Type d105;
00897     Raw_D107_Wpt_Type d107;
00898     Raw_D108_Wpt_Type d108;
00899     Raw_D109_Wpt_Type d109;
00900     Raw_D300_Trk_Point_Type d300;
00901     Raw_D301_Trk_Point_Type d301;
00902     D310_Trk_Hdr_Type d310;
00903     Raw_D600_Date_Time_Type d600;
00904     D200_Rte_Hdr_Type d200;
00905     D201_Rte_Hdr_Type d201;
00906     D202_Rte_Hdr_Type d202;
00907 };                      /* generic Garmin object (data field of packets) */
00908 typedef union GarminObject GarminObject;
00909 
00910 //  local id of formats (must match order of FormatIDTable in gpslib.c) :
00911 enum LocalFormatID
00912 {
00913     Unknown = 0,
00914     G100Type, G101Type, G102Type, G103Type, G104Type, G105Type,
00915     G106Type, G107Type, G108Type,
00916     G200Type, G201Type, G202Type, G210Type,
00917     G300Type, G301Type, G310Type,
00918     G600Type,
00919     G700Type,
00920     G800Type,
00921     G109Type,
00922     GSpeedType,                        /* insert new Garmin types here */
00923     CustomWpt = 100,                   /* custom types */
00924     CustomTrkHdr, CustomTrkPt, CustomRteHdr, CompactTrkPt
00925     /* ,ToForceEnumSize=65535 */
00926 } __attribute__((packed));
00927 typedef enum LocalFormatID LocalFormatID;
00928 
00929 
00930 #endif // __GARMIN_H__

Created: Mon, 08 Oct 2007 22:33:16 +0200
Copyright ©2004 M. Prinke