Skip to content

Commit 249d664

Browse files
modules: fota: remove FOTA_STATUS_CHAN
FOTA_STATUS_CHAN is an old relic, not needed anymore. Signed-off-by: Giacomo Dematteis <giacomo.dematteis@nordicsemi.no>
1 parent cb1cada commit 249d664

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

app/src/common/message_channel.c

-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ ZBUS_CHAN_DEFINE(TRIGGER_CHAN,
1818
ZBUS_MSG_INIT(0)
1919
);
2020

21-
ZBUS_CHAN_DEFINE(FOTA_STATUS_CHAN,
22-
enum fota_status,
23-
NULL,
24-
NULL,
25-
ZBUS_OBSERVERS_EMPTY,
26-
ZBUS_MSG_INIT(0)
27-
);
28-
2921
ZBUS_CHAN_DEFINE(NETWORK_CHAN,
3022
struct network_msg,
3123
NULL,

app/src/common/message_channel.h

-21
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,6 @@ enum error_type {
201201
ERROR_IRRECOVERABLE,
202202
};
203203

204-
/** @brief Status sent from the FOTA module on the FOTA_STATUS_CHAN channel. */
205-
enum fota_status {
206-
/* No FOTA job is ongoing */
207-
FOTA_STATUS_IDLE = 0x1,
208-
209-
/* FOTA started. */
210-
FOTA_STATUS_START,
211-
212-
/* FOTA stopped. */
213-
FOTA_STATUS_STOP,
214-
215-
/* A firmware image has been downloaded and a reboot is required to apply it.
216-
* The FOTA module will perform the reboot CONFIG_APP_FOTA_REBOOT_DELAY_SECONDS seconds
217-
* after this status is sent.
218-
*/
219-
FOTA_STATUS_REBOOT_PENDING,
220-
};
221-
222-
#define MSG_TO_FOTA_STATUS(_msg) (*(const enum fota_status *)_msg)
223-
224204
struct configuration {
225205
/* LED */
226206
int led_red;
@@ -244,7 +224,6 @@ struct configuration {
244224
ZBUS_CHAN_DECLARE(
245225
CONFIG_CHAN,
246226
ERROR_CHAN,
247-
FOTA_STATUS_CHAN,
248227
LED_CHAN,
249228
NETWORK_CHAN,
250229
TIME_CHAN,

app/src/modules/fota/fota.c

-30
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,8 @@ static void state_reboot_pending_entry(void *o)
236236
ARG_UNUSED(o);
237237

238238
int err;
239-
enum fota_status fota_status = FOTA_STATUS_REBOOT_PENDING;
240239
struct nrf_cloud_settings_fota_job job = { .validate = NRF_CLOUD_FOTA_VALIDATE_NONE };
241240

242-
/* Notify the rest of the system that a reboot is pending */
243-
err = zbus_chan_pub(&FOTA_STATUS_CHAN, &fota_status, K_SECONDS(1));
244-
if (err) {
245-
LOG_ERR("zbus_chan_pub, error: %d", err);
246-
SEND_FATAL_ERROR();
247-
}
248-
249241
/* Check if validation of full modem FOTA failed, if so, try again...
250242
* This is a workaround due to modem shutdown -> reinitialization in bootloader mode fails
251243
* quite frequently. (Needed to apply the full modem image)
@@ -322,20 +314,6 @@ static void fota_reboot(enum nrf_cloud_fota_reboot_status status)
322314
*/
323315
}
324316

325-
static void status_events_notify(enum fota_status status)
326-
{
327-
int err;
328-
329-
enum fota_status fota_status = status;
330-
331-
err = zbus_chan_pub(&FOTA_STATUS_CHAN, &fota_status, K_SECONDS(1));
332-
if (err) {
333-
LOG_ERR("zbus_chan_pub, error: %d", err);
334-
SEND_FATAL_ERROR();
335-
return;
336-
}
337-
}
338-
339317
static void fota_status(enum nrf_cloud_fota_status status, const char *const status_details)
340318
{
341319
int err;
@@ -351,23 +329,15 @@ static void fota_status(enum nrf_cloud_fota_status status, const char *const sta
351329
switch (status) {
352330
case NRF_CLOUD_FOTA_DOWNLOADING:
353331
LOG_DBG("Downloading firmware update");
354-
355-
status_events_notify(FOTA_STATUS_START);
356332
return;
357333
case NRF_CLOUD_FOTA_FAILED:
358334
LOG_ERR("Firmware download failed");
359-
360-
status_events_notify(FOTA_STATUS_STOP);
361335
break;
362336
case NRF_CLOUD_FOTA_TIMED_OUT:
363337
LOG_ERR("Firmware download timed out");
364-
365-
status_events_notify(FOTA_STATUS_STOP);
366338
break;
367339
case NRF_CLOUD_FOTA_SUCCEEDED:
368340
LOG_DBG("Firmware update succeeded");
369-
370-
status_events_notify(FOTA_STATUS_STOP);
371341
return;
372342
default:
373343
LOG_ERR("Unknown FOTA status: %d", status);

0 commit comments

Comments
 (0)