24 #define TINY_GSM_MODEM_SIM808
25 #define TINY_GSM_DEBUG Serial
27 #include <TinyGsmClient.h>
62 : TinyGsmSim808(stream)
71 sendAT(GF(
"+CGNSINF"));
72 if (waitResponse(GF(GSM_NL
"+CGNSINF:")) != 1) {
82 gps.
setSpeed (stream.readStringUntil(
','));
83 gps.
setCourse (stream.readStringUntil(
','));
85 (stream.readStringUntil(
','));
86 gps.
setHdop (stream.readStringUntil(
','));
87 gps.
setPdop (stream.readStringUntil(
','));
88 gps.
setVdop (stream.readStringUntil(
','));
89 (stream.readStringUntil(
','));
92 stream.readStringUntil(
'\n');
106 sendAT(GF(
"+CIPGSMLOC=1,1"));
107 if (waitResponse(10000L, GF(GSM_NL
"+CIPGSMLOC:")) != 1) {
111 String locationCode = stream.readStringUntil(
',');
112 String longitude = stream.readStringUntil(
',');
113 String latitude = stream.readStringUntil(
',');
114 String gsmDate = stream.readStringUntil(
',');
115 String gsmTime = stream.readStringUntil(
',');
116 stream.readStringUntil(
'\n');
120 if (locationCode ==
"0") {
121 String dateTime = gsmDate + gsmTime;
123 dateTime.replace(
"/",
"");
124 dateTime.replace(
":",
"");
139 sendAT(GF(
"+CMGF=1"));
140 if (waitResponse() != 1) {
145 sendAT(GF(
"+CMGL=\"REC UNREAD\""));
146 int status = waitResponse(GFP(GSM_OK), GF(
"+CMGL:"));
149 sms.
index = atoi(stream.readStringUntil(
',').c_str());
150 sms.
status = stream.readStringUntil(
',');
153 sms.
dateTime = stream.readStringUntil(
'\n');
154 sms.
message = stream.readStringUntil(
'\n');
166 sendAT(GF(
"+CMGD=") + String(index));
167 if (waitResponse() != 1) {
bool setLongitude(const String &data)
bool setAltitude(const String &data)
bool setHdop(const String &data)
String dateTime
DateTime of the sms.
bool setCourse(const String &data)
String phoneNumber
Sms sender number.
bool setVdop(const String &data)
bool getGsmGps(MyGps &gps)
bool setRunStatus(const String &data)
String message
Sms content.
bool setSatellitesInView(const String &data)
bool deleteSMS(long index)
bool getSMS(SmsData &sms)
bool setDateTime(const String &data)
bool setSatellitesUsed(const String &data)
long index
Sms index on sim card.
bool setFixMode(const String &data)
String status
Sms status like read or not.
bool setSpeed(const String &data)
bool setLatitude(const String &data)
MyGsmSim808(Stream &stream)
String referenceNumber
???
bool setPdop(const String &data)
bool fixStatus
Are the gps is valid received?
bool setFixStatus(const String &data)
String Trim(const String &data, const String &chars)