Trond Enger / d7a_1x

Fork of d7a_1x by WizziLab

Revision:
59:b42eae56b51b
Parent:
58:38a366236bda
Child:
60:8d4133fbc060
diff -r 38a366236bda -r b42eae56b51b src/d7a.cpp
--- a/src/d7a.cpp	Mon Sep 12 16:36:09 2016 +0000
+++ b/src/d7a.cpp	Fri Sep 23 15:00:41 2016 +0000
@@ -39,7 +39,7 @@
         err = d7a_fs_open(callbacks->write_file, callbacks->read_file);
         if (err < D7A_ERR_NONE) break;
         
-        err = d7a_alp_open();
+        err = d7a_alp_open(callbacks->unsolicited_msg);
         if (err < D7A_ERR_NONE) break;
         
         err = d7a_modem_open(reset_pin, callbacks->notif_done);
@@ -239,12 +239,7 @@
     int i = 0;
     while (msg[i] != NULL)
     {
-        if (msg[i]->data_len)
-        {
-            FREE(msg[i]->data);
-        }
-        
-        FREE(msg[i]);
+        d7a_alp_free_msg(msg[i]);
         i++;
     }
     
@@ -261,12 +256,12 @@
     
     msg = d7a_read(0, 0, 8);
     ASSERT(msg[0]->err >= D7A_ERR_NONE, "Failed to read UID file\r\n");
-    memcpy(uid, msg[0]->data, 8);
+    memcpy(uid, msg[0]->data->buf, 8);
     d7a_free_msg(msg);
     
     msg = d7a_read(2, 0, sizeof(d7a_revision_t));
     ASSERT(msg[0]->err >= D7A_ERR_NONE, "Failed to read UID file\r\n");
-    memcpy(&rev, msg[0]->data, sizeof(d7a_revision_t));
+    memcpy(&rev, msg[0]->data->buf, sizeof(d7a_revision_t));
     d7a_free_msg(msg);
     
     PRINT("------------ D7A Modem infos ------------\r\n");