Helper library to use modem_ref driver.
Dependencies: WizziCom WizziDebug ram_fs modem_ref
Dependents: D7A_Localisation D7A_1x_demo_send_file_data_and_forget D7A_1x_demo_CodeUpgradeProtocol D7A_1x_demo_LoRaWAN ... more
Diff: modem_d7a.cpp
- Revision:
- 72:15bf99fcfed9
- Parent:
- 71:b5c584f706ee
- Child:
- 75:dad2f09cb870
diff -r b5c584f706ee -r 15bf99fcfed9 modem_d7a.cpp --- a/modem_d7a.cpp Wed Feb 17 11:11:09 2021 +0000 +++ b/modem_d7a.cpp Fri Feb 19 11:00:11 2021 +0000 @@ -151,6 +151,7 @@ if (!boot.try_acquire_for(1000)) { +#if 0 // Modem not responding! PRINT("Trying power cycle.\n"); @@ -161,18 +162,19 @@ // Release reset pin DigitalIn power_release(D12); - if (!boot.try_acquire_for(1000)) + if (boot.try_acquire_for(1000)) + { + g_pwc_nb++; + PRINT("Modem is up after power cycle.\n"); + } + else +#endif { // Modem not responding! g_fail_nb++; PRINT("Failed to open modem.\n"); return -1; } - else - { - g_pwc_nb++; - PRINT("Modem is up after power cycle.\n"); - } } else { @@ -445,6 +447,23 @@ return err; } +int modem_notify_file(uint8_t fid, uint32_t offset, uint32_t length) +{ + int err = ALP_ERR_UNKNOWN; + alp_payload_t* alp = NULL; + alp_payload_t* alp_rsp = NULL; + + alp = alp_payload_f_touch(NULL, fid, offset, length, false); + + _modem_d7a_send(NULL, alp, &alp_rsp, MODEM_TIMEOUT); + + err = alp_payload_get_err(alp_rsp); + + alp_payload_free(alp_rsp); + + return err; +} + static int _modem_d7a_itf_enable(u8 enable) { int err = ALP_ERR_UNKNOWN;