AT command firmware for MultiTech Dot devices.

Fork of mDot_AT_firmware by MultiTech

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CmdGpsTime.cpp Source File

CmdGpsTime.cpp

00001 #include "CmdGpsTime.h"
00002 
00003 CmdGpsTime::CmdGpsTime() :
00004 #if MTS_CMD_TERM_VERBOSE
00005     Command("GPS Time", "AT+GPSTIME", "Get the GPS Time in millisecs", "NONE")
00006 #else
00007     Command("AT+GPSTIME")
00008 #endif
00009 {
00010     _queryable = true;
00011 }
00012 
00013 uint32_t CmdGpsTime::action(const std::vector<std::string>& args) {
00014     if (args.size() == 1) {
00015         uint64_t gps_time = CommandTerminal::Dot()->getGPSTime();
00016         if (gps_time > 0) {
00017             CommandTerminal::Serial()->writef("%llu\r\n", gps_time);
00018         } else {
00019             return 1;
00020         }
00021     }
00022 
00023     return 0;
00024 }