9 #ifndef TinyGsmClientSIM808_h
10 #define TinyGsmClientSIM808_h
12 #include "TinyGsmClientSIM800.h"
32 sendAT(GF(
"+CGNSPWR=1"));
33 if (waitResponse() != 1) {
44 sendAT(GF(
"+CGNSPWR=0"));
45 if (waitResponse() != 1) {
56 sendAT(GF(
"+CGNSINF"));
57 if (waitResponse(GF(GSM_NL
"+CGNSINF:")) != 1) {
60 String res = stream.readStringUntil(
'\n');
68 bool getGPS(
float *lat,
float *lon,
float *speed=0,
int *alt=0,
int *vsat=0,
int *usat=0)
74 sendAT(GF(
"+CGNSINF"));
75 if (waitResponse(GF(GSM_NL
"+CGNSINF:")) != 1) {
79 stream.readStringUntil(
',');
80 if ( stream.readStringUntil(
',').toInt() == 1 ) {
83 stream.readStringUntil(
',');
84 *lat = stream.readStringUntil(
',').toFloat();
85 *lon = stream.readStringUntil(
',').toFloat();
87 *alt = stream.readStringUntil(
',').toFloat();
90 *speed = stream.readStringUntil(
',').toFloat();
92 stream.readStringUntil(
',');
93 stream.readStringUntil(
',');
94 stream.readStringUntil(
',');
95 stream.readStringUntil(
',');
96 stream.readStringUntil(
',');
97 stream.readStringUntil(
',');
98 stream.readStringUntil(
',');
100 *vsat = stream.readStringUntil(
',').toInt();
103 *usat = stream.readStringUntil(
',').toInt();
105 stream.readStringUntil(
'\n');
114 bool getGPSTime(
int *year,
int *month,
int *day,
int *hour,
int *minute,
int *second)
118 sendAT(GF(
"+CGNSINF"));
119 if (waitResponse(GF(GSM_NL
"+CGNSINF:")) != 1) {
123 for (
int i = 0; i < 3; i++) {
124 String buffer = stream.readStringUntil(
',');
125 buffer.toCharArray(chr_buffer,
sizeof(chr_buffer));
132 if ( buffer.toInt() == 1 ) {
133 fix = buffer.toInt();
137 *year = buffer.substring(0,4).toInt();
138 *month = buffer.substring(4,6).toInt();
139 *day = buffer.substring(6,8).toInt();
140 *hour = buffer.substring(8,10).toInt();
141 *minute = buffer.substring(10,12).toInt();
142 *second = buffer.substring(12,14).toInt();
151 String res = stream.readStringUntil(
'\n');