Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/TinyGsmClientSIM70xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ class TinyGsmSim70xx : public TinyGsmModem<SIM70xxType>,
return res;
}

// Gets the IMEI of the modem with AT+CGSN
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(AT_NL)) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}

/*
* GPS/GNSS/GLONASS location functions
*/
Expand Down
10 changes: 10 additions & 0 deletions src/TinyGsmClientSIM7600.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,16 @@ class TinyGsmSim7600 : public TinyGsmModem<TinyGsmSim7600>,
return res;
}

// Gets the IMEI of the modem with AT+CGSN
String getIMEIImpl() {
sendAT(GF("+CGSN"));
if (waitResponse(GF(AT_NL)) != 1) { return ""; }
String res = stream.readStringUntil('\n');
waitResponse();
res.trim();
return res;
}

/*
* Phone Call functions
*/
Expand Down