Broadcast read demo.

Dependencies:   modem_ref_helper DebouncedInterrupt

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers modem_callbacks.cpp Source File

modem_callbacks.cpp

00001 #include "modem_d7a.h"
00002 
00003 // ============================================================}}}
00004 
00005 // Callbacks to MODEM's ALP requests
00006 // ============================================================{{{
00007 void my_read(u8 action, u8 fid, u32 offset, u32 length, int id)
00008 {
00009     modem_ref_respond(action, ALP_ERR_FILE_NOT_FOUND, id);
00010 }
00011 
00012 void my_write(u8 action, u8 fid, void *data, u32 offset, u32 length, int id)
00013 {
00014     modem_ref_respond(action, ALP_ERR_FILE_NOT_FOUND, id);
00015 }
00016 
00017 void my_read_fprop(u8 action, u8 fid, int id)
00018 {
00019     modem_ref_respond(action, ALP_ERR_FILE_NOT_FOUND, id);
00020 }
00021 
00022 void my_flush(u8 action, u8 fid, int id)
00023 {
00024     modem_ref_respond(action, ALP_ERR_FILE_NOT_FOUND, id);
00025 }
00026 
00027 void my_delete(u8 action, u8 fid, int id)
00028 {
00029     modem_ref_respond(action, ALP_ERR_FILE_NOT_FOUND, id);
00030 }
00031 
00032 void my_udata(alp_payload_t* alp)
00033 {    
00034     alp_payload_print(alp);
00035 }
00036 
00037 void my_lqual(u8 ifid, int per)
00038 {
00039     PRINT("Interface File [%3d] LQUAL : %d%% PER\r\n", ifid, per);
00040 }
00041 
00042 void my_ldown(u8 ifid)
00043 {
00044     PRINT("Interface File [%3d] LDOWN\r\n", ifid);
00045 }
00046 
00047 void my_reset(void)
00048 {
00049     PRINT("Restarting application...\r\n");
00050     FLUSH();
00051     NVIC_SystemReset();
00052 }
00053 
00054 void my_boot(u8 cause, u16 number)
00055 {
00056     PRINT("Modem BOOT[%c] #%d\r\n", cause, number);
00057     
00058     // Modem re-booted, restart APP
00059     my_reset();
00060 }
00061 
00062 void my_busy(u8 busy)
00063 {
00064     if (busy)
00065     {
00066         PRINT("Modem Busy\r\n");
00067         
00068         /* Stop report, do not use modem */
00069         /* Wait for modem reboot or modem not busy */
00070     }
00071     else
00072     {
00073         PRINT("Modem not Busy\r\n");
00074         
00075         /* Resume reports */
00076     }
00077 }