Simple detection for LE910-NA1 modules

Fork of MTS-Cellular by MultiTech

Revision:
78:fc9d2b983744
Parent:
77:82c0ec0f73ba
Child:
79:da70f86996a1
diff -r 82c0ec0f73ba -r fc9d2b983744 Cellular/Cellular.h
--- a/Cellular/Cellular.h	Tue Jul 28 16:18:45 2015 +0000
+++ b/Cellular/Cellular.h	Mon Aug 17 21:05:41 2015 +0000
@@ -264,6 +264,32 @@
         std::string timestamp;
     };
 
+    /** This structure contains the data for GPS position.
+    */
+    struct gpsData {
+        bool success;
+        /// Format is ddmm.mmmm N/S. Where: dd - degrees 00..90; mm.mmmm - minutes 00.0000..59.9999; N/S: North/South.
+        std::string latitude;
+        /// Format is dddmm.mmmm E/W. Where: ddd - degrees 000..180; mm.mmmm - minutes 00.0000..59.9999; E/W: East/West.
+        std::string longitude;
+        /// Horizontal Diluition of Precision.
+        float hdop;
+        /// Altitude - mean-sea-level (geoid) in meters.
+        float altitude;
+        /// 0 or 1 - Invalid Fix; 2 - 2D fix; 3 - 3D fix.
+        int fix;
+        /// Format is ddd.mm - Course over Ground. Where: ddd - degrees 000..360; mm - minutes 00..59.
+        std::string cog;
+        /// Speed over ground (Km/hr).
+        float kmhr;
+        /// Speed over ground (knots).
+        float knots;
+        /// Total number of satellites in use.
+        int satellites;
+        /// Date and time in the format YY/MM/DD,HH:MM:SS.
+        std::string timestamp;
+    };
+    
     /** This method initializes the object with the underlying radio
     * interface to use. Note that this function MUST be called before
     * any other calls will function correctly on a Cellular object. Also
@@ -473,10 +499,37 @@
     */
     std::string getRadioType();
 
+    /** Enables GPS.
+    * @returns true if GPS is enabled, false if GPS is not supported.
+    */
+    virtual bool GPSenable();
+
+    /** Disables GPS.
+    * @returns true if GPS is disabled, false if GPS does not disable.
+    */
+    virtual bool GPSdisable();
+
+    /** Checks if GPS is enabled.
+    * @returns true if GPS is enabled, false if GPS is disabled.
+    */
+    virtual bool GPSenabled();
+        
+    /** Get GPS position.
+    * @returns a structure containing the GPS data field information.
+    */
+    virtual gpsData GPSgetPosition();
+
+    /** Check for GPS fix.
+    * @returns true if there is a fix and false otherwise.
+    */
+    virtual bool GPSgotFix();
+            
 protected:
     MTSBufferedIO* io; //IO interface obect that the radio is accessed through.
     bool echoMode; //Specifies if the echo mode is currently enabled.
 
+    bool gpsEnabled;    //true if GPS is enabled, else false.
+        
     bool pppConnected; //Specifies if a PPP session is currently connected.
     std::string apn; //A string that holds the APN for the radio.
 
@@ -497,4 +550,4 @@
 
 }
 
-#endif /* CELLULAR_H */
+#endif /* CELLULAR_H */
\ No newline at end of file