1 #ifndef gpsapp_h
2 #define gpsapp_h
3 
4 
5 #include "gps.h"
6 
7   int32  GPS_Init(const char* port);
8 
9   int32  GPS_A100_Get(const char* port, GPS_PWay** way, int (*cb)(int ct, GPS_PWay*));
10   int32 GPS_A101_Get(const char* port);
11   int32  GPS_A100_Send(const char* port, GPS_PWay* way, int32 n, int (*cb)(GPS_PWay*));
12 
13   int32  GPS_A200_Get(const char* port, GPS_PWay** way);
14   int32  GPS_A201_Get(const char* port, GPS_PWay** way);
15   int32  GPS_A200_Send(const char* port, GPS_PWay* way, int32 n);
16   int32  GPS_A201_Send(const char* port, GPS_PWay* way, int32 n);
17 
18   int32  GPS_A300_Get(const char* port, GPS_PTrack** trk, pcb_fn cb);
19   int32  GPS_A301_Get(const char* port, GPS_PTrack** trk, pcb_fn cb, int protoid);
20   int32  GPS_A300_Send(const char* port, GPS_PTrack* trk, int32 n);
21   int32  GPS_A301_Send(const char* port, GPS_PTrack* trk, int32 n, int protoid,
22                        gpsdevh* fd);
23 
24   int32  GPS_D300_Get(GPS_PTrack* trk, int32 entries, gpsdevh* h);
25   void   GPS_D300b_Get(GPS_PTrack* trk, UC* data);
26   void   GPS_D301b_Get(GPS_PTrack* trk, UC* data);
27   void   GPS_D302b_Get(GPS_PTrack* trk, UC* data);
28   void   GPS_D303b_Get(GPS_PTrack* trk, UC* data); /*D304*/
29   void   GPS_D310_Get(GPS_PTrack* trk, UC* s);
30   void   GPS_D311_Get(GPS_PTrack* trk, UC* s);
31   void   GPS_D300_Send(UC* data, GPS_PTrack trk, int32* len);
32   void   GPS_D301_Send(UC* data, GPS_PTrack trk, int32* len, int type);
33   void   GPS_D303_Send(UC* data, GPS_PTrack trk, int32* len, int protoid);
34   void   GPS_D310_Send(UC* data, GPS_PTrack trk, int32* len);
35   void   GPS_D311_Send(UC* data, GPS_PTrack trk, int32* len);
36 
37   int32  GPS_A400_Get(const char* port, GPS_PWay** way);
38   int32  GPS_A400_Send(const char* port, GPS_PWay* way, int32 n);
39 
40   int32  GPS_A500_Get(const char* port, GPS_PAlmanac** alm);
41   int32  GPS_A500_Send(const char* port, GPS_PAlmanac* alm, int32 n);
42 
43   time_t GPS_A600_Get(const char* port);
44   time_t GPS_D600_Get(GPS_PPacket& packet);
45   int32  GPS_A600_Send(const char* port, time_t Time);
46   void   GPS_D600_Send(GPS_PPacket& packet, time_t Time);
47 
48   int32  GPS_A700_Get(const char* port, double* lat, double* lon);
49   int32  GPS_A700_Send(const char* port, double lat, double lon);
50   void   GPS_D700_Get(GPS_PPacket& packet, double* lat, double* lon);
51   void   GPS_D700_Send(GPS_PPacket& packet, double lat, double lon);
52 
53   int32  GPS_A800_On(const char* port, gpsdevh** fd);
54   int32  GPS_A800_Off(const char* port, gpsdevh** fd);
55   int32  GPS_A800_Get(gpsdevh** fd, GPS_PPvt_Data* packet);
56   void   GPS_D800_Get(GPS_PPacket& packet, GPS_PPvt_Data* pvt);
57 
58   int32  GPS_A906_Get(const char* port, GPS_PLap** lap, pcb_fn cb);
59   void   GPS_D1011b_Get(GPS_PLap* Lap,UC* data); /*D906 D1001 D1015*/
60 
61   int32  GPS_A1006_Get(const char* port, GPS_PCourse** crs, pcb_fn cb);
62   int32  GPS_A1006_Send(const char* port, GPS_PCourse* crs, int32 n_crs,
63                         gpsdevh* fd);
64   void   GPS_D1006_Get(GPS_PCourse* crs, UC* p);
65   void   GPS_D1006_Send(UC* data, GPS_PCourse crs, int32* len);
66 
67   int32  GPS_A1007_Get(const char* port, GPS_PCourse_Lap** clp, pcb_fn cb);
68   int32  GPS_A1007_Send(const char* port, GPS_PCourse_Lap* clp, int32 n_clp,
69                         gpsdevh* fd);
70   void   GPS_D1007_Get(GPS_PCourse_Lap* clp, UC* p);
71   void   GPS_D1007_Send(UC* data, GPS_PCourse_Lap clp, int32* len);
72 
73   int32  GPS_A1008_Get(const char* port, GPS_PCourse_Point** cpt, pcb_fn cb);
74   int32  GPS_A1008_Send(const char* port, GPS_PCourse_Point* cpt, int32 n_cpt,
75                         gpsdevh* fd);
76   void   GPS_D1012_Get(GPS_PCourse_Point* cpt, UC* p);
77   void   GPS_D1012_Send(UC* data, GPS_PCourse_Point cpt, int32* len);
78 
79   int32  GPS_A1009_Get(const char* port, GPS_PCourse_Limits limits);
80   void   GPS_D1013_Get(GPS_PCourse_Limits limits, UC* p);
81 
82   /* Unhandled documented protocols, as of:
83     Garmin Device Interface Specification, May 19, 2006, Drawing Number: 001-00063-00 Rev. C
84   A650  FlightBook Transfer Protocol
85   A1000  Run Transfer Protocol
86   	Capability A1000: D1009
87   		D1000 D1010
88   A1002  Workout Transfer Protocol
89   	Capability A1002: D1008
90   		D1002
91   	Capability A1003: D1003
92   A1004  Fitness User Profile Transfer Protocol
93   	Capability A1004: D1004
94   A1005  Workout Limits Transfer Protocol
95   	Capability A1005: D1005
96   */
97   /* Unimplemented and Undocumented, as listed from the following device/sw:
98   	GF305 3.70
99 
100   Capability A601: D601
101   Capability A801: D801
102 
103   Capability A902:
104   Capability A903:
105   Capability A907: D907 D908 D909 D910
106   Capability A918: D918
107   Capability A1013: D1014
108   */
109 
110   const char* Get_Pkt_Type(US p, US d0, const char** xinfo);
111 
112   void GPS_Prepare_Track_For_Device(GPS_PTrack** trk, int32* n);
113   int32 GPS_Set_Baud_Rate(const char* port, int br);
114 
115 #endif
116