Own fork of C027_Support

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of C027_Support by u-blox

Files at this revision

API Documentation at this revision

Comitter:
mazgch
Date:
Mon Mar 17 13:18:04 2014 +0000
Parent:
18:e5697801df29
Child:
24:0e287a85ac9e
Commit message:
fix angle api, only one MDM constructor

Changed in this revision

GPS.cpp Show annotated file Show diff for this revision Revisions of this file
GPS.h Show annotated file Show diff for this revision Revisions of this file
MDM.cpp 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.cpp	Fri Mar 14 13:07:48 2014 +0000
+++ b/GPS.cpp	Mon Mar 17 13:18:04 2014 +0000
@@ -203,19 +203,17 @@
     return false;
 }
 
-bool GPSParser::getNmeaAngle(int ix, char* buf, int len, double& d)
+bool GPSParser::getNmeaAngle(int ix, char* buf, int len, double& val)
 {
     char ch;
-    char val;
     if (getNmeaItem(ix,buf,len,val) && getNmeaItem(ix+1,buf,len,ch) && 
         ((ch == 'S') || (ch == 'N') || (ch == 'E') || (ch == 'W')))
     {
         val *= 0.01;
-        int i = (int)d;
+        int i = (int)val;
         val = (val - i) / 0.6 + i;
         if (ch == 'S' || ch == 'W')
             val = -val;
-        d = val;
         return true;
     }
     return false;
--- a/GPS.h	Fri Mar 14 13:07:48 2014 +0000
+++ b/GPS.h	Mon Mar 17 13:18:04 2014 +0000
@@ -28,7 +28,7 @@
     static bool getNmeaItem(int ix, char* buf, int len, double& val);
     static bool getNmeaItem(int ix, char* buf, int len, int& val, int base/*=10*/);
     static bool getNmeaItem(int ix, char* buf, int len, char& val);
-    static bool getNmeaAngle(int ix, char* buf, int len, double& d);
+    static bool getNmeaAngle(int ix, char* buf, int len, double& val);
 protected:
     static int _getMessage(Pipe<char>* pipe, char* buf, int len);
     static int _parseNmea(Pipe<char>* pipe, int len);
--- a/MDM.cpp	Fri Mar 14 13:07:48 2014 +0000
+++ b/MDM.cpp	Mon Mar 17 13:18:04 2014 +0000
@@ -2,7 +2,6 @@
 #include <ctype.h>
 #include "MDM.h"
 
-
 int MDMParser::send(const char* buf, int len)
 {
     return _send(buf, len);
@@ -72,13 +71,6 @@
 // ----------------------------------------------------------------
 
 MDMSerial::MDMSerial(PinName tx /*= MDMTXD*/, PinName rx /*= MDMRXD*/, int baudrate /*= MDMBAUD*/,
-            int rxSize /*= 256*/, int txSize /*= 128*/) : 
-            SerialPipe(tx, rx, rxSize, txSize)
-{
-    baud(baudrate);
-}
-
-MDMSerial::MDMSerial(PinName tx /*= MDMTXD*/, PinName rx /*= MDMRXD*/, int baudrate /*= MDMBAUD*/,
             PinName rts /*= MDMRTS*/, PinName cts /*= MDMCTS*/, int rxSize /*= 256*/, int txSize /*= 128*/) : 
             SerialPipe(tx, rx, rts, cts, rxSize, txSize)
 {
--- a/MDM.h	Fri Mar 14 13:07:48 2014 +0000
+++ b/MDM.h	Mon Mar 17 13:18:04 2014 +0000
@@ -32,8 +32,6 @@
 {
 public: 
     MDMSerial(PinName tx = MDMTXD, PinName rx = MDMRXD, int baudrate = MDMBAUD,
-              int rxSize = RX_SIZE, int txSize = TX_SIZE);
-    MDMSerial(PinName tx = MDMTXD, PinName rx = MDMRXD, int baudrate = MDMBAUD,
               PinName rts = MDMRTS, PinName cts = MDMCTS,
               int rxSize = RX_SIZE, int txSize = TX_SIZE);
     virtual int getLine(char* buffer, int length);