LoRaWAN demo.
Dependencies: modem_ref_helper DebouncedInterrupt
Diff: modem_callbacks.cpp
- Revision:
- 15:86f6fa566d89
- Parent:
- 7:026f8c8bcdab
- Child:
- 16:59d93cb1efee
--- a/modem_callbacks.cpp Thu Oct 11 14:39:37 2018 +0000 +++ b/modem_callbacks.cpp Mon Nov 26 16:43:43 2018 +0000 @@ -1,6 +1,5 @@ #include "modem_ref_helper.h" -extern Queue<void, 8> g_file_modified; // ============================================================}}} @@ -16,7 +15,7 @@ } else { - modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id); + modem_respond(ALP_ERR_FILE_NOT_FOUND, id); } } @@ -24,12 +23,14 @@ { if (!ram_fs_write(fid, offset, length, (uint8_t*)data)) { - modem_respond(0, ALP_ERR_NONE, id); + extern Queue<void, 8> g_file_modified; + + modem_respond(ALP_ERR_NONE, id); g_file_modified.put((void*)fid); } else { - modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id); + modem_respond(ALP_ERR_FILE_NOT_FOUND, id); } } @@ -43,19 +44,19 @@ } else { - modem_respond(0, ALP_ERR_FILE_NOT_FOUND, id); + modem_respond(ALP_ERR_FILE_NOT_FOUND, id); } } void my_flush(u8 fid, int id) { // No flush in this file system - modem_respond(0, ALP_ERR_NONE, id); + modem_respond(ALP_ERR_NONE, id); } void my_delete(u8 fid, int id) { - modem_respond(0, (ram_fs_delete(fid))? ALP_ERR_FILE_NOT_FOUND : ALP_ERR_NONE, id); + modem_respond((ram_fs_delete(fid))? ALP_ERR_FILE_NOT_FOUND : ALP_ERR_NONE, id); } void my_udata(void *data, u32 length) @@ -153,4 +154,15 @@ /* Resume reports */ } +} + +void my_itf_busy(u8 ifid, u32 seconds) +{ + //PRINT("ITF[%d] Busy for %d seconds.\r\n", ifid, seconds); + + extern Semaphore modem_urc; + extern uint32_t itf_busy; + + itf_busy = seconds; + modem_urc.release(); } \ No newline at end of file