Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'fix_defines' into 'master'
Fix building rotation vector adaptors with old Android versions

See merge request mer-core/sensorfw!55
  • Loading branch information
mlehtima committed Sep 9, 2020
2 parents e65aa54 + 47a6b6f commit 08e5f42
Show file tree
Hide file tree
Showing 67 changed files with 97 additions and 187 deletions.
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisaccelerometer/hybrisaccelerometeradaptor.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisalsadaptor/hybrisalsadaptor.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisalsadaptor/hybrisalsadaptor.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisalsadaptor/hybrisalsadaptorplugin.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisalsadaptor/hybrisalsadaptorplugin.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2020 Rinigus
**
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisgyroscopeadaptor/hybrisgyroscopeadaptor.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
2 changes: 0 additions & 2 deletions adaptors/hybrispressureadaptor/hybrispressureadaptor.cpp
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
Expand Down
2 changes: 0 additions & 2 deletions adaptors/hybrispressureadaptor/hybrispressureadaptor.h
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
Expand Down
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
Expand Down
2 changes: 0 additions & 2 deletions adaptors/hybrispressureadaptor/hybrispressureadaptorplugin.h
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2017 Matti Lehtimäki
** Contact: matti.lehtimaki@gmail.com
**
** $QT_BEGIN_LICENSE:LGPL$
**
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisproximityadaptor/hybrisproximityadaptor.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisproximityadaptor/hybrisproximityadaptor.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisrotationadaptor/hybrisrotationadaptor.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2020 Rinigus
**
Expand Down
1 change: 0 additions & 1 deletion adaptors/hybrisrotationadaptor/hybrisrotationadaptor.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
15 changes: 6 additions & 9 deletions adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.cpp
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand All @@ -26,12 +24,8 @@
#include "datatypes/utils.h"
#include "config.h"

#ifndef SENSOR_TYPE_STEP_COUNTER
#define SENSOR_TYPE_STEP_COUNTER (19)
/* If hardware/sensors.h does not define SENSOR_TYPE_STEP_COUNTER, assume
* a) the event structure is missing u64 union too, and b) u64.step_counter
* would be located at the same address as non-u64 data array. */
#define NO_SENSORS_EVENT_U64
#ifndef USE_BINDER
#include <android-version.h>
#endif

HybrisStepCounterAdaptor::HybrisStepCounterAdaptor(const QString& id) :
Expand Down Expand Up @@ -83,7 +77,10 @@ void HybrisStepCounterAdaptor::processSample(const sensors_event_t& data)
#ifdef USE_BINDER
d->value_ = data.u.stepCount;
#else
#ifdef NO_SENSORS_EVENT_U64
#if ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR < 4
/* In Android versions 4.3 and older hardware/sensors.h does not
* contain u64 union and values are located at the same
* address as non-u64 data array. */
uint64_t value = 0;
memcpy(&value, data.data, sizeof value);
d->value_ = value;
Expand Down
2 changes: 0 additions & 2 deletions adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.h
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
@@ -1,10 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
**
** Copyright (C) 2016 kimmoli
** Contact: kimmo.lindholm@eke.fi
**
**
** $QT_BEGIN_LICENSE:LGPL$
Expand Down
1 change: 0 additions & 1 deletion chains/compasschain/compasschain.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
Expand Down
1 change: 0 additions & 1 deletion chains/compasschain/compasschain.h
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
Expand Down
1 change: 0 additions & 1 deletion chains/compasschain/compasschainplugin.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd
** Contact: lorn.potter@jollamobile.com
This file is part of Sensord.
Expand Down

0 comments on commit 08e5f42

Please sign in to comment.