Example showing how to use the ublox Cellular GPS/GNSS module. The program will use GPS to get location and time, setup TCP connections and finally send and receive SMS messages
Dependencies: C027_Support mbed
Revision 28:1c9844ce4e9d, committed 2014-10-23
- Comitter:
- embeddedartists
- Date:
- Thu Oct 23 19:00:14 2014 +0000
- Parent:
- 27:59ed90c2efe0
- Commit message:
- Added 3G support
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 59ed90c2efe0 -r 1c9844ce4e9d main.cpp --- a/main.cpp Wed Oct 01 09:19:33 2014 +0000 +++ b/main.cpp Thu Oct 23 19:00:14 2014 +0000 @@ -24,7 +24,7 @@ /*! The APN of your network operator SIM, sometimes it is "internet" check your contract with the network operator. You can also try to look-up your settings in google: https://www.google.de/search?q=APN+list */ -#define APN NULL +#define APN "online.telia.se" //! Set the user name for your APN, or NULL if not needed #define USERNAME NULL //! Set the password for your APN, or NULL if not needed @@ -193,7 +193,7 @@ //printf("NMEA: %.*s\r\n", len-2, msg); if ((PROTOCOL(ret) == GPSParser::NMEA) && (len > 6)) { - if (!strncmp("$GPGLL", buf, 6)) { + if (!strncmp("$GPGLL", buf, 6) || !strncmp("$GNGLL", buf, 6)) { double la = 0, lo = 0; char ch; if (gps.getNmeaAngle(1,buf,len,la) && @@ -204,11 +204,11 @@ sprintf(link, "I am here!\n" "https://maps.google.com/?q=%.5f,%.5f", la, lo); } - } else if (!strncmp("$GPGGA", buf, 6)) { + } else if (!strncmp("$GPGGA", buf, 6) || !strncmp("$GNGGA", buf, 6)) { double a = 0; if (gps.getNmeaItem(9,buf,len,a)) // altitude msl [m] printf("GPS Altitude: %.1f\r\n", a); - } else if (!strncmp("$GPVTG", buf, 6)) { + } else if (!strncmp("$GPVTG", buf, 6) || !strncmp("$GNVTG", buf, 6)) { double s = 0; if (gps.getNmeaItem(7,buf,len,s)) // speed [km/h] printf("GPS Speed: %.1f\r\n", s);