Add support for stopping logging

This commit is contained in:
Jonathan Giles 2013-10-27 12:15:00 -04:00
parent fd40ce59d3
commit f4dba8e4b0
2 changed files with 10 additions and 2 deletions

View File

@ -299,7 +299,13 @@ boolean Adafruit_GPS::waitForSentence(char *wait4me, uint8_t max) {
boolean Adafruit_GPS::LOCUS_StartLogger(void) {
sendCommand(PMTK_LOCUS_STARTLOG);
recvdflag = false;
return waitForSentence(PMTK_LOCUS_LOGSTARTED);
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
}
boolean Adafruit_GPS::LOCUS_StopLogger(void) {
sendCommand(PMTK_LOCUS_STOPLOG);
recvdflag = false;
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
}
boolean Adafruit_GPS::LOCUS_ReadStatus(void) {

View File

@ -48,7 +48,8 @@ All text above must be included in any redistribution
// such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html
#define PMTK_LOCUS_STARTLOG "$PMTK185,0*22"
#define PMTK_LOCUS_LOGSTARTED "$PMTK001,185,3*3C"
#define PMTK_LOCUS_STOPLOG "$PMTK185,1*23"
#define PMTK_LOCUS_STARTSTOPACK "$PMTK001,185,3*3C"
#define PMTK_LOCUS_QUERY_STATUS "$PMTK183*38"
#define PMTK_LOCUS_ERASE_FLASH "$PMTK184,1*22"
#define LOCUS_OVERLAP 0
@ -117,6 +118,7 @@ class Adafruit_GPS {
boolean waitForSentence(char *wait, uint8_t max = MAXWAITSENTENCE);
boolean LOCUS_StartLogger(void);
boolean LOCUS_StopLogger(void);
boolean LOCUS_ReadStatus(void);
uint16_t LOCUS_serial, LOCUS_records;