Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: UbloxCellularBase.cpp
- Revision:
- 11:57f64bc518c0
- Parent:
- 10:c4281fa79b8f
- Child:
- 12:aa3cbc3f88c5
--- a/UbloxCellularBase.cpp Tue Jan 02 05:45:24 2018 +0000
+++ b/UbloxCellularBase.cpp Tue Jan 02 12:38:56 2018 +0500
@@ -209,6 +209,32 @@
return success;
}
+/** Get the IMEI.
+ *
+ * @return true if successful, otherwise false.
+ */
+bool UbloxCellularBase::get_imei(char *imei_to_send,int size)
+{
+ bool success;
+ LOCK();
+
+ MBED_ASSERT(_at != NULL);
+
+ // International mobile equipment identifier
+ // AT Command Manual UBX-13002752, section 4.7
+ success = _at->send("AT+CGSN") && _at->recv("%15[^\n]\nOK\n", _dev_info.imei);
+ tr_info("DevInfo: IMEI=%s", _dev_info.imei);
+
+ if(success)
+ {
+ memcpy(imei_to_send,_dev_info.imei,size);
+ imei_to_send[size-1] = '\0';
+ }
+
+ UNLOCK();
+ return success;
+}
+
bool UbloxCellularBase::get_meid()
{
bool success;