Forked para SNOCC

Fork of GPS by Simon Ford

Committer:
gstedile
Date:
Sun Dec 04 20:14:00 2016 +0000
Revision:
1:1de2fc75bf38
Parent:
0:15611c7938a3
Prueba

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:15611c7938a3 1 /* mbed EM-406 GPS Module Library
simon 0:15611c7938a3 2 * Copyright (c) 2008-2010, sford
simon 0:15611c7938a3 3 *
simon 0:15611c7938a3 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
simon 0:15611c7938a3 5 * of this software and associated documentation files (the "Software"), to deal
simon 0:15611c7938a3 6 * in the Software without restriction, including without limitation the rights
simon 0:15611c7938a3 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
simon 0:15611c7938a3 8 * copies of the Software, and to permit persons to whom the Software is
simon 0:15611c7938a3 9 * furnished to do so, subject to the following conditions:
simon 0:15611c7938a3 10 *
simon 0:15611c7938a3 11 * The above copyright notice and this permission notice shall be included in
simon 0:15611c7938a3 12 * all copies or substantial portions of the Software.
simon 0:15611c7938a3 13 *
simon 0:15611c7938a3 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
simon 0:15611c7938a3 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
simon 0:15611c7938a3 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
simon 0:15611c7938a3 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
simon 0:15611c7938a3 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
simon 0:15611c7938a3 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
simon 0:15611c7938a3 20 * THE SOFTWARE.
simon 0:15611c7938a3 21 */
simon 0:15611c7938a3 22
simon 0:15611c7938a3 23 #include "mbed.h"
gstedile 1:1de2fc75bf38 24 #include <string>
simon 0:15611c7938a3 25
simon 0:15611c7938a3 26 #ifndef MBED_GPS_H
simon 0:15611c7938a3 27 #define MBED_GPS_H
simon 0:15611c7938a3 28
simon 0:15611c7938a3 29 /** A GPS interface for reading from a Globalsat EM-406 GPS Module */
simon 0:15611c7938a3 30 class GPS {
simon 0:15611c7938a3 31 public:
simon 0:15611c7938a3 32
simon 0:15611c7938a3 33 /** Create the GPS interface, connected to the specified serial port
simon 0:15611c7938a3 34 */
simon 0:15611c7938a3 35 GPS(PinName tx, PinName rx);
simon 0:15611c7938a3 36
simon 0:15611c7938a3 37 /** Sample the incoming GPS data, returning whether there is a lock
simon 0:15611c7938a3 38 *
simon 0:15611c7938a3 39 * @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
simon 0:15611c7938a3 40 */
simon 0:15611c7938a3 41 int sample();
simon 0:15611c7938a3 42
simon 0:15611c7938a3 43 /** The longitude (call sample() to set) */
simon 0:15611c7938a3 44 float longitude;
gstedile 1:1de2fc75bf38 45
gstedile 1:1de2fc75bf38 46 /** The latitude (call sample() to set) */
gstedile 1:1de2fc75bf38 47 float latitude;
gstedile 1:1de2fc75bf38 48
gstedile 1:1de2fc75bf38 49 /** The speed in knots (call sample() to set) */ // Esta variable la agrego para disponer de la velocidad.
gstedile 1:1de2fc75bf38 50 float speed;
gstedile 1:1de2fc75bf38 51
gstedile 1:1de2fc75bf38 52
gstedile 1:1de2fc75bf38 53
gstedile 1:1de2fc75bf38 54 char msg[256]; // Cambio de ambito de privado a publico esta variable para poder imprimirla
gstedile 1:1de2fc75bf38 55 string mensajes; // Agrego variables miembro publicas para debbuging
gstedile 1:1de2fc75bf38 56 string mensaje1;
gstedile 1:1de2fc75bf38 57 string mensaje2;
gstedile 1:1de2fc75bf38 58 string mensaje3;
gstedile 1:1de2fc75bf38 59 string mensaje4;
simon 0:15611c7938a3 60
simon 0:15611c7938a3 61
simon 0:15611c7938a3 62 private:
simon 0:15611c7938a3 63 float trunc(float v);
simon 0:15611c7938a3 64 void getline();
simon 0:15611c7938a3 65
simon 0:15611c7938a3 66 Serial _gps;
gstedile 1:1de2fc75bf38 67 // char msg[256];
simon 0:15611c7938a3 68
simon 0:15611c7938a3 69 };
simon 0:15611c7938a3 70
simon 0:15611c7938a3 71 #endif