#include <SmsCmd.h>
Public Member Functions | |
MySmsCmd (MyGsmGps &gsmGps, MyOptions &options, MyData &data) | |
bool | begin () |
void | handleClient () |
Protected Member Functions | |
void | checkSms () |
String | getGoogleMapGpsUrl () |
void | sendSms (const String &message) |
void | sendOk (const SmsData &sms) |
bool | readValues (String &value, const String message) |
bool | readValues (long &value, const String message) |
bool | readValues (long &value, long &value2, const String message) |
void | cmdOn (const SmsData &sms) |
void | cmdOff (const SmsData &sms) |
void | cmdStatus (const SmsData &sms) |
void | cmdPsm (const SmsData &sms) |
void | cmdGps (const SmsData &sms) |
void | cmdSms (const SmsData &sms) |
void | cmdMqtt (const SmsData &sms) |
void | cmdPhone (const SmsData &sms) |
void | cmdDefault (const SmsData &sms) |
Protected Attributes | |
MyGsmGps & | myGsmGps |
Reference to the gsm/gps instance. | |
MyOptions & | myOptions |
Reference to the options. | |
MyData & | myData |
Reference to the data. | |
bool MySmsCmd::begin | ( | ) |
|
protected |
Checks for new sms and parse the commands from the message
Definition at line 102 of file SmsCmd.h.
References cmdDefault(), cmdGps(), cmdMqtt(), cmdOff(), cmdOn(), cmdPhone(), cmdPsm(), cmdSms(), cmdStatus(), MyGsmGps::deleteSMS(), MyGsmGps::getSMS(), SmsData::index, MyData::isGsmActive, SmsData::message, myData, MyDbg(), myGsmGps, and SmsData::phoneNumber.
Referenced by handleClient().
|
protected |
Default sms response if something is wrong
Definition at line 302 of file SmsCmd.h.
References sendSms().
Referenced by checkSms(), cmdGps(), cmdMqtt(), cmdPhone(), cmdPsm(), and cmdSms().
|
protected |
Command: send the gps position as an google map URL.
Definition at line 258 of file SmsCmd.h.
References cmdDefault(), getGoogleMapGpsUrl(), MyOptions::gpsCheckIntervalSec, SmsData::message, myOptions, readValues(), sendOk(), and sendSms().
Referenced by checkSms().
|
protected |
Command: Set the mqtt sending time checking time values.
Definition at line 282 of file SmsCmd.h.
References cmdDefault(), SmsData::message, MyOptions::mqttSendOnMoveEverySec, MyOptions::mqttSendOnNonMoveEverySec, myOptions, readValues(), and sendOk().
Referenced by checkSms().
|
protected |
Command: switch off the modules
Definition at line 204 of file SmsCmd.h.
References myOptions, MyOptions::powerOn, MyOptions::save(), and sendOk().
Referenced by checkSms().
|
protected |
Command: switch on the modules
Definition at line 195 of file SmsCmd.h.
References MyOptions::isGpsEnabled, myOptions, MyOptions::powerOn, MyOptions::save(), and sendOk().
Referenced by checkSms().
|
protected |
Command: Set the receiving phone number.
Definition at line 292 of file SmsCmd.h.
References cmdDefault(), SmsData::message, myOptions, MyOptions::phoneNumber, readValues(), and sendOk().
Referenced by checkSms().
|
protected |
Command: switch the power saving mode on or off.
Definition at line 237 of file SmsCmd.h.
References cmdDefault(), MyOptions::isDeepSleepEnabled, SmsData::message, MyDbg(), myOptions, readValues(), MyOptions::save(), and sendOk().
Referenced by checkSms().
|
protected |
Command: Set the sms checking time.
Definition at line 272 of file SmsCmd.h.
References cmdDefault(), SmsData::message, myOptions, readValues(), sendOk(), and MyOptions::smsCheckIntervalSec.
Referenced by checkSms().
|
protected |
Command: send status information via sms
Definition at line 212 of file SmsCmd.h.
References MyGps::altitudeString(), MyGps::fixStatus, getGoogleMapGpsUrl(), MyData::humidity, MyOptions::isGpsEnabled, MyGps::kmphString(), MyData::RtcData::lastGps, myData, myOptions, MyData::pressure, MyData::rtcData, MyGps::satellitesString(), sendSms(), MyData::status, MyData::temperature, and MyData::voltage.
Referenced by checkSms().
|
protected |
Returns the gps position as an google map url.
Definition at line 88 of file SmsCmd.h.
References MyGps::fixStatus, MyOptions::isGpsEnabled, MyData::RtcData::lastGps, MyGps::latitudeString(), MyGps::longitudeString(), myData, myOptions, and MyData::rtcData.
Referenced by cmdGps(), and cmdStatus().
void MySmsCmd::handleClient | ( | ) |
Check the sms if the time from the options is elapsed.
Definition at line 80 of file SmsCmd.h.
References checkSms(), MyData::RtcData::lastSmsCheckSec, myData, myOptions, MyData::rtcData, secondsElapsedAndUpdate(), and MyOptions::smsCheckIntervalSec.
Referenced by loop().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Helper function to send one sms
Definition at line 141 of file SmsCmd.h.
References myGsmGps, myOptions, MyOptions::phoneNumber, and MyGsmGps::sendSMS().
Referenced by cmdDefault(), cmdGps(), cmdStatus(), and sendOk().