Broadcast read demo.

Dependencies:   modem_ref_helper DebouncedInterrupt

Revision:
4:94bfd123f8e6
Parent:
2:4629eacf9851
Child:
5:c39a1bb57cf3
--- a/modem_callbacks.cpp	Wed May 17 14:42:28 2017 +0000
+++ b/modem_callbacks.cpp	Thu May 18 13:07:43 2017 +0000
@@ -1,12 +1,4 @@
-#include "mbed.h"
-#include "rtos.h"
-#include "WizziDebug.h"
-
-#include "alp_spec.h"
-#include "alp_helpers.h"
-#include "modem_ref.h"
-
-#include "hal_types.h"
+#include "modem_ref_helper.h"
 
 // ============================================================}}}
 
@@ -37,6 +29,25 @@
     modem_respond(0, ALP_ERR_FILE_NOT_FOUND, 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);