Ping pong app demo.

Dependencies:   modem_ref_helper DebouncedInterrupt

Committer:
Jeej
Date:
Thu May 18 13:09:03 2017 +0000
Revision:
2:785b422c7d22
Parent:
0:fa3fd69f8148
Child:
3:0979d8cba5ec
Factorized libraries.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jeej 2:785b422c7d22 1 #include "modem_ref_helper.h"
Jeej 0:fa3fd69f8148 2
Jeej 0:fa3fd69f8148 3
Jeej 0:fa3fd69f8148 4 // ============================================================}}}
Jeej 0:fa3fd69f8148 5
Jeej 0:fa3fd69f8148 6 // Callbacks to MODEM's ALP requests
Jeej 0:fa3fd69f8148 7 // ============================================================{{{
Jeej 0:fa3fd69f8148 8 void my_read(u8 fid, u32 offset, u32 length, int id)
Jeej 0:fa3fd69f8148 9 {
Jeej 0:fa3fd69f8148 10 modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id);
Jeej 0:fa3fd69f8148 11 }
Jeej 0:fa3fd69f8148 12
Jeej 0:fa3fd69f8148 13 void my_write(u8 fid, void *data, u32 offset, u32 length, int id)
Jeej 0:fa3fd69f8148 14 {
Jeej 0:fa3fd69f8148 15 modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id);
Jeej 0:fa3fd69f8148 16 }
Jeej 0:fa3fd69f8148 17
Jeej 0:fa3fd69f8148 18 void my_read_fprop(u8 fid, int id)
Jeej 0:fa3fd69f8148 19 {
Jeej 0:fa3fd69f8148 20 modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id);
Jeej 0:fa3fd69f8148 21 }
Jeej 0:fa3fd69f8148 22
Jeej 0:fa3fd69f8148 23 void my_flush(u8 fid, int id)
Jeej 0:fa3fd69f8148 24 {
Jeej 0:fa3fd69f8148 25 modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id);
Jeej 0:fa3fd69f8148 26 }
Jeej 0:fa3fd69f8148 27
Jeej 0:fa3fd69f8148 28 void my_delete(u8 fid, int id)
Jeej 0:fa3fd69f8148 29 {
Jeej 0:fa3fd69f8148 30 modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id);
Jeej 0:fa3fd69f8148 31 }
Jeej 0:fa3fd69f8148 32
Jeej 0:fa3fd69f8148 33 void my_lqual(u8 ifid, int per)
Jeej 0:fa3fd69f8148 34 {
Jeej 0:fa3fd69f8148 35 PRINT("Interface File [%3d] LQUAL : %d%% PER\r\n", ifid, per);
Jeej 0:fa3fd69f8148 36 }
Jeej 0:fa3fd69f8148 37
Jeej 0:fa3fd69f8148 38 void my_ldown(u8 ifid)
Jeej 0:fa3fd69f8148 39 {
Jeej 0:fa3fd69f8148 40 PRINT("Interface File [%3d] LDOWN\r\n", ifid);
Jeej 0:fa3fd69f8148 41 }
Jeej 0:fa3fd69f8148 42
Jeej 0:fa3fd69f8148 43 void my_reset(void)
Jeej 0:fa3fd69f8148 44 {
Jeej 0:fa3fd69f8148 45 NVIC_SystemReset();
Jeej 0:fa3fd69f8148 46 }
Jeej 0:fa3fd69f8148 47
Jeej 0:fa3fd69f8148 48 void my_boot(u8 cause, u16 number)
Jeej 0:fa3fd69f8148 49 {
Jeej 0:fa3fd69f8148 50 PRINT("Modem BOOT[%c] #%d\r\nRe-Init\r\n", cause, number);
Jeej 0:fa3fd69f8148 51
Jeej 0:fa3fd69f8148 52 // Modem re-booted, restart APP
Jeej 0:fa3fd69f8148 53 //my_reset();
Jeej 0:fa3fd69f8148 54 }