24 #define TINY_GSM_YIELD() { MyDelay(1); }
63 bool sendSMS(String phoneNumber, String message);
71 : gsmSerial(data.logInfos, options.isDebugActive, pinRx, pinTx)
72 , gsmSim808(gsmSerial)
73 , gsmClient(gsmSim808)
87 MyDbg(F(
"sim808 has no power!"));
92 MyDbg(F(
"MyGsmGps::begin"));
95 for (
int i = 0; !
gsmSim808.restart() && i <= 5; i++) {
97 MyDbg(F(
"Sim808 Initializing ... canceled"));
105 MyDbg(F(
"."),
false,
false);
115 for (
int i = 0; !
gsmSim808.waitForNetwork() && i <= 5; i++) {
117 MyDbg(F(
"Sim808 Waiting for network... canceled"));
125 MyDbg(F(
"."),
false,
false);
204 MyDbg(F(
" -> gps timeout!"));
223 MyDbg(F(
"gprs gps stopping"));
230 MyDbg(F(
"gprs gps stopped"));
247 MyDbg(F(
"sim808 not active!"));
263 MyDbg(F(
"Entering gsm sleep mode 2"));
264 return sendAT(GF(
"+CSCLK=2"));
271 MyDbg(F(
"gsm not active!"));
283 MyDbg(F(
"gsm not active!"));
287 MyDbg((String) F(
"sendSMS: ") + message);
288 return gsmSim808.sendSMS(phoneNumber, message);
295 MyDbg(F(
"gsm not active!"));
299 MyDbg((String) F(
"deleteSMS: ") + String(index));
307 MyDbg(F(
"sim808 gsm not active!"));
328 MyDbg(F(
"sim808 gsm not active!"));
358 MyDbg(F(
" -> GPS timeout!"));
368 MyDbg(F(
"sim808 gsm not active!"));
375 MyDbg(F(
"getGsmGps"));
391 MyDbg(F(
" -> GsmGPS timeout!"));
bool isGpsEnabled
Is the gps part of the sim808 active?
long lastGpsCheckSec
GPS Check intervall.
long lastGsmChecSec
Check intervall for signal and battery quality.
TinyGsmClient gsmClient
Gsm client interface.
String status
Status information.
class MyData::RtcData rtcData
Data to store in the RTC memory.
MyOptions myOptions
The global options.
long gpsCheckIntervalSec
Time interval to check the gps position.
bool getGsmGps(MyGps &gps)
void enableGps(bool enable)
bool waitingForGps
We are trying to get a location.
void MyDbg(String info, bool fromWebServer=false, bool newline=true)
MyOptions & myOptions
Reference to the options.
String imei
IMEI of the sim card.
bool powerOn
Is the GSM power from the DC-DC modul switched on?
long gpsTimeoutSec
Timeout for waiting for gps position.
bool sendSMS(String phoneNumber, String message)
MyGps lastGps
Last known gps location without timeout.
bool isGpsActive
Is the gs part of the sim808 activated?
String satellitesString()
void MyDelay(long millisDelay)
bool deleteSMS(long index)
bool deleteSMS(long index)
String signalQuality
Quality of the signal.
bool getSMS(SmsData &sms)
String gprsUser
GRPS access point User.
String batteryVolt
Battery volt of the sim808 module.
double distanceTo(MyLocation &location)
MyLocation location
The gps position.
String cop
Operator selection.
long secondsSincePowerOn()
bool isMoving
Is moving recognized.
String gprsPassword
GRPS access point Password.
String batteryLevel
Battery level of the sim808 module.
MyDate date
The received gps utc date.
long startGpsCheck
Timstamp of first getGps try.
String modemInfo
Information from SIM808.
String modemIP
registered modem ip
String gprsAP
GRPS access point of the sim card supplier.
MyData & myData
Reference to the data.
MyGsmSim808 gsmSim808
SIM808 interface class.
bool isGsmActive
Is the sim808 modul connected to a gsm network?
MyTime time
The received gps utc time.
long lastGpsUpdateSec
Elapsed Time of last read.
bool secondsElapsed(long &lastCheckSec, const long &intervalSec)
MyData myData
The global collected data.
bool secondsElapsedAndUpdate(long &lastCheckSec, const long &intervalSec)
MyGsmGps(MyOptions &options, MyData &data, short pinRx, short pinTx)
long lastGpsReadSec
Timestamp of the last gps read.
bool getSMS(SmsData &sms)
MySerial gsmSerial
Serial interface to the sim808 modul.
double movingDistance
Minimum distance for moving flag.
long minMovingDistance
Minimum distance to accept as moving or not.