Skip empty logbook entries
On certain devices, for example the Aeris Elite T3, the logbook ringbuffer can sometimes contain an empty logbook entry in between the valid entries. Because the presence of such an empty entry is currently being interpreted as having reached the last valid entry, the download is aborted. The result is that all remaining valid entries, located after the empty entry, can't be downloaded. This can be avoided by skipping the empty entry instead of aborting the download.
This commit is contained in:
parent
81bca1ff7c
commit
f05f60c4ad
@ -304,8 +304,7 @@ oceanic_common_device_logbook (dc_device_t *abstract, dc_event_progress_t *progr
|
||||
// fix this here.
|
||||
if (array_isequal (logbooks + offset, layout->rb_logbook_entry_size, 0xFF)) {
|
||||
WARNING (abstract->context, "Uninitialized logbook entries detected!");
|
||||
offset += layout->rb_logbook_entry_size;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Compare the fingerprint to identify previously downloaded entries.
|
||||
@ -364,6 +363,12 @@ oceanic_common_device_profile (dc_device_t *abstract, dc_event_progress_t *progr
|
||||
// Move to the start of the current entry.
|
||||
entry -= layout->rb_logbook_entry_size;
|
||||
|
||||
// Skip uninitialized entries.
|
||||
if (array_isequal (logbooks + entry, layout->rb_logbook_entry_size, 0xFF)) {
|
||||
WARNING (abstract->context, "Skipping uninitialized logbook entry!");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the profile pointers.
|
||||
unsigned int rb_entry_first = get_profile_first (logbooks + entry, layout, pagesize);
|
||||
unsigned int rb_entry_last = get_profile_last (logbooks + entry, layout, pagesize);
|
||||
@ -442,6 +447,12 @@ oceanic_common_device_profile (dc_device_t *abstract, dc_event_progress_t *progr
|
||||
// Move to the start of the current entry.
|
||||
entry -= layout->rb_logbook_entry_size;
|
||||
|
||||
// Skip uninitialized entries.
|
||||
if (array_isequal (logbooks + entry, layout->rb_logbook_entry_size, 0xFF)) {
|
||||
WARNING (abstract->context, "Skipping uninitialized logbook entry!");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the profile pointers.
|
||||
unsigned int rb_entry_first = get_profile_first (logbooks + entry, layout, pagesize);
|
||||
unsigned int rb_entry_last = get_profile_last (logbooks + entry, layout, pagesize);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user