00001 /*! \file WaspGPS.h 00002 \brief Library for managing the GPS A1084 receiver 00003 00004 Copyright (C) 2009 Libelium Comunicaciones Distribuidas S.L. 00005 http://www.libelium.com 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation, either version 2.1 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 Version: 0.6 00021 00022 Design: David Gascón 00023 00024 Implementation: Alberto Bielsa, David Cuartielles, Mikal Hart 00025 00026 */ 00027 00028 /*! \def WaspGPS_h 00029 \brief The library flag 00030 00031 */ 00032 #ifndef WaspGPS_h 00033 #define WaspGPS_h 00034 00035 /****************************************************************************** 00036 * Includes 00037 ******************************************************************************/ 00038 00039 #include <inttypes.h> 00040 00041 /****************************************************************************** 00042 * Definitions & Declarations 00043 ******************************************************************************/ 00044 00045 /*! \def VERSION 00046 \brief Version Control 00047 00048 */ 00049 #define VERSION "WaspGPS 01c, (c) 2009 A.Bielsa for Libelium.com\n" 00050 00051 /*! \def GPS_BINARY 00052 \brief Enables binary mode. 00053 00054 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00055 00056 Setting this option Binary Mode is enabled. 00057 */ 00058 /*! \def GPS_NMEA_GGA 00059 \brief Enables NMEA -> GGA sentences. 00060 00061 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00062 00063 Setting this option, only NMEA GGA sentences are enabled. 00064 */ 00065 /*! \def GPS_NMEA_GLL 00066 \brief Enables NMEA -> GLL sentences. 00067 00068 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00069 00070 Setting this option, only NMEA GLL sentences are enabled. 00071 */ 00072 /*! \def GPS_NMEA_GSA 00073 \brief Enables NMEA -> GSA sentences. 00074 00075 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00076 00077 Setting this option, only NMEA GSA sentences are enabled. 00078 00079 */ 00080 /*! \def GPS_NMEA_GSV 00081 \brief Enables NMEA -> GSV sentences. 00082 00083 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00084 00085 Setting this option, only NMEA GSV sentences are enabled. 00086 00087 */ 00088 /*! \def GPS_NMEA_RMC 00089 \brief Enables NMEA -> RMC sentences. 00090 00091 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00092 00093 Setting this option, only NMEA RMC sentences are enabled. 00094 00095 */ 00096 /*! \def GPS_NMEA_VTG 00097 \brief Enables NMEA -> VTG sentences. 00098 00099 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00100 00101 Setting this option, only NMEA VTG sentences are enabled. 00102 00103 */ 00104 /*! \def GPS_NMEA 00105 \brief Enables NMEA -> All sentences. 00106 00107 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00108 00109 Setting this option, all NMEA sentences are enabled. 00110 00111 */ 00112 /*! \def GPS_BINARY_OFF 00113 \brief In binary mode, set GPS module in request mode. 00114 00115 There are differents ways to set communication with GPS module: Binary mode or NMEA mode. 00116 00117 Setting this option, GPS module stops sending binary automatic responses. It will send binary commands only when we ask him. 00118 00119 */ 00120 #define GPS_BINARY 1 00121 #define GPS_NMEA_GGA 2 00122 #define GPS_NMEA_GLL 4 00123 #define GPS_NMEA_GSA 8 00124 #define GPS_NMEA_GSV 16 00125 #define GPS_NMEA_RMC 32 00126 #define GPS_NMEA_VTG 64 00127 #define GPS_NMEA 128 00128 #define GPS_BINARY_OFF 256 00129 00130 00131 /*! \def GPS_ON 00132 \brief GPS power mode: ON. 00133 00134 Using GPS_ON makes GPS module to switch on. 00135 00136 */ 00137 /*! \def GPS_OFF 00138 \brief GPS power mode: OFF 00139 00140 Using GPS_OFF makes GPS module to switch off. 00141 */ 00142 #define GPS_ON 0 00143 #define GPS_OFF 1 00144 00145 00146 /*! \def HOT 00147 \brief GPS waking up mode: HOT. 00148 00149 Using HOT makes GPS module to restart on a hot one, keeping ephemeris and almanacs. 00150 00151 This mode is used by default. 00152 00153 */ 00154 /*! \def WARM 00155 \brief GPS waking up mode: WARM. 00156 00157 Using WARM makes GPS module to restart on a warm one, keeping almanacs. 00158 00159 */ 00160 /*! \def COLD 00161 \brief GPS waking up mode: COLD. 00162 00163 Using COLD makes GPS module to restart on a cold one deleting all the previously stored information. 00164 00165 */ 00166 #define HOT 0 00167 #define WARM 1 00168 #define COLD 2 00169 00170 00171 /*! \def ACK 00172 \brief Flag value 00173 00174 Initial value for 'flag'. 00175 00176 */ 00177 /*! \def GPS_TIMEOUT 00178 \brief Flag value 00179 00180 The GPS timed out while waiting for a string. 00181 */ 00182 /*! \def GPS_INVALID 00183 \brief Flag value 00184 00185 The reading was not valid, satellite data isn't good enough. 00186 */ 00187 /*! \def GPS_ERROR_EPHEMERIS 00188 \brief Flag value 00189 00190 Error trying to get an ephemeris string. 00191 */ 00192 /*! \def GPS_ERROR_SAVE_EPHEMERIS 00193 \brief Flag value 00194 00195 Error trying to save an ephemeris string. 00196 */ 00197 /*! \def GPS_DATA_ERROR 00198 \brief Flag value 00199 00200 Error while parsing e.g. the amount of satellites. 00201 */ 00202 /*! \def GPS_BAD_SENTENCE 00203 \brief Flag value 00204 00205 Error, arrival of different sentence than expected. 00206 */ 00207 /*! \def GPS_BAD_CHECKSUM 00208 \brief Flag value 00209 00210 Error, data corrupted in some mysterious way. 00211 */ 00212 /*! \def GPS_ERROR_FILE_EPHEMERIS 00213 \brief Flag value 00214 00215 Error, couldn't use the ephemeris file. 00216 */ 00217 /*! \def GPS_FILE_EPHEMERIS_EMPTY 00218 \brief Flag value 00219 00220 Warning, ephemeris file is empty. 00221 */ 00222 #define ACK 0 00223 #define GPS_TIMEOUT 1 00224 #define GPS_INVALID 2 00225 #define GPS_ERROR_EPHEMERIS 4 00226 #define GPS_ERROR_SAVE_EPHEMERIS 8 00227 #define GPS_DATA_ERROR 16 00228 #define GPS_BAD_SENTENCE 32 00229 #define GPS_BAD_CHECKSUM 64 00230 #define GPS_ERROR_FILE_EPHEMERIS 128 00231 #define GPS_FILE_EPHEMERIS_EMPTY 256 00232 00233 00234 /*! \def GPS_TIMEOUT_em 00235 \brief Error message for flag 00236 00237 String error --> "error: the GPS timed out" 00238 */ 00239 /*! \def GPS_ERROR_EPHEMERIS_em 00240 \brief Error message for flag 00241 00242 String error --> "error: couldn't get ephemeris" 00243 */ 00244 /*! \def GPS_ERROR_SAVE_EPHEMERIS_em 00245 \brief Error message for flag 00246 00247 String error --> "error: couldn't save ephemeris to SD" 00248 */ 00249 /*! \def GPS_CREATE_FILE_EPHEMERIS_em 00250 \brief Error message for flag 00251 00252 String error --> "error: couldn't create ephemeris file" 00253 */ 00254 /*! \def GPS_DATA_ERROR_em 00255 \brief Error message for flag 00256 00257 String error --> "error: data not consistent" 00258 */ 00259 /*! \def GPS_BAD_SENTENCE_em 00260 \brief Error message for flag 00261 00262 String error --> "error: different sentence than expected" 00263 */ 00264 #define GPS_TIMEOUT_em "error: the GPS timed out" 00265 #define GPS_ERROR_EPHEMERIS_em "error: couldn't get ephemeris" 00266 #define GPS_ERROR_SAVE_EPHEMERIS_em "error: couldn't save ephemeris to SD" 00267 #define GPS_CREATE_FILE_EPHEMERIS_em "error: couldn't create ephemeris file" 00268 #define GPS_DATA_ERROR_em "error: data not consistent" 00269 #define GPS_BAD_SENTENCE_em "error: different sentence than expected" 00270 00271 00272 /*! \def ATTEMPTS_TO_READ 00273 \brief Values for timings, etc 00274 00275 */ 00276 #define ATTEMPTS_TO_READ 5 00277 00278 /*! \def FILE_EPHEMERIS 00279 \brief File used to save and load ephemeris 00280 00281 "ephemeris.txt" 00282 */ 00283 #define FILE_EPHEMERIS "ephemeris.txt" 00284 00285 /****************************************************************************** 00286 * Class 00287 ******************************************************************************/ 00288 00289 //! WaspGPS Class 00290 /*! 00291 WaspGPS Class defines all the variables and functions used to manage GPS A1084 receiver 00292 */ 00293 class WaspGPS 00294 { 00295 private: 00296 00297 //! It extracts Date from a NMEA RMC sentence 00298 /*! 00299 \param void 00300 \return void 00301 \sa extractTime(), getTime(), getDate() 00302 */ 00303 void extractDate(void); 00304 00305 //! It extracts Time from a NMEA GGA sentence 00306 /*! 00307 \param void 00308 \return void 00309 \sa extractTime(), getTime(), getDate() 00310 */ 00311 void extractTime(void); 00312 00313 //! It extracts a decimal number from a string 00314 /*! 00315 \param char *str: The string which contains the decimal number to extract 00316 \return the number extracted from the string given as parameter. 00317 \sa extractTime(), getTime(), getDate(), parse_degrees(char *str), gpsatol(char *str), gpsisdigit(char c) 00318 */ 00319 long parse_decimal(char *str); 00320 00321 //! It extracts a degree number from a string 00322 /*! 00323 \param char *str: The string which contains the degree number to extract 00324 \return the number extracted from the string given as parameter. 00325 \sa extractTime(), getTime(), getDate(), parse_degrees(char *str), gpsatol(char *str), gpsisdigit(char c) 00326 */ 00327 unsigned long parse_degrees(char *str); 00328 00329 //! It extracts a decimal number from a string, getting the integer part of a float number in case 00330 /*! 00331 \param char *str: The string which contains the decimal or float number to extract 00332 \return the number extracted from the string given as parameter. 00333 \sa extractTime(), getTime(), getDate(), parse_degrees(char *str), gpsatol(char *str), gpsisdigit(char c) 00334 */ 00335 long gpsatol(char *str); 00336 00337 //! It specifies if a char is a number 00338 /*! 00339 \param char c: The char to get if it is a number 00340 \return TRUE if a number, FALSE if not 00341 \sa extractTime(), getTime(), getDate(), parse_degrees(char *str), gpsatol(char *str), gpsisdigit(char c) 00342 */ 00343 bool gpsisdigit(char c) { return c >= '0' && c <= '9'; }; 00344 00345 //! It calculates the NMEA checkSum, leave out $, *, and the checkSum bytes 00346 /*! 00347 \param char *gpsString: the string containing the NMEA sentence to get the checksum from 00348 \return '1' if checksum is correct, '0' if not 00349 */ 00350 uint8_t checkSum(const char* gpsString); 00351 00352 //! It calculates the NMEA checkSum, leave out $, *, and the checkSum bytes 00353 /*! 00354 \param char *gpsString: the string containing the NMEA sentence to get the checksum from 00355 \return '1' if checksum is correct, '0' if not 00356 \sa setChecksum() 00357 */ 00358 uint8_t getChecksum(const char* gpsString); 00359 00360 //! It sets checksum to the end of Utils.inBuffer 00361 /*! 00362 \param void 00363 \return void 00364 \sa init() 00365 */ 00366 void setChecksum(); 00367 00368 //! It calculates checksum for a secuence given as a parameter 00369 /*! 00370 \param uint8_t* buffer: the secuence to get the checksum from 00371 \return void. It stores in 'checkSUM' variable the result 00372 \sa saveEphems() 00373 */ 00374 void getChecksum(uint8_t* buffer); 00375 00376 //! It gets if the last reading of data was valid or not 00377 /*! 00378 \param void 00379 \return 'TRUE' if valid, 'FALSE' if not 00380 */ 00381 bool dataValid(void) {return fixValid;}; 00382 00383 //! It gets a data string from the GPS 00384 /*! 00385 \param int byteAmount: the number of bytes to read from GPS 00386 \return char*. It retunrs 'Utils.inBuffer', where the data read from GPS has been parsed and stored 00387 \sa extractDate(), extractTime(), setCommMode(mode), check(), getLatitude(), getLongitude(), getAltitude(),getSpeed(), getCourse() 00388 */ 00389 char* getRaw(int); 00390 00391 00392 public: 00393 00394 //! Variable : Baudrate used to init the UART and communicate with GPS receiver 00395 /*! 00396 Possible values are 4800,9600,19200,38400,57600,115200. 00397 00398 4800 is the only value supported now by the API. 00399 00400 The reason is GPS receiver always starts at 4800bps, so it would be necessary to open UART at 4800, change speed, 00401 close UART and open it again at new speed. 00402 00403 If a higher speed wants to be used, previously explained reason has to be managed properly. 00404 */ 00405 long _baudRate; 00406 00407 //! Variable : UART used to communicate with GPS receiver 00408 /*! 00409 Possible values are: 0 or 1. 00410 00411 UART used now to communicate with GPS is UART1, so '1' must be set. 00412 */ 00413 uint8_t _uart; 00414 00415 //! Variable : Determines whether the last reading was valid or not 00416 /*! 00417 TRUE if the last reading is valid. 00418 00419 FALSE if the last reading is not valid. 00420 */ 00421 bool fixValid; 00422 00423 //! Variable : Flag used to determine if an error occurred while executing some function 00424 /*! 00425 Possible values are related below. 00426 00427 \sa ACK, GPS_TIMEOUT, GPS_ERROR_EPHEMERIS, GPS_ERROR_SAVE_EPHEMERIS, GPS_DATA_ERROR, GPS_BAD_SENTENCE, 00428 GPS_BAD_CHECKSUM, GPS_ERROR_FILE_EPHEMERIS, GPS_FILE_EPHEMERIS_EMPTY, GPS_ERROR_FILE_ALMANAC, 00429 GPS_FILE_ALMANAC_EMPTY, GPS_ERROR_SAVE_ALMANAC 00430 */ 00431 uint16_t flag; 00432 00433 //! Variable : Communication mode. Two possibilities available --> binary mode or NMEA mode. 00434 /*! 00435 Possible values are related below. 00436 00437 \sa GPS_BINARY, GPS_NMEA_GGA, GPS_NMEA_GLL, GPS_NMEA_GSA, GPS_NMEA_GSV, GPS_NMEA_RMC, GPS_NMEA_VTG, GPS_NMEA, 00438 GPS_BINARY_OFF 00439 */ 00440 uint16_t commMode; 00441 00442 //! Variable : Power mode used for GPS receiver 00443 /*! 00444 Possible values are related below. 00445 00446 \sa GPS_ON, GPS_OFF, GPS_SLEEP, GPS_HIBERNATE 00447 */ 00448 uint8_t pwrMode; 00449 00450 //! Variable : Waking up mode used for GPS receiver 00451 /*! 00452 00453 Possible values are related below. 00454 00455 \sa HOT, WARM, COLD 00456 */ 00457 uint8_t wakeMode; 00458 00459 //! Variable : Time extracted from NMEA GGA sentence received from GPS receiver 00460 /*! 00461 String that contains the time extracted from NMEA GGA sentence. 00462 00463 To store the time 13:30:00, it is stored in this way: '133000' 00464 */ 00465 char timeGPS[MAX_ARGS]; 00466 00467 //! Variable : Date extracted from NMEA RMC sentence received from GPS receiver 00468 /*! 00469 String that contains the date extracted from NMEA RMC sentence. 00470 00471 To store the date 23rd of March 1994, it is stored in this way: '230394' 00472 */ 00473 char dateGPS[MAX_ARGS]; 00474 00475 //! Variable : Clock drift of the GPS receiver used to initialize it 00476 /*! 00477 Value in Hz. Use '0' to use the last value saved, if not available 96250Hz will be used. 00478 */ 00479 char* clkOffset; 00480 00481 //! Variable : GPS Time of Week used to initialize it 00482 /*! 00483 Time of week specified in seconds. 00484 */ 00485 char* timeOfWeek; 00486 00487 //! Variable : Extended GPS Week Number used to initialize it 00488 /*! 00489 */ 00490 char* weekNo; 00491 00492 //! Variable : Channel Counter used to initialize it 00493 /*! 00494 */ 00495 char* channel; 00496 00497 //! Variable : Reset Configuration 00498 /*! 00499 */ 00500 char* resetCfg; 00501 00502 //! Variable : Default Latitude. + = North (Range 90 to -90). Expressed in degrees. Example-->37.3875111 00503 /*! 00504 */ 00505 char* coordinateLat; 00506 00507 //! Variable : Default Longitude. + = East (Range 180 to -180). Expressed in degrees. Example-->-121.97232 00508 /*! 00509 */ 00510 char* coordinateLon; 00511 00512 //! Variable : Default Altitude position. Expressed in meters. Example-->0 00513 /*! 00514 */ 00515 char* coordinateAl; 00516 00517 //! Variable : the frame checksum 00518 /*! 00519 */ 00520 uint8_t checksum; 00521 00522 //! Variable : it stores the latitude given by the GPS module 00523 /*! 00524 */ 00525 char latitude[MAX_ARGS]; 00526 00527 //! Variable : it stores the longitude given by the GPS module 00528 /*! 00529 */ 00530 char longitude[MAX_ARGS]; 00531 00532 //! Variable : it stores the speed given by the GPS module 00533 /*! 00534 */ 00535 char speed[MAX_ARGS]; 00536 00537 //! Variable : it stores the altitude given by the GPS module 00538 /*! 00539 */ 00540 char altitude[MAX_ARGS]; 00541 00542 //! Variable : it stores the course given by the GPS module 00543 /*! 00544 */ 00545 char course[MAX_ARGS]; 00546 00547 //! Variable : for rebooting the GPS module 00548 /*! 00549 */ 00550 uint8_t reboot; 00551 00552 //! Variable : for storing the frame checksum 00553 /*! 00554 */ 00555 uint8_t checkSUM[2]; 00556 00557 //! class constructor 00558 /*! 00559 It initializes the variables with the default values. 00560 \param void 00561 \return void 00562 */ 00563 WaspGPS(); 00564 00565 //! It opens UART1 and powers the GPS module 00566 /*! 00567 \param void 00568 \return void 00569 \sa close(), begin() 00570 */ 00571 void ON(); 00572 00573 //! It closes UART1 and powers off the GPS module 00574 /*! 00575 \param void 00576 \return void 00577 \sa close(), begin() 00578 */ 00579 void OFF(); 00580 00581 //! It powers up GPS module and opens UART1 to communicate with it 00582 /*! 00583 \param void 00584 \return void 00585 \sa init() 00586 */ 00587 void begin(void); 00588 00589 //! It closes UART1 00590 /*! 00591 \param void 00592 \return void 00593 */ 00594 void close(void); 00595 00596 //! It initializes GPS module with the default values 00597 /*! 00598 \param void 00599 \return void 00600 \sa init(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*) 00601 */ 00602 void init(void); 00603 00604 //! It initializes GPS module with the values introduced as parameters 00605 /*! 00606 \param const char* _coordinateLat : Latitude + = North (Range 90 to -90). Expressed in degrees. Example-->37.3875111 00607 \param const char* _coordinateLon : Longitude + = East (Range 180 to -180). Expressed in degrees. Example-->-121.97232 00608 \param const char* _coordinateAl : Altitude position. Expressed in meters. Example-->0 00609 \param const char* _clkOffset : Clock Drift of the Receiver. Expressed in Hz. Example-->96000 00610 \param const char* _timeOfWeek : GPS Time Of Week. Expressed in seconds. Example-->237759 00611 \param const char* _weekNo : Extended GPS Week Number. Example-->1946 00612 \param const char* _channel : Range 1 to 12 00613 \param const char* _resetCfg : Reset Configuration Bit 00614 \return void 00615 \sa init() 00616 */ 00617 void init(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*); 00618 00619 //! It sets the current internal Power Mode on the GPS 00620 /*! 00621 \param uint8_t mode : power mode to set the GPS. Possible values are GPS_ON, GPS_OFF 00622 \return void 00623 \sa getMode() 00624 */ 00625 void setMode(uint8_t); 00626 00627 //! It gets the current internal Power Mode on the GPS 00628 /*! 00629 \param void 00630 \return 'pwrMode' variable that contains the power mode on use 00631 \sa setMode() 00632 */ 00633 uint8_t getMode(void); 00634 00635 //! It checks if the receiver is connected to sattelites 00636 /*! 00637 \param void 00638 \return '1' if connected, '0' if not. 00639 \sa init() 00640 */ 00641 bool check(); 00642 00643 //! It gets the current time given by GPS 00644 /*! 00645 \param void 00646 \return the currect time in a string with the following structure--> "hhmmss.mmmm" 00647 \sa getDate(), extractTime(), extractDate() 00648 */ 00649 char* getTime(void); 00650 00651 //! It gets the current date given by GPS 00652 /*! 00653 \param void 00654 \return the currect date in a string with the following structure--> "ddmmyy" 00655 \sa getDate(), extractTime(), extractDate() 00656 */ 00657 char* getDate(void); 00658 00659 //! It gets the Latitude from the GPS 00660 /*! 00661 \param void 00662 \return the Latitude in a string, expressed in degrees 00663 \sa init() 00664 */ 00665 char* getLatitude(void); 00666 00667 //! It gets the Longitude from the GPS 00668 /*! 00669 \param void 00670 \return the Longitude in a string, expressed in degrees 00671 \sa init() 00672 */ 00673 char* getLongitude(void); 00674 00675 //! It gets the Speed from the GPS 00676 /*! 00677 \param void 00678 \return the Speed in a string, expressed in kilometers per hour 00679 \sa init() 00680 */ 00681 char* getSpeed(void); 00682 00683 //! It gets the Altitude from the GPS 00684 /*! 00685 \param void 00686 \return the Altitude in a string, expressed in meters 00687 \sa init() 00688 */ 00689 char* getAltitude(void); 00690 00691 //! It gets the Course from the GPS 00692 /*! 00693 \param void 00694 \return the True Track made good, expressed in degrees 00695 \sa init() 00696 */ 00697 char* getCourse(void); 00698 00699 //! It saves ephemeris into a file in the SD card. This file is called 'FILE_EPHEMERIS'. 00700 /*! 00701 \param void 00702 \return '2' when no ephemeris are returned by GPS receiver, '0' when error on writing and '1' on succesful. 00703 \sa saveEphems(const char* filemane) 00704 */ 00705 uint8_t saveEphems(); 00706 00707 //! It saves ephemeris into a file in the SD card 00708 /*! 00709 \param const char* filename : The file name to store ephemeris in 00710 \return '2' when no ephemeris are returned by GPS receiver, '0' when error on writing and '1' on succesful. 00711 \sa saveEphems() 00712 */ 00713 uint8_t saveEphems(const char* filename); 00714 00715 //! It loads ephemeris from the SD card to the GPS receiver. It loads from file called 'FILE_EPHEMERIS' 00716 /*! 00717 \param void 00718 \return '1' on success and '0' on error. 00719 \sa loadEphems(const char* filename) 00720 */ 00721 uint8_t loadEphems(); 00722 00723 //! It loads ephemeris from the SD card to the GPS receiver 00724 /*! 00725 \param const char* filename : The file name to get the ephemeris from 00726 \return '1' on success and '0' on error. 00727 \sa loadEphems() 00728 */ 00729 uint8_t loadEphems(const char* filename); 00730 00731 //! It gets the library version 00732 /*! 00733 \param void 00734 \return const char*. The GPS library version. 00735 \sa init() 00736 */ 00737 const char* getLibVersion(void) {return VERSION;}; 00738 00739 //! It sets communication mode: Binary or NMEA 00740 /*! 00741 \param uint16_t mode : the communication mode. Possible values are GPS_BINARY, GPS_NMEA_GGA, GPS_NMEA_GLL, GPS_NMEA_GSA, GPS_NMEA_GSV, GPS_NMEA_RMC, GPS_NMEA_VTG, GPS_NMEA, GPS_BINARY_OFF 00742 \return '1' on succes, '0' if not 00743 \sa getCommMode() 00744 */ 00745 uint8_t setCommMode(uint16_t); 00746 00747 //! It gets the communication mode on use 00748 /*! 00749 \param void 00750 \return 'commMode' variable that contains the communication mode on use 00751 \sa setCommMode() 00752 */ 00753 uint8_t getCommMode(void); 00754 00755 //! It gets the latitude, longitude, altitude, speed, course, time and date 00756 /*! 00757 \param void 00758 \return '1' if success, '0' if error 00759 */ 00760 uint8_t getPosition(); 00761 }; 00762 00763 extern WaspGPS GPS; 00764 00765 #endif 00766
1.5.6