Complete sensor demo.

Dependencies:   DebouncedInterrupt X_NUCLEO_IKS01A1 modem_ref_helper

Files at this revision

API Documentation at this revision

Comitter:
Jeej
Date:
Wed Sep 13 12:58:43 2017 +0000
Parent:
3:79c4d10cefe0
Child:
5:e27f8429166a
Commit message:
Print user ID

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
modem_ref_helper.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jun 07 16:26:47 2017 +0000
+++ b/main.cpp	Wed Sep 13 12:58:43 2017 +0000
@@ -65,34 +65,34 @@
     button_user.release();
 }
 
-void print_status(int status)
+void print_status(int status, uint8_t id)
 {
     switch (status)
     {
         case ALP_ERR_NONE:
-            PRINT("Status: OK\n");
+            PRINT("Status[%d]: OK\n", id);
             break;
         case ALP_ERR_FILE_EXIST:
-            PRINT("Status: Already registered\n");
+            PRINT("Status[%d]: Already registered\n", id);
             break;
         default:
-            PRINT("Status: error %d\n", status);
+            PRINT("Status[%d]: error %d\n", id, status);
             break;
     }
 }
 
-void print_resp(int status)
+void print_resp(int status, uint8_t id)
 {
     switch (status)
     {
         case ALP_ERR_NONE:
-            PRINT("Resp: OK\n");
+            PRINT("Resp[%d]: OK\n", id);
             break;
         case ALP_ERR_FILE_EXIST:
-            PRINT("Resp: Already registered\n");
+            PRINT("Resp[%d]: Already registered\n", id);
             break;
         default:
-            PRINT("Resp: error %d\n", status);
+            PRINT("Resp[%d]: error %d\n", id, status);
             break;
     }
 }
@@ -110,17 +110,17 @@
     .boot       = my_boot
 };
 
-// Callback for main_id User
+// Callback for Users
 void my_main_callback(uint8_t terminal, int8_t err, uint8_t id)
 {    
     if (terminal)
-    {    
-        print_status(err);
+    {
+        print_status(err, id);
         modem_ready[id].release();
     }
     else
     {
-        print_resp(err);
+        print_resp(err, id);
     }
 }
 
--- a/modem_ref_helper.lib	Wed Jun 07 16:26:47 2017 +0000
+++ b/modem_ref_helper.lib	Wed Sep 13 12:58:43 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/WizziLab/code/modem_ref_helper/#54392adb3ed5
+https://developer.mbed.org/teams/WizziLab/code/modem_ref_helper/#95ba5519a9f7