C027_Support library plus AT Comand for dialing.

Fork of C027_Support_New by irsan julfikar

Files at this revision

API Documentation at this revision

Comitter:
mazgch
Date:
Mon May 12 07:09:31 2014 +0000
Parent:
50:d76aece8038f
Child:
52:8071747a7cb3
Commit message:
convert defines to enums to avoid duplicate defines

Changed in this revision

GPS.h Show annotated file Show diff for this revision Revisions of this file
MDM.h Show annotated file Show diff for this revision Revisions of this file
--- a/GPS.h	Fri May 09 19:35:18 2014 +0000
+++ b/GPS.h	Mon May 12 07:09:31 2014 +0000
@@ -18,16 +18,19 @@
 class GPSParser
 {
 public:
-    // 
-    #define WAIT      -1 //!< wait for more incoming data (the start of a message was found, or no data available)
-    #define NOT_FOUND  0 //!< a parser concluded the the current offset of the pipe doe not contain a valid message
+    enum { 
+        // getLine Responses
+        WAIT      = -1, //!< wait for more incoming data (the start of a message was found, or no data available)
+        NOT_FOUND =  0, //!< a parser concluded the the current offset of the pipe doe not contain a valid message
     
-    #define UNKNOWN     0x000000        //!< message type is unknown 
-    #define UBX         0x100000        //!< message if of protocol NMEA
-    #define NMEA        0x200000        //!< message if of protocol UBX
-    #define LENGTH(x)   (x & 0x00FFFF)  //!< extract/mask the length
-    #define PROTOCOL(x) (x & 0xFF0000)  //!< extract/mask the type
+        #define LENGTH(x)   (x & 0x00FFFF)  //!< extract/mask the length
+        #define PROTOCOL(x) (x & 0xFF0000)  //!< extract/mask the type
 
+        UNKNOWN   = 0x000000,       //!< message type is unknown 
+        UBX       = 0x100000,       //!< message if of protocol NMEA
+        NMEA      = 0x200000        //!< message if of protocol UBX
+    };
+    
     /** Get a line from the physical interface. This fucntion 
         needs to be implemented in the inherited class.
         \param buf the buffer to store it
--- a/MDM.h	Fri May 09 19:35:18 2014 +0000
+++ b/MDM.h	Mon May 12 07:09:31 2014 +0000
@@ -261,28 +261,31 @@
     // Parseing
     // ----------------------------------------------------------------
     
-    // waitFinalResp Responses
-    #define NOT_FOUND    0
-    #define WAIT        -1 // TIMEOUT
-    #define OK          -2 
-    #define ERROR       -3
-    #define PROMPT      -4
+    enum { 
+        // waitFinalResp Responses
+        NOT_FOUND   =  0,
+        WAIT        = -1, // TIMEOUT
+        OK          = -2, 
+        ERROR       = -3,
+        PROMPT      = -4,
     
-    // getLine Responses
-    #define LENGTH(x)  (x & 0x00FFFF)
-    #define TYPE(x)    (x & 0xFF0000)
-    #define TYPE_UNKNOWN    0x000000
-    #define TYPE_OK         0x110000
-    #define TYPE_ERROR      0x120000
-    #define TYPE_RING       0x210000
-    #define TYPE_CONNECT    0x220000
-    #define TYPE_NOCARRIER  0x230000
-    #define TYPE_NODIALTONE 0x240000
-    #define TYPE_BUSY       0x250000
-    #define TYPE_NOANSWER   0x260000
-    #define TYPE_PROMPT     0x300000
-    #define TYPE_PLUS       0x400000
-    #define TYPE_TEXT       0x500000
+        // getLine Responses
+        #define LENGTH(x)  (x & 0x00FFFF) //!< extract/mask the length
+        #define TYPE(x)    (x & 0xFF0000) //!< extract/mask the type
+        
+        TYPE_UNKNOWN    = 0x000000,
+        TYPE_OK         = 0x110000,
+        TYPE_ERROR      = 0x120000,
+        TYPE_RING       = 0x210000,
+        TYPE_CONNECT    = 0x220000,
+        TYPE_NOCARRIER  = 0x230000,
+        TYPE_NODIALTONE = 0x240000,
+        TYPE_BUSY       = 0x250000,
+        TYPE_NOANSWER   = 0x260000,
+        TYPE_PROMPT     = 0x300000,
+        TYPE_PLUS       = 0x400000,
+        TYPE_TEXT       = 0x500000
+    };
     
     /** Get a line from the physical interface. This function need 
         to be implemented in a inherited class. Usually just calls