Fork of ublox-cellular-base to add LARA-R2 support

Fork of ublox-cellular-base by u-blox

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;