#include <GsmGps.h>
Public Member Functions | |
MyGsmGps (MyOptions &options, MyData &data, short pinRx, short pinTx) | |
bool | begin () |
void | handleClient () |
bool | stop () |
bool | waitingForGps () |
bool | sendAT (String cmd) |
bool | getSMS (SmsData &sms) |
bool | sendSMS (String phoneNumber, String message) |
bool | deleteSMS (long index) |
Data Fields | |
MySerial | gsmSerial |
Serial interface to the sim808 modul. | |
MyGsmSim808 | gsmSim808 |
SIM808 interface class. | |
TinyGsmClient | gsmClient |
Gsm client interface. | |
MyOptions & | myOptions |
Reference to the options. | |
MyData & | myData |
Reference to the data. | |
Protected Member Functions | |
void | enableGps (bool enable) |
bool | getGps () |
bool | getGpsFromGsm () |
bool | sleepMode2 () |
Protected Attributes | |
long | lastGsmChecSec |
Check intervall for signal and battery quality. | |
long | lastGpsCheckSec |
GPS Check intervall. | |
long | startGpsCheck |
Timstamp of first getGps try. | |
SIM808 Communication class to handle gprs and gps activities.
Constructor
Definition at line 70 of file GsmGps.h.
References gsmSerial.
bool MyGsmGps::begin | ( | ) |
Initialized the sim808 modul and start optionally the gsm and/ or gps part.
Definition at line 84 of file GsmGps.h.
References MyData::cop, enableGps(), MyOptions::gprsAP, MyOptions::gprsPassword, MyOptions::gprsUser, gsmSim808, MyData::imei, MyData::isGpsActive, MyOptions::isGpsEnabled, MyData::isGsmActive, MyData::modemInfo, MyData::modemIP, myData, MyDbg(), MyDelay(), myOptions, MyOptions::powerOn, and MyData::status.
Referenced by loop().
bool MyGsmGps::deleteSMS | ( | long | index | ) |
Delete one specific sms from the sim card.
Definition at line 292 of file GsmGps.h.
References MyGsmSim808::deleteSMS(), gsmSim808, MyData::isGsmActive, myData, and MyDbg().
Referenced by MySmsCmd::checkSms().
|
protected |
Switch on the gps part of the sim808 modul.
Definition at line 304 of file GsmGps.h.
References gsmSim808, MyData::isGpsActive, MyData::isGsmActive, myData, MyDbg(), and MyData::status.
Referenced by begin(), handleClient(), and stop().
|
protected |
Read one gps position with the sim808 modul and save the values in the global data.
Definition at line 325 of file GsmGps.h.
References MyGps::altitudeString(), MyGps::courseString(), MyGps::date, MyDate::dateString(), MyLocation::distanceTo(), MyGsmSim808::getGps(), gsmSim808, MyData::isGpsActive, MyData::isGsmActive, MyData::isMoving, MyGps::kmphString(), MyData::RtcData::lastGps, MyData::lastGpsUpdateSec, MyLocation::latitude(), MyGps::latitudeString(), MyGps::location, MyGps::longitudeString(), MyOptions::minMovingDistance, MyData::movingDistance, myData, MyDbg(), myOptions, MyData::rtcData, MyGps::satellitesString(), secondsSincePowerOn(), MyGps::time, MyTime::timeString(), and MyData::waitingForGps.
Referenced by handleClient().
|
protected |
Get the Gps position from the gsm modul as fallback.
Definition at line 365 of file GsmGps.h.
References MyGps::date, MyDate::dateString(), MyLocation::distanceTo(), MyGsmSim808::getGsmGps(), gsmSim808, MyData::isGsmActive, MyData::isMoving, MyData::RtcData::lastGps, MyData::lastGpsUpdateSec, MyLocation::latitude(), MyGps::latitudeString(), MyGps::location, MyGps::longitudeString(), MyOptions::minMovingDistance, MyData::movingDistance, myData, MyDbg(), myOptions, MyData::rtcData, secondsSincePowerOn(), MyGps::time, and MyTime::timeString().
Referenced by handleClient().
bool MyGsmGps::getSMS | ( | SmsData & | sms | ) |
Read one sms if available.
Definition at line 268 of file GsmGps.h.
References MyGsmSim808::getSMS(), gsmSim808, MyData::isGsmActive, myData, and MyDbg().
Referenced by MySmsCmd::checkSms().
void MyGsmGps::handleClient | ( | ) |
Checks the gps from time to time if enabled.
Definition at line 168 of file GsmGps.h.
References MyData::batteryLevel, MyData::batteryVolt, enableGps(), getGps(), getGpsFromGsm(), MyOptions::gpsCheckIntervalSec, MyOptions::gpsTimeoutSec, gsmSim808, MyData::isGpsActive, MyData::isGsmActive, lastGpsCheckSec, MyData::RtcData::lastGpsReadSec, lastGsmChecSec, myData, MyDbg(), myOptions, MyData::rtcData, secondsElapsed(), secondsElapsedAndUpdate(), secondsSincePowerOn(), MyData::signalQuality, startGpsCheck, and MyData::waitingForGps.
Referenced by loop().
bool MyGsmGps::sendAT | ( | String | cmd | ) |
Send one AT command to the sim modul and log the result for the console window.
Definition at line 244 of file GsmGps.h.
References gsmSerial, gsmSim808, MyData::isGsmActive, myData, and MyDbg().
Referenced by loop(), and sleepMode2().
bool MyGsmGps::sendSMS | ( | String | phoneNumber, |
String | message | ||
) |
Send one sms to a specific phone number via gsm.
Definition at line 280 of file GsmGps.h.
References gsmSim808, MyData::isGsmActive, myData, and MyDbg().
Referenced by MySmsCmd::sendSms().
|
protected |
bool MyGsmGps::stop | ( | ) |
Stops the sim808 modul and go to deep sleep mode.
Definition at line 219 of file GsmGps.h.
References enableGps(), gsmSim808, MyData::isGsmActive, myData, MyDbg(), sleepMode2(), and MyData::status.
Referenced by loop().
bool MyGsmGps::waitingForGps | ( | ) |
Is the gps enabled but we don't have a valid gps position.
Definition at line 238 of file GsmGps.h.
References MyOptions::isGpsEnabled, MyData::isGsmActive, myData, myOptions, and MyData::waitingForGps.
Referenced by loop().