}
if (total_progress == ctx->total_size)
- fprintf(stdout, "\nDownload Finished\n");
+ fprintf(stdout, "\nDownload Finished (%s)\n", e->is_update_ab ? "AB" : "A");
+
fflush(stdout);
}
}
if (total_progress == ctx->total_size)
- fprintf(stdout, "\nDownload Finished\n");
+ fprintf(stdout, "\nDownload Finished (%s)\n", e->is_update_ab ? "AB" : "A");
}
static void *dfu_thread_main(void *ptr)
char *entry_name = ctx->dfu_entry_list[i][DFU_INFO_NAME];
char *entry_ab = ctx->dfu_entry_list[i][DFU_INFO_AB];
- if (entry_ab && strncmp(entry_ab, DFU_INFO_PART_B, strlen(entry_ab)) == 0) {
+ if (entry_ab && strncmp(entry_ab, DFU_INFO_PART_B, strlen(DFU_INFO_PART_B)) == 0) {
if (entry_name && !strncmp(entry_name, name, strlen(entry_name))) {
char **entry = ctx->dfu_entry_list[i];
switch (*entry[DFU_INFO_MODE]) {
/* Check if there is the slot B */
e->fd_b = find_slot_b(e->ctx, entry[DFU_INFO_NAME]);
+
+ if (e->fd_b > 0)
+ e->is_update_ab = 1;
+ else
+ e->is_update_ab = 0;
err:
free(file);
void *buffer; /* receive buffer for flashing */
unsigned long buf_len; /* filled size of buffer */
int transfer_done;
+ int is_update_ab; /* If update the image about A/B slot, it should be 1 */
};
void *dfu_get_buffer(struct dfu_entry *e, unsigned long size);