Complete sensor demo.
Dependencies: modem_ref_helper CRC X_NUCLEO_IKS01A1 DebouncedInterrupt
Diff: main.cpp
- Revision:
- 4:27a3b9db1754
- Parent:
- 2:cbe6dca8a632
- Child:
- 6:c17f7cbdeb1a
--- 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); } }