Merge git://git.libdivecomputer.org/libdivecomputer into Subsurface-branch

Pull Uwatec date handling fix from Jef Driesen.

This merges with upstream libdivecomputer, where Jef fixed the overly
complicated and fragile date parsing of the Uwatec smart backend.

It used to try to guess the base epoch of the dive computer by comparing
current time on the dive computer with the current time on the
downloader, but if the time and date of either was wrong (and the date
on dive computers often is) that would get the wrong answer.

* git://git.libdivecomputer.org/libdivecomputer:
  Replace the clock calibration with a fixed epoch
This commit is contained in:
Linus Torvalds 2017-10-29 07:16:25 -07:00
commit e177b28627

View File

@ -65,6 +65,8 @@
#define GAUGE 0x00001000
#define SALINITY 0x00100000
#define EPOCH 946684800 // 2000-01-01 00:00:00 UTC
typedef enum {
PRESSURE_DEPTH,
RBT,
@ -725,7 +727,7 @@ uwatec_smart_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetime
unsigned int timestamp = array_uint32_le (abstract->data + 8);
dc_ticks_t ticks = parser->systime - (parser->devtime - timestamp) / 2;
dc_ticks_t ticks = EPOCH + timestamp / 2;
if (table->timezone != UNSUPPORTED) {
// For devices with timezone support, the UTC offset of the