Complete sensor demo.

Dependencies:   modem_ref_helper CRC X_NUCLEO_IKS01A1 DebouncedInterrupt

Revision:
1:4d3968b2941b
Parent:
0:87c57e1b1e1c
Child:
6:c17f7cbdeb1a
--- a/modem_callbacks.cpp	Mon May 15 16:00:25 2017 +0000
+++ b/modem_callbacks.cpp	Thu May 18 10:44:26 2017 +0000
@@ -1,13 +1,4 @@
-#include "mbed.h"
-#include "rtos.h"
-#include "WizziDebug.h"
-
-#include "alp_spec.h"
-#include "alp_helpers.h"
-#include "modem_ref.h"
-
-#include "ram_fs.h"
-#include "hal_types.h"
+#include "modem_ref_helper.h"
 
 extern Queue<void, 8>   g_file_modified;
 
@@ -67,6 +58,25 @@
     modem_respond(0, err, id);
 }
 
+void my_udata(u8 fid,void *data,u32 offset,u32 length, u8 i_type, u8 i_length, u8* i_data)
+{
+    (void)data;
+    (void)i_length;
+    PRINT("Got UNS File[%3d]@%d %d Bytes\n",fid,offset,length);
+    if (i_type == ALP_ITF_TYPE_D7A)
+    {
+        static union {
+            u8      b[8];
+            u32     w[2];
+        } uid;
+        d7a_sp_res_t* istat = (d7a_sp_res_t*) i_data;
+        memcpy(uid.b,istat->addressee.id,8);
+        PRINT("From UID: %08X%08X (rxlev:%d lb:%d)\n",
+                HAL_U32_BYTE_SWAP(uid.w[0]), HAL_U32_BYTE_SWAP(uid.w[1]),
+                istat->rxlev, istat->lb);
+    }
+}
+
 void my_lqual(u8 ifid, int per)
 {
     PRINT("Interface File [%3d] LQUAL : %d%% PER\r\n", ifid, per);