[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/piggz/harbour-amazfish.git</param>
<param name="branch">master</param>
- <param name="revision">2.0.3</param>
+ <param name="revision">2.0.4</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/README.md
^
|
@@ -4,6 +4,11 @@
Requires sailfish version 3.0.3.8 or above due to changes in the base sailfish image
+## Installation
+* Install the ["chum" repository](https://chumrpm.netlify.app/) (by downloading the RPM file and running `devel-su pkcon install-local RPM_FILENAME` )
+* Run `devel-su pkcon refresh`
+* Run `devel-su pkcon install harbour-amazfish`
+
## Supported Devices
There are 3 tiers of supported devices:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/daemon.pro
^
|
@@ -15,6 +15,7 @@
LIBS += -Lqble/qble -L$$OUT_PWD/../lib -lamazfish -lz
PKGCONFIG += dbus-1
QT += positioning KDb3 network dbus
+CONFIG += c++14
equals(FLAVOR, "silica") {
CONFIG += flavor_silica
@@ -31,6 +32,7 @@
flavor_silica {
message(SailfishOS daemon build)
DEFINES += MER_EDITION_SAILFISH
+ LIBS += -lkeepalive
CONFIG += sailfishapp
CONFIG += link_pkgconfig
PKGCONFIG += mlite5
@@ -115,6 +117,7 @@
src/services/dfuservice.cpp \
src/services/infinitimemotionservice.cpp \
src/services/infinitimenavservice.cpp \
+ src/services/infinitimeweatherservice.cpp \
src/services/pinetimemusicservice.cpp \
src/services/uartservice.cpp \
src/typeconversion.cpp \
@@ -153,6 +156,7 @@
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
HEADERS += \
+ src/codec.h \
src/devices/banglejsdevice.h \
src/devices/bipdevice.h \
src/devices/bipsdevice.h \
@@ -177,6 +181,7 @@
src/services/dfuservice.h \
src/services/infinitimemotionservice.h \
src/services/infinitimenavservice.h \
+ src/services/infinitimeweatherservice.h \
src/services/pinetimemusicservice.h \
src/services/uartservice.h \
src/typeconversion.h \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/libwatchfish/calendarevent.cpp
^
|
@@ -8,6 +8,7 @@
QString uid;
QDateTime start;
QDateTime end;
+ QDateTime alertTime;
QString title;
QString location;
QString description;
@@ -70,6 +71,18 @@
}
}
+QDateTime CalendarEvent::alertTime() const
+{
+ return data->alertTime;
+}
+
+void CalendarEvent::setAlertTime(const QDateTime &v)
+{
+ if (data->alertTime != v) {
+ data->alertTime = v;
+ }
+}
+
QString CalendarEvent::title() const
{
return data->title;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/libwatchfish/calendarevent.h
^
|
@@ -17,6 +17,7 @@
Q_PROPERTY(QString uid READ uid WRITE setUid)
Q_PROPERTY(QDateTime start READ start WRITE setStart)
Q_PROPERTY(QDateTime end READ end WRITE setEnd)
+ Q_PROPERTY(QDateTime alertTime READ alertTime WRITE setAlertTime)
Q_PROPERTY(QString title READ title WRITE setTitle)
Q_PROPERTY(QString location READ location WRITE setLocation)
Q_PROPERTY(QString description READ description WRITE setDescription)
@@ -37,6 +38,9 @@
QDateTime end() const;
void setEnd(const QDateTime &end);
+ QDateTime alertTime() const;
+ void setAlertTime(const QDateTime &alertTime);
+
QString title() const;
void setTitle(const QString &v);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/libwatchfish/calendarsource.cpp
^
|
@@ -88,6 +88,12 @@
event.setUid(incidence->uid());
event.setStart(startDate);
event.setEnd(endDate);
+ auto alarmList = incidence->alarms();
+ if (!alarmList.empty() && alarmList[0]->enabled()) {
+ QDateTime nextAlarm = alarmList[0]->nextRepetition(QDateTime::currentDateTime());
+ if (nextAlarm.isValid())
+ event.setAlertTime(nextAlarm);
+ }
event.setAllDay(incidence->allDay());
event.setTitle(incidence->summary());
event.setLocation(incidence->location());
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/codec.h
^
|
@@ -0,0 +1,422 @@
+#pragma once
+// This file is part of CBOR-lite which is copyright Isode Limited
+// and others and released under a MIT license. For details, see the
+// COPYRIGHT.md file in the top-level folder of the CBOR-lite software
+// distribution.
+
+#include <exception>
+#include <iterator>
+#include <string>
+#include <type_traits>
+
+namespace CborLite {
+
+class Exception : public std::exception {
+public:
+ Exception() noexcept {
+ }
+ virtual ~Exception() noexcept = default;
+
+ Exception(const char* d) noexcept {
+ what_ += std::string(": ") + d;
+ }
+
+ Exception(const std::string& d) noexcept {
+ what_ += ": " + d;
+ }
+
+ Exception(const Exception& e) noexcept : what_(e.what_) {
+ }
+
+ Exception(Exception&& e) noexcept : what_(std::move(e.what_)) {
+ // Note that e.what_ is not re-initialized to "CBOR Exception" as
+ // the moved-from object is not expected to ever be reused.
+ }
+
+ Exception& operator=(const Exception&) = delete;
+ Exception& operator=(Exception&&) = delete;
+
+ virtual const char* what() const noexcept {
+ return what_.c_str();
+ }
+
+private:
+ std::string what_ = "CBOR Exception";
+};
+
+using Tag = std::uint_fast64_t;
+
+namespace Major {
+constexpr Tag unsignedInteger = 0u;
+constexpr Tag negativeInteger = 1u << 5;
+constexpr Tag byteString = 2u << 5;
+constexpr Tag textString = 3u << 5;
+constexpr Tag array = 4u << 5;
+constexpr Tag map = 5u << 5;
+constexpr Tag semantic = 6u << 5;
+constexpr Tag floatingPoint = 7u << 5;
+constexpr Tag simple = 7u << 5;
+constexpr Tag mask = 0xe0u;
+} // namespace Major
+
+namespace Minor {
+constexpr Tag length1 = 24u;
+constexpr Tag length2 = 25u;
+constexpr Tag length4 = 26u;
+constexpr Tag length8 = 27u;
+
+constexpr Tag False = 20u;
+constexpr Tag True = 21u;
+constexpr Tag null = 22u;
+constexpr Tag undefined = 23u;
+constexpr Tag halfFloat = 25u; // not implemented
+constexpr Tag singleFloat = 26u;
+constexpr Tag doubleFloat = 27u;
+
+constexpr Tag dataTime = 0u;
+constexpr Tag epochDataTime = 1u;
+constexpr Tag positiveBignum = 2u;
+constexpr Tag negativeBignum = 3u;
+constexpr Tag decimalFraction = 4u;
+constexpr Tag bigfloat = 5u;
+constexpr Tag convertBase64Url = 21u;
+constexpr Tag convertBase64 = 22u;
+constexpr Tag convertBase16 = 23u;
+constexpr Tag cborEncodedData = 24u;
+constexpr Tag uri = 32u;
+constexpr Tag base64Url = 33u;
+constexpr Tag base64 = 34u;
+constexpr Tag regex = 35u;
+constexpr Tag mimeMessage = 36u;
+constexpr Tag selfDescribeCbor = 55799u;
+
+constexpr Tag mask = 0x1fu;
+} // namespace Minor
+
+constexpr Tag undefined = Major::semantic + Minor::undefined;
+
+using Flags = unsigned;
+namespace Flag {
+constexpr Flags none = 0;
+constexpr Flags requireMinimalEncoding = 1 << 0;
+} // namespace Flag
+
+template <typename Type>
+typename std::enable_if<std::is_unsigned<Type>::value, std::size_t>::type length(Type val) {
+ if (val < 24) return 0;
+ for (std::size_t i = 1; i <= ((sizeof val) >> 1); i <<= 1) {
+ if (!(val >> (i << 3))) return i;
+ }
+ return sizeof val;
+}
+
+template <typename Buffer>
+typename std::enable_if<std::is_class<Buffer>::value, std::size_t>::type encodeTagAndAdditional(
+ Buffer& buffer, Tag tag, Tag additional) {
+ buffer.push_back(static_cast<char>(tag + additional));
+ return 1;
+}
+
+template <typename InputIterator>
+typename std::enable_if<std::is_class<InputIterator>::value, std::size_t>::type decodeTagAndAdditional(
+ InputIterator& pos, InputIterator end, Tag& tag, Tag& additional, Flags = Flag::none) {
+ if (pos == end) throw Exception("not enough input");
+ auto octet = *(pos++);
+ tag = octet & Major::mask;
+ additional = octet & Minor::mask;
+ return 1;
+}
+
+template <typename Buffer, typename Type>
+typename std::enable_if<std::is_class<Buffer>::value && std::is_unsigned<Type>::value, std::size_t>::type encodeTagAndValue(
+ Buffer& buffer, Tag tag, const Type t) {
+ auto len = length(t);
+ buffer.reserve(buffer.size() + len + 1);
+
+ switch (len) {
+ case 8:
+ encodeTagAndAdditional(buffer, tag, Minor::length8);
+ break;
+ case 4:
+ encodeTagAndAdditional(buffer, tag, Minor::length4);
+ break;
+ case 2:
+ encodeTagAndAdditional(buffer, tag, Minor::length2);
+ break;
+ case 1:
+ encodeTagAndAdditional(buffer, tag, Minor::length1);
+ break;
+ case 0:
+ return encodeTagAndAdditional(buffer, tag, t);
+ default:
+ throw Exception("too long");
+ }
+
+ switch (len) {
+ case 8:
+ buffer.push_back((t >> 56) & 0xffU);
+ buffer.push_back((t >> 48) & 0xffU);
+ buffer.push_back((t >> 40) & 0xffU);
+ buffer.push_back((t >> 32) & 0xffU);
+ case 4:
+ buffer.push_back((t >> 24) & 0xffU);
+ buffer.push_back((t >> 16) & 0xffU);
+ case 2:
+ buffer.push_back((t >> 8) & 0xffU);
+ case 1:
+ buffer.push_back(t & 0xffU);
+ }
+
+ return 1 + len;
+}
+
+template <typename InputIterator, typename Type>
+typename std::enable_if<std::is_class<InputIterator>::value && std::is_unsigned<Type>::value, std::size_t>::type decodeTagAndValue(
+ InputIterator& pos, InputIterator end, Tag& tag, Type& t, Flags flags = Flag::none) {
+ if (pos == end) throw Exception("not enough input");
+ auto additional = Minor::undefined;
+ auto len = decodeTagAndAdditional(pos, end, tag, additional, flags);
+ if (additional < Minor::length1) {
+ t = additional;
+ return len;
+ }
+ t = 0u;
+ switch (additional) {
+ case Minor::length8:
+ if (std::distance(pos, end) < 8) throw Exception("not enough input");
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 56;
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 48;
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 40;
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 32;
+ len += 4;
+ if ((flags & Flag::requireMinimalEncoding) && !t) throw Exception("encoding not minimal");
+ case Minor::length4:
+ if (std::distance(pos, end) < 4) throw Exception("not enough input");
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 24;
+ t |= static_cast<Type>(reinterpret_cast<const unsigned char&>(*(pos++))) << 16;
+ len += 2;
+ if ((flags & Flag::requireMinimalEncoding) && !t) throw Exception("encoding not minimal");
+ case Minor::length2:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devicefactory.cpp
^
|
@@ -20,7 +20,7 @@
return new GtsDevice(deviceName);
}
- if (deviceName == "Amazfit GTS2") {
+ if (deviceName == "Amazfit GTS 2") {
return new Gts2Device(deviceName);
}
@@ -28,7 +28,7 @@
return new GtrDevice(deviceName);
}
- if (deviceName == "Amazfit GTR2") {
+ if (deviceName == "Amazfit GTR 2") {
return new Gtr2Device(deviceName);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/deviceinterface.cpp
^
|
@@ -512,6 +512,25 @@
}
}
+void DeviceInterface::onEventTimer()
+{
+ qDebug() << "DeviceInterface::onEventTimer";
+ if (m_eventlist.isEmpty())
+ return;
+ watchfish::CalendarEvent event = m_eventlist.takeFirst();
+ if (m_device)
+ m_device->sendAlert("calendar", event.title(), event.description().isEmpty()?" ":event.description());
+ scheduleNextEvent();
+}
+
+void DeviceInterface::backgroundActivityStateChanged()
+{
+#ifdef MER_EDITION_SAILFISH
+ if (m_backgroundActivity->isRunning())
+ onEventTimer();
+#endif
+}
+
void DeviceInterface::sendBufferedNotifications()
{
qDebug() << Q_FUNC_INFO;
@@ -524,6 +543,40 @@
}
}
+void DeviceInterface::scheduleNextEvent()
+{
+ qDebug() << "DeviceInterface::scheduleNextEvent";
+ if (m_eventlist.isEmpty())
+ return;
+#ifdef MER_EDITION_SAILFISH
+ if (!m_backgroundActivity) {
+ m_backgroundActivity = new BackgroundActivity(this);
+ connect(m_backgroundActivity, &BackgroundActivity::stateChanged,
+ this, &DeviceInterface::backgroundActivityStateChanged);
+ }
+#endif
+
+ watchfish::CalendarEvent nextEvent = m_eventlist.first();
+ if (!nextEvent.alertTime().isValid())
+ return;
+ int secsToNextEvent = QDateTime::currentDateTime().secsTo(nextEvent.alertTime());
+ while (secsToNextEvent < 30) {
+ m_eventlist.takeFirst();
+ if (m_eventlist.isEmpty())
+ return;
+ nextEvent = m_eventlist.first();
+ if (!nextEvent.alertTime().isValid())
+ return;
+ secsToNextEvent = QDateTime::currentDateTime().secsTo(nextEvent.alertTime());
+ }
+ qDebug() << "seconds until next event: " << secsToNextEvent;
+ qDebug() << "event title: " << nextEvent.title();
+#ifdef MER_EDITION_SAILFISH
+ m_backgroundActivity->setWakeupRange(secsToNextEvent-30, secsToNextEvent+30);
+ m_backgroundActivity->wait();
+#endif
+}
+
QString DeviceInterface::prepareFirmwareDownload(const QString &path)
{
if (!operationRunning()) {
@@ -727,6 +780,7 @@
void DeviceInterface::updateCalendar()
{
+ qDebug() << "DeviceInterface::updateCalendar";
if (supportsFeature(AbstractDevice::FEATURE_EVENT_REMINDER)) {
if (m_device) {
QList<watchfish::CalendarEvent> eventlist = m_calendarSource.fetchEvents(QDate::currentDate(), QDate::currentDate().addDays(14), true);
@@ -738,6 +792,28 @@
id++;
}
}
+ } else if (AmazfishConfig::instance()->appSimulateEventSupport()){
+ QList<watchfish::CalendarEvent> eventlist = m_calendarSource.fetchEvents(QDate::currentDate(), QDate::currentDate().addDays(14), true);
+ QList<watchfish::CalendarEvent> filteredEventList;
+ foreach (const watchfish::CalendarEvent &event, eventlist) {
+ if (!event.alertTime().isValid())
+ continue;
+ if (filteredEventList.isEmpty()) {
+ filteredEventList.append(event);
+ } else {
+ auto i = filteredEventList.begin();
+ while (i != filteredEventList.end() && i->alertTime() < event.alertTime())
+ i++;
+ filteredEventList.insert(i, event);
+ }
+ }
+ foreach (const watchfish::CalendarEvent &event, filteredEventList) {
+ qDebug() << event.title() << event.alertTime();
+ }
+ if (!filteredEventList.isEmpty()) {
+ m_eventlist = filteredEventList;
+ scheduleNextEvent();
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/deviceinterface.h
^
|
@@ -11,6 +11,10 @@
#include <KDb3/KDbConnection>
#include <KDb3/KDbConnectionData>
+#ifdef MER_EDITION_SAILFISH
+#include <keepalive/backgroundactivity.h>
+#endif
+
#include "abstractdevice.h"
#include "abstractfirmwareinfo.h"
#include "dbushrm.h"
@@ -111,9 +115,12 @@
Q_SLOT void musicChanged();
Q_SLOT void deviceEvent(AbstractDevice::Events event);
Q_SLOT void handleButtonPressed(int presses);
+ Q_SLOT void onEventTimer();
+ Q_SLOT void backgroundActivityStateChanged();
void sendBufferedNotifications();
-
+ void scheduleNextEvent();
+
//Watchfish
watchfish::MusicController m_musicController;
#ifdef MER_EDITION_SAILFISH
@@ -147,6 +154,12 @@
QDateTime m_lastWeatherSync;
QDateTime m_lastCalendarSync;
QDateTime m_lastActivitySync;
+
+ //Event list for simulated event support
+ QList<watchfish::CalendarEvent> m_eventlist;
+#ifdef MER_EDITION_SAILFISH
+ BackgroundActivity *m_backgroundActivity = nullptr;
+#endif
};
#endif // BIPINTERFACE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/bipdevice.cpp
^
|
@@ -6,6 +6,7 @@
BipDevice::BipDevice(const QString &pairedName, QObject *parent) : HuamiDevice(pairedName, parent)
{
+ qDebug() << Q_FUNC_INFO;
connect(this, &QBLEDevice::propertiesChanged, this, &BipDevice::onPropertiesChanged);
}
@@ -28,7 +29,7 @@
void BipDevice::parseServices()
{
- qDebug() << "BipDevice::parseServices";
+ qDebug() << Q_FUNC_INFO;
QDBusInterface adapterIntro("org.bluez", devicePath(), "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), 0);
QDBusReply<QString> xml = adapterIntro.call("Introspect");
@@ -78,7 +79,7 @@
void BipDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
{
- qDebug() << "BipDevice::onPropertiesChanged:" << interface << map << list;
+ qDebug() << Q_FUNC_INFO << interface << map << list;
if (interface == "org.bluez.Device1") {
m_reconnectTimer->start();
@@ -111,6 +112,7 @@
void BipDevice::initialise()
{
+ qDebug() << Q_FUNC_INFO;
setConnectionState("connected");
parseServices();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/bipdevice.h
^
|
@@ -97,10 +97,11 @@
protected:
virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
+ virtual void initialise();
private:
void parseServices();
- void initialise();
+
};
#endif // BIPDEVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/bipsdevice.cpp
^
|
@@ -124,7 +124,7 @@
void BipSDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
{
- qDebug() << Q_FUNC_INFO<< interface << map << list;
+ qDebug() << Q_FUNC_INFO << interface << map << list;
if (interface == "org.bluez.Device1") {
m_reconnectTimer->start();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/gtrdevice.cpp
^
|
@@ -1,14 +1,16 @@
#include "gtrdevice.h"
#include <QtXml/QtXml>
+#include <QTimer>
GtrDevice::GtrDevice(const QString &pairedName, QObject *parent) : GtsDevice(pairedName, parent)
{
-
+ qDebug() << Q_FUNC_INFO;
+ connect(this, &QBLEDevice::propertiesChanged, this, &GtrDevice::onPropertiesChanged, Qt::UniqueConnection);
}
void GtrDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
{
- qDebug() << "GtsDevice::onPropertiesChanged:" << interface << map << list;
+ qDebug() << Q_FUNC_INFO << interface << map << list;
if (interface == "org.bluez.Device1") {
m_reconnectTimer->start();
@@ -44,16 +46,24 @@
void GtrDevice::initialise()
{
- setConnectionState("connected");
+ qDebug() << Q_FUNC_INFO;
parseServices();
MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
if (mi) {
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_CONFIGURATION);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_BATTERY_INFO);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_DEVICE_EVENT);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_REALTIME_STEPS);
-
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_READ);
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_CHUNKED_TRANSFER);
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_WRITE);
+
+ /*
+ qDebug() << "Read first";
+ QByteArray a = mi->readValue(MiBandService::UUID_CHARACTERISTIC_MIBAND_CHUNKED_TRANSFER);
+ qDebug() << a;
+
+ qDebug() << "Write something";
+ uint8_t start[1] = {0x01};
+ mi->writeValue(MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_WRITE, UCHARARR_TO_BYTEARRAY(start));
+ */
connect(mi, &MiBandService::message, this, &HuamiDevice::message, Qt::UniqueConnection);
connect(mi, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
connect(mi, &MiBandService::buttonPressed, this, &GtrDevice::handleButtonPressed, Qt::UniqueConnection);
@@ -68,6 +78,9 @@
connect(mi2, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
mi2->enableNotification(MiBand2Service::UUID_CHARACTERISITIC_MIBAND2_AUTH);
+ }
+
+ if (mi2) {
mi2->initialise(false);
}
@@ -98,8 +111,7 @@
void GtrDevice::parseServices()
{
- qDebug() << "GtsDevice::parseServices";
-
+ qDebug() << Q_FUNC_INFO;
QDBusInterface adapterIntro("org.bluez", devicePath(), "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), nullptr);
QDBusReply<QString> xml = adapterIntro.call("Introspect");
@@ -128,7 +140,6 @@
qDebug() << "Creating service for: " << uuid;
if (uuid == AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION && !service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION)) {
- void parseServices();
addService(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION, new AlertNotificationService(path, this));
} else if (uuid == DeviceInfoService::UUID_SERVICE_DEVICEINFO && !service(DeviceInfoService::UUID_SERVICE_DEVICEINFO)) {
addService(DeviceInfoService::UUID_SERVICE_DEVICEINFO, new DeviceInfoService(path, this));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/gtrdevice.h
^
|
@@ -10,9 +10,9 @@
explicit GtrDevice(const QString &pairedName, QObject *parent = nullptr);
private:
- void initialise();
- void parseServices();
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
+ void initialise() override;
+ void parseServices() override;
+ virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list) override;
bool is47mm(const QString &version) const;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/gts2device.h
^
|
@@ -3,6 +3,11 @@
#include "gtsdevice.h"
+/*
+ *{0000FEE1-0000-1000-8000-00805f9b34fb} MiBand2 Service
+--00000009-0000-3512-2118-0009af100700 //Auth
+--00000017-0000-3512-2118-0009af100700 //2021 Chunked Char Read
+*/
class Gts2Device : public GtsDevice
{
Q_OBJECT
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/gtsdevice.cpp
^
|
@@ -10,7 +10,7 @@
GtsDevice::GtsDevice(const QString &pairedName, QObject *parent) : HuamiDevice(pairedName, parent)
{
qDebug() << "Creating GTS Device";
- connect(this, &QBLEDevice::propertiesChanged, this, &GtsDevice::onPropertiesChanged);
+ connect(this, &QBLEDevice::propertiesChanged, this, &GtsDevice::onPropertiesChanged, Qt::UniqueConnection);
}
QString GtsDevice::deviceType()
@@ -41,7 +41,7 @@
void GtsDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
{
- qDebug() << "GtsDevice::onPropertiesChanged:" << interface << map << list;
+ qDebug() << Q_FUNC_INFO << interface << map << list;
if (interface == "org.bluez.Device1") {
m_reconnectTimer->start();
@@ -108,16 +108,12 @@
void GtsDevice::initialise()
{
+ qDebug() << Q_FUNC_INFO;
setConnectionState("connected");
parseServices();
MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
if (mi) {
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_CONFIGURATION);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_BATTERY_INFO);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_DEVICE_EVENT);
- mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_REALTIME_STEPS);
-
connect(mi, &MiBandService::message, this, &HuamiDevice::message, Qt::UniqueConnection);
connect(mi, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
connect(mi, &MiBandService::buttonPressed, this, &GtsDevice::handleButtonPressed, Qt::UniqueConnection);
@@ -152,17 +148,17 @@
connect(hrm, &HRMService::informationChanged, this, &HuamiDevice::informationChanged, Qt::UniqueConnection);
}
- QString revision = softwareRevision();
- if (revision > "0.0.9.0") {
- qDebug() << "GTS with new FW";
- m_ActivitySampleSize = 8;
- }
+ //QString revision = softwareRevision();
+ //if (revision > "0.0.9.0") {
+ // qDebug() << "GTS with new FW";
+ // m_ActivitySampleSize = 8;
+ //}
}
void GtsDevice::parseServices()
{
- qDebug() << "GtsDevice::parseServices";
+ qDebug() << Q_FUNC_INFO;
QDBusInterface adapterIntro("org.bluez", devicePath(), "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), nullptr);
QDBusReply<QString> xml = adapterIntro.call("Introspect");
@@ -192,7 +188,6 @@
qDebug() << "Creating service for: " << uuid;
if (uuid == AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION && !service(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION)) {
- void parseServices();
addService(AlertNotificationService::UUID_SERVICE_ALERT_NOTIFICATION, new AlertNotificationService(path, this));
} else if (uuid == DeviceInfoService::UUID_SERVICE_DEVICEINFO && !service(DeviceInfoService::UUID_SERVICE_DEVICEINFO)) {
addService(DeviceInfoService::UUID_SERVICE_DEVICEINFO, new DeviceInfoService(path, this));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/gtsdevice.h
^
|
@@ -27,14 +27,13 @@
virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
virtual QStringList supportedDisplayItems() const override;
-private:
- void initialise();
- void parseServices();
-
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
protected:
Q_SLOT void serviceEvent(uint8_t event);
+ virtual void initialise();
+ virtual void parseServices();
+
+ virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
private:
QString pairedName;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/huamidevice.cpp
^
|
@@ -175,13 +175,18 @@
void HuamiDevice::authenticated(bool ready)
{
- qDebug() << "BipInterface::authenticated:" << ready;
+ qDebug() << Q_FUNC_INFO << ready;
if (ready) {
m_needsAuth = false;
MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
if (mi){
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_CONFIGURATION);
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_BATTERY_INFO);
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_DEVICE_EVENT);
+ mi->enableNotification(MiBandService::UUID_CHARACTERISTIC_MIBAND_REALTIME_STEPS);
+
mi->setCurrentTime();
mi->setLanguage();
mi->setDateDisplay();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/pinetimejfdevice.cpp
^
|
@@ -9,6 +9,7 @@
#include "infinitimenavservice.h"
#include "hrmservice.h"
#include "infinitimemotionservice.h"
+#include "infinitimeweatherservice.h"
#include <QtXml/QtXml>
@@ -37,6 +38,7 @@
{
return FEATURE_HRM |
FEATURE_ALERT |
+ FEATURE_WEATHER |
FEATURE_STEPS;
}
@@ -119,6 +121,8 @@
addService(HRMService::UUID_SERVICE_HRM, new HRMService(path, this));
} else if (uuid == InfiniTimeMotionService::UUID_SERVICE_MOTION && !service(InfiniTimeMotionService::UUID_SERVICE_MOTION)) {
addService(InfiniTimeMotionService::UUID_SERVICE_MOTION, new InfiniTimeMotionService(path, this));
+ } else if (uuid == InfiniTimeWeatherService::UUID_SERVICE_WEATHER && !service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER)) {
+ addService(InfiniTimeWeatherService::UUID_SERVICE_WEATHER, new InfiniTimeWeatherService(path, this));
} else if ( !service(uuid)) {
addService(uuid, new QBLEService(uuid, path, this));
}
@@ -347,3 +351,11 @@
}
}
}
+
+void PinetimeJFDevice::sendWeather(CurrentWeather *weather)
+{
+ InfiniTimeWeatherService *w = qobject_cast<InfiniTimeWeatherService*>(service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER));
+ if (w){
+ w->sendWeather(weather);
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/devices/pinetimejfdevice.h
^
|
@@ -32,6 +32,9 @@
virtual void navigationRunning(bool running) override;
virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
+ //Weather
+ virtual void sendWeather(CurrentWeather *weather) override;
+
protected:
virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/harbour-amazfish-daemon.cpp
^
|
@@ -22,8 +22,16 @@
static void daemonize();
static void signalHandler(int sig);
+void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
+{
+ QByteArray localMsg = msg.toLocal8Bit();
+ const char* time = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toLocal8Bit();
+ fprintf(stderr, "%s : %s\n", time, localMsg.constData());
+}
+
int main(int argc, char **argv)
{
+ qInstallMessageHandler(myMessageOutput);
QCoreApplication app(argc, argv);
QCoreApplication::setOrganizationName("harbour-amazfish");
QCoreApplication::setApplicationName("harbour-amazfish");
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/services/infinitimeweatherservice.cpp
^
|
@@ -0,0 +1,267 @@
+#include "infinitimeweatherservice.h"
+#include "typeconversion.h"
+#include "codec.h"
+
+#include <QDateTime>
+#include <QDebug>
+#include <math.h>
+
+const char* InfiniTimeWeatherService::UUID_SERVICE_WEATHER = "00040000-78fc-48fe-8e23-433b3a1942d0";
+const char* InfiniTimeWeatherService::UUID_CHARACTERISTIC_WEATHER_DATA = "00040001-78fc-48fe-8e23-433b3a1942d0";
+const char* InfiniTimeWeatherService::UUID_CHARACTERISTIC_WEATHER_CONTROL = "00040002-78fc-48fe-8e23-433b3a1942d0";
+
+InfiniTimeWeatherService::InfiniTimeWeatherService(const QString &path, QObject *parent) : QBLEService(UUID_SERVICE_WEATHER, path, parent)
+{
+ qDebug() << Q_FUNC_INFO;
+ enableNotification(UUID_CHARACTERISTIC_WEATHER_DATA);
+ connect(this, &QBLEService::characteristicChanged, this, &InfiniTimeWeatherService::characteristicChanged);
+}
+
+void InfiniTimeWeatherService::sendWeather(CurrentWeather *weather)
+{
+ Location l;
+ l.eventType = eventtype::Location;
+ l.timestamp = weather->dateTime();
+ l.location = weather->city()->name().toStdString();
+ l.expires = 86400; //1 day
+ QPoint loc = degreesToEPSG3875(QPointF(weather->city()->latitude(), weather->city()->longitude()));
+ l.latitude = loc.x();
+ l.longitude = loc.y();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, l.toCBOR());
+
+ for (int f = 0; f < weather->forecastCount(); f++) {
+ CurrentWeather::Forecast fc = weather->forecast(f);
+ qDebug() << "Forecast:" << f << fc.dateTime()<< fc.weatherCode() << fc.maxTemperature() << fc.minTemperature() << fc.humidity() << fc.pressure() << fc.windMaxSpeed() << fc.clouds();
+
+ Temperature t;
+ t.eventType = eventtype::Temperature;
+ t.timestamp = fc.dateTime();
+ t.expires = 86400; //1 day
+ t.temperature = fc.maxTemperature();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, t.toCBOR());
+
+ Clouds c;
+ c.eventType = eventtype::Clouds;
+ c.timestamp = fc.dateTime();
+ c.expires = 86400; //1 day
+ c.amount = fc.clouds();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, c.toCBOR());
+
+ Wind w;
+ w.eventType = eventtype::Clouds;
+ w.timestamp = fc.dateTime();
+ w.expires = 86400; //1 day
+ w.directionMax = fc.windDirection() / 255;
+ w.directionMin = w.directionMax;
+ w.speedMin = fc.windMinSpeed();
+ w.speedMax = fc.windMaxSpeed();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, w.toCBOR());
+
+ Precipitation p;
+ p.eventType = eventtype::Precipitation;
+ p.timestamp = fc.dateTime();
+ p.expires = 86400; //1 day
+ if (fc.snowMMDay() > 0) {
+ p.type = precipitationtype::Snow;
+ p.amount = fc.snowMMDay();
+ } else if (fc.rainMMDay() > 0){
+ p.type = precipitationtype::Rain;
+ p.amount = fc.rainMMDay();
+ } else {
+ p.type = precipitationtype::None;
+ p.amount = 0;
+ }
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, p.toCBOR());
+
+ Humidity h;
+ h.eventType = eventtype::Humidity;
+ h.timestamp = fc.dateTime();
+ h.expires = 86400; //1 day
+ h.humidity = fc.humidity();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, h.toCBOR());
+
+ Pressure pr;
+ pr.eventType = eventtype::Pressure;
+ pr.timestamp = fc.dateTime();
+ pr.expires = 86400; //1 day
+ pr.pressure = fc.pressure();
+ writeValue(UUID_CHARACTERISTIC_WEATHER_DATA, pr.toCBOR());
+ }
+
+}
+
+void InfiniTimeWeatherService::characteristicChanged(const QString &characteristic, const QByteArray &value)
+{
+ qDebug() << Q_FUNC_INFO << characteristic << value;
+
+}
+
+QPoint InfiniTimeWeatherService::degreesToEPSG3875(const QPointF &location)
+{
+ double smRadius = 6378136.98;
+ double smRange = smRadius * M_PI * 2.0;
+ double smLonToX = smRange / 360.0;
+ double smRadiansOverDegrees = M_PI / 180.0;
+
+ QPoint ret;
+ // compute x-map-unit
+ ret.setX(location.x() * smLonToX);
+
+ double y = location.y();
+
+ // compute y-map-unit
+ if (y > 86.0)
+ {
+ ret.setY(smRange);
+ }
+ else if (y < -86.0)
+ {
+ ret.setY(-smRange);
+ }
+ else
+ {
+ y *= smRadiansOverDegrees;
+ y = std::log(std::tan(y) + (1.0 / std::cos(y)));
+ ret.setY(y * smRadius);
+ }
+ return ret;
+}
+
+QByteArray InfiniTimeWeatherService::Clouds::toCBOR() const
+{
+ std::vector<uint8_t> buffer;
+ CborLite::encodeMapSize<std::vector<uint8_t>, uint8_t>(buffer, 4);
+ CborLite::encodeText(buffer, std::string("EventType"));
+ CborLite::encodeUnsigned(buffer, static_cast<uint8_t>(eventType));
+ CborLite::encodeText(buffer, std::string("Timestamp"));
+ CborLite::encodeInteger(buffer, timestamp);
+ CborLite::encodeText(buffer, std::string("Expires"));
+ CborLite::encodeInteger(buffer, expires);
+ CborLite::encodeText(buffer, std::string("Amount"));
+ CborLite::encodeUnsigned(buffer, amount);
+
+ return QByteArray(reinterpret_cast<const char*>(buffer.data()), buffer.size());
+}
+
+QByteArray InfiniTimeWeatherService::Obscuration::toCBOR() const
+{
+ return QByteArray();
+}
+
+QByteArray InfiniTimeWeatherService::Precipitation::toCBOR() const
+{
+ std::vector<uint8_t> buffer;
+ CborLite::encodeMapSize<std::vector<uint8_t>, uint8_t>(buffer, 5);
+ CborLite::encodeText(buffer, std::string("EventType"));
+ CborLite::encodeUnsigned(buffer, static_cast<uint8_t>(eventType));
+ CborLite::encodeText(buffer, std::string("Timestamp"));
+ CborLite::encodeInteger(buffer, timestamp);
+ CborLite::encodeText(buffer, std::string("Expires"));
+ CborLite::encodeInteger(buffer, expires);
+ CborLite::encodeText(buffer, std::string("Type"));
+ CborLite::encodeUnsigned(buffer, static_cast<uint8_t>(type));
+ CborLite::encodeText(buffer, std::string("Amount"));
+ CborLite::encodeUnsigned(buffer, amount);
+
+ return QByteArray(reinterpret_cast<const char*>(buffer.data()), buffer.size());
+}
+
+QByteArray InfiniTimeWeatherService::Wind::toCBOR() const
+{
+ std::vector<uint8_t> buffer;
+ CborLite::encodeMapSize<std::vector<uint8_t>, uint8_t>(buffer, 7);
+ CborLite::encodeText(buffer, std::string("EventType"));
+ CborLite::encodeUnsigned(buffer, static_cast<uint8_t>(eventType));
+ CborLite::encodeText(buffer, std::string("Timestamp"));
+ CborLite::encodeInteger(buffer, timestamp);
+ CborLite::encodeText(buffer, std::string("Expires"));
+ CborLite::encodeInteger(buffer, expires);
+ CborLite::encodeText(buffer, std::string("SpeedMin"));
+ CborLite::encodeUnsigned(buffer, speedMin);
+ CborLite::encodeText(buffer, std::string("SpeedMax"));
+ CborLite::encodeUnsigned(buffer, speedMax);
+ CborLite::encodeText(buffer, std::string("DirectionMin"));
+ CborLite::encodeUnsigned(buffer, directionMin);
+ CborLite::encodeText(buffer, std::string("DirectionMax"));
+ CborLite::encodeUnsigned(buffer, directionMax);
+
+ return QByteArray(reinterpret_cast<const char*>(buffer.data()), buffer.size());
+}
+
+QByteArray InfiniTimeWeatherService::Temperature::toCBOR() const
+{
+ std::vector<uint8_t> buffer;
+ CborLite::encodeMapSize<std::vector<uint8_t>, uint8_t>(buffer, 4);
+ CborLite::encodeText(buffer, std::string("EventType"));
+ CborLite::encodeUnsigned(buffer, static_cast<uint8_t>(eventType));
+ CborLite::encodeText(buffer, std::string("Timestamp"));
+ CborLite::encodeInteger(buffer, timestamp);
+ CborLite::encodeText(buffer, std::string("Expires"));
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/services/infinitimeweatherservice.h
^
|
@@ -0,0 +1,386 @@
+#ifndef INFINITIMEWEATHERSERVICE_H
+#define INFINITIMEWEATHERSERVICE_H
+
+#include <QObject>
+#include "qble/qbleservice.h"
+#include "devices/abstractdevice.h"
+
+/** 00040000-78fc-48fe-8e23-433b3a1942d0 --Weather Service
+ * "00040001-78fc-48fe-8e23-433b3a1942d0", --Data
+ * "00040002-78fc-48fe-8e23-433b3a1942d0", --Control
+ */
+class InfiniTimeWeatherService : public QBLEService
+{
+ Q_OBJECT
+public:
+ static const char *UUID_SERVICE_WEATHER;
+ static const char *UUID_CHARACTERISTIC_WEATHER_DATA;
+ static const char *UUID_CHARACTERISTIC_WEATHER_CONTROL;
+
+ explicit InfiniTimeWeatherService(const QString &path, QObject *parent);
+
+ void sendWeather(CurrentWeather *weather);
+
+private:
+ Q_SLOT void characteristicChanged(const QString &characteristic, const QByteArray &value);
+
+ QPoint degreesToEPSG3875(const QPointF& location);
+
+ // From firmware
+ /**
+ * Visibility obscuration types
+ */
+ enum class obscurationtype {
+ /** No obscuration */
+ None = 0,
+ /** Water particles suspended in the air; low visibility; does not fall */
+ Fog = 1,
+ /** Tiny, dry particles in the air; invisible to the eye; opalescent */
+ Haze = 2,
+ /** Small fire-created particles suspended in the air */
+ Smoke = 3,
+ /** Fine rock powder, from for example volcanoes */
+ Ash = 4,
+ /** Fine particles of earth suspended in the air by the wind */
+ Dust = 5,
+ /** Fine particles of sand suspended in the air by the wind */
+ Sand = 6,
+ /** Water particles suspended in the air; low-ish visibility; temperature is near dewpoint */
+ Mist = 7,
+ /** This is SPECIAL in the sense that the thing raining down is doing the obscuration */
+ Precipitation = 8,
+ Length
+ };
+
+ /**
+ * Types of precipitation
+ */
+ enum class precipitationtype {
+ /**
+ * No precipitation
+ *
+ * Theoretically we could just _not_ send the event, but then
+ * how do we differentiate between no precipitation and
+ * no information about precipitation
+ */
+ None = 0,
+ /** Drops larger than a drizzle; also widely separated drizzle */
+ Rain = 1,
+ /** Fairly uniform rain consisting of fine drops */
+ Drizzle = 2,
+ /** Rain that freezes upon contact with objects and ground */
+ FreezingRain = 3,
+ /** Rain + hail; ice pellets; small translucent frozen raindrops */
+ Sleet = 4,
+ /** Larger ice pellets; falling separately or in irregular clumps */
+ Hail = 5,
+ /** Hail with smaller grains of ice; mini-snowballs */
+ SmallHail = 6,
+ /** Snow... */
+ Snow = 7,
+ /** Frozen drizzle; very small snow crystals */
+ SnowGrains = 8,
+ /** Needles; columns or plates of ice. Sometimes described as "diamond dust". In very cold regions */
+ IceCrystals = 9,
+ /** It's raining down ash, e.g. from a volcano */
+ Ash = 10,
+ Length
+ };
+
+ /**
+ * These are special events that can "enhance" the "experience" of existing weather events
+ */
+ enum class specialtype {
+ /** Strong wind with a sudden onset that lasts at least a minute */
+ Squall = 0,
+ /** Series of waves in a water body caused by the displacement of a large volume of water */
+ Tsunami = 1,
+ /** Violent; rotating column of air */
+ Tornado = 2,
+ /** Unplanned; unwanted; uncontrolled fire in an area */
+ Fire = 3,
+ /** Thunder and/or lightning */
+ Thunder = 4,
+ Length
+ };
+
+ /**
+ * These are used for weather timeline manipulation
+ * that isn't just adding to the stack of weather events
+ */
+ enum class controlcodes {
+ /** How much is stored already */
+ GetLength = 0,
+ /** This wipes the entire timeline */
+ DelTimeline = 1,
+ /** There's a currently valid timeline event with the given type */
+ HasValidEvent = 3,
+ Length
+ };
+
+ /**
+ * Events have types
+ * then they're easier to parse after sending them over the air
+ */
+ enum class eventtype : uint8_t {
+ /** @see obscuration */
+ Obscuration = 0,
+ /** @see precipitation */
+ Precipitation = 1,
+ /** @see wind */
+ Wind = 2,
+ /** @see temperature */
+ Temperature = 3,
+ /** @see airquality */
+ AirQuality = 4,
+ /** @see special */
+ Special = 5,
+ /** @see pressure */
+ Pressure = 6,
+ /** @see location */
+ Location = 7,
+ /** @see cloud */
+ Clouds = 8,
+ /** @see humidity */
+ Humidity = 9,
+ Length
+ };
+
+ /**
+ * Valid event query
+ *
+ * NOTE: Not currently available, until needs are better known
+ */
+ class ValidEventQuery {
+ public:
+ static constexpr controlcodes code = controlcodes::HasValidEvent;
+ eventtype eventType;
+ };
+
+ /** The header used for further parsing */
+ class TimelineHeader {
+ public:
+ /**
+ * UNIX timestamp
+ * TODO: This is currently WITH A TIMEZONE OFFSET!
+ * Please send events with the timestamp offset by the timezone.
+ **/
+ uint64_t timestamp;
+ /**
+ * Time in seconds until the event expires
+ *
+ * 32 bits ought to be enough for everyone
+ *
+ * If there's a newer event of the same type then it overrides this one, even if it hasn't expired
+ */
+ uint32_t expires;
+ /**
+ * What type of weather-related event
+ */
+ eventtype eventType;
+
+ virtual QByteArray toCBOR() const = 0;
+ };
+
+ /** Specifies how cloudiness is stored */
+ class Clouds : public TimelineHeader {
+ public:
+ /** Cloud coverage in percentage, 0-100% */
+ uint8_t amount;
+
+ QByteArray toCBOR() const override;
+ };
+
+ /** Specifies how obscuration is stored */
+ class Obscuration : public TimelineHeader {
+ public:
+ /** Type of precipitation */
+ obscurationtype type;
+ /**
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/services/miband2service.cpp
^
|
@@ -14,7 +14,7 @@
m_requiresAuthKey = requireAuthKey;
qDebug() << "auth:" << (int)m_authByte << "crypt:" << (int)m_cryptByte << "req:" << m_requiresAuthKey;
- connect(this, &QBLEService::characteristicChanged, this, &MiBand2Service::characteristicChanged);
+ connect(this, &QBLEService::characteristicChanged, this, &MiBand2Service::characteristicChanged, Qt::UniqueConnection);
}
void MiBand2Service::initialise(bool firstTime)
@@ -25,6 +25,8 @@
writeValue(UUID_CHARACTERISITIC_MIBAND2_AUTH, UCHAR_TO_BYTEARRAY(AUTH_SEND_KEY) + UCHAR_TO_BYTEARRAY(m_authByte) + getSecretKey());
} else {
qDebug() << "Writing request for auth number";
+ //uint8_t start[2] = {0x01, 0x00};
+ //writeValue(UUID_CHARACTERISITIC_MIBAND2_AUTH, UCHARARR_TO_BYTEARRAY(start));
writeValue(UUID_CHARACTERISITIC_MIBAND2_AUTH , requestAuthNumber());
}
}
@@ -71,6 +73,7 @@
} else {
uint8_t req = (m_cryptByte | AUTH_REQUEST_RANDOM_AUTH_NUMBER);
uint8_t suffix[3] = {0x02,0x01, 0x00};
+ //uint8_t suffix[1] = {0x02};
return UCHAR_TO_BYTEARRAY(req) + UCHAR_TO_BYTEARRAY(m_authByte) + UCHARARR_TO_BYTEARRAY(suffix);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/services/mibandservice.cpp
^
|
@@ -19,6 +19,8 @@
const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_CURRENT_TIME = "00002a2b-0000-1000-8000-00805f9b34fb";
const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_WEATHER = "0000000e-0000-3512-2118-0009af100700";
const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_CHUNKED_TRANSFER = "00000020-0000-3512-2118-0009af100700";
+const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_WRITE = "00000016-0000-3512-2118-0009af100700";
+const char* MiBandService::UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_READ = "00000017-0000-3512-2118-0009af100700";
constexpr uint8_t MiBandService::DATEFORMAT_TIME[];
constexpr uint8_t MiBandService::DATEFORMAT_DATETIME[];
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/daemon/src/services/mibandservice.h
^
|
@@ -27,6 +27,8 @@
--00000008-0000-3512-2118-0009af100700 //User settings
--00000010-0000-3512-2118-0009af100700 //Device event
--0000000e-0000-3512-2118-0009af100700 //Weather
+--00000016-0000-3512-2118-0009af100700 //2021 Chunked Char Write
+--00000017-0000-3512-2118-0009af100700 //2021 Chunked Char Read
--00000020-0000-3512-2118-0009af100700 //Chunked transfer
*/
@@ -47,6 +49,8 @@
static const char* UUID_CHARACTERISTIC_MIBAND_ACTIVITY_DATA;
static const char* UUID_CHARACTERISTIC_MIBAND_WEATHER;
static const char* UUID_CHARACTERISTIC_MIBAND_CHUNKED_TRANSFER;
+ static const char* UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_WRITE;
+ static const char* UUID_CHARACTERISTIC_MIBAND_2021_CHUNKED_CHAR_READ;
static const uint8_t RESPONSE = 0x10;
static const uint8_t SUCCESS = 0x01;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/lib/src/amazfishconfig.h
^
|
@@ -120,6 +120,7 @@
BOOL_OPTION(QStringLiteral("app/notifylowbattery"), appNotifyLowBattery, setAppNotifyLowBattery, true)
BOOL_OPTION(QStringLiteral("app/overridefwcheck"), appOverrideFwCheck, setAppOverrideFwCheck, false)
BOOL_OPTION(QStringLiteral("app/navigationnotification"), appNavigationNotification, setAppNavigationNotification, false)
+ BOOL_OPTION(QStringLiteral("app/simulateevents"), appSimulateEventSupport, setSimulateEventSupport, false)
STRING_OPTION(QStringLiteral("app/button-double-action"), appButtonDoublePressAction, setAppButtonDoublePressAction, "action-none")
STRING_OPTION(QStringLiteral("app/button-triple-action"), appButtonTriplePressAction, setAppButtonTriplePressAction, "action-none")
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/lib/src/weather/currentweather.cpp
^
|
@@ -135,16 +135,20 @@
Forecast f;
f.setMaxTemperature(0);
f.setMinTemperature(500);
+ f.setWindMaxSpeed(0);
+ f.setWindMinSpeed(255);
qDebug() << object;
+ int total_rain = 0;
+ int total_snow = 0;
foreach (const QJsonValue & value, list) {
QJsonObject obj = value.toObject();
- qlonglong dt = obj.value("dt").toVariant().toLongLong() * 1000L;
+ qlonglong dt = obj.value("dt").toVariant().toLongLong();
- QDate d = QDateTime::fromMSecsSinceEpoch(dt).date();
- QTime t = QDateTime::fromMSecsSinceEpoch(dt).time();
+ QDate d = QDateTime::fromMSecsSinceEpoch(dt * 1000L).date();
+ QTime t = QDateTime::fromMSecsSinceEpoch(dt * 1000L).time();
QJsonObject weather = obj.value("weather").toArray().first().toObject();
@@ -154,22 +158,47 @@
QJsonObject main = obj.value("main").toObject();
int min_temp = int(main.value("temp_min").toDouble());
int max_temp = int(main.value("temp_max").toDouble());
+ int wind_speed = 0;
+ f.setWindMaxSpeed(0);
+ f.setWindMinSpeed(255);
+ if (obj.contains("rain")) {
+ QJsonObject rain = obj.value("rain").toObject();
+ total_rain += int(rain.value("3h").toDouble());
+ }
+ if (obj.contains("snow")) {
+ QJsonObject snow = obj.value("snow").toObject();
+ total_snow += int(snow.value("3h").toDouble());
+ }
+
+ if (obj.contains("wind")) {
+ QJsonObject wind = obj.value("wind").toObject();
+ wind_speed += int(wind.value("speed").toDouble());
+ }
- qDebug() << "Forecast on " << dt << d << t << min_temp << max_temp << desc << code;
+ qDebug() << "Forecast on " << dt << d << t << min_temp << max_temp << desc << code << "Hour:" << t.hour();
if (d > last_day) {
if (last_day != QDate::currentDate()) {
+ f.setRainMMDay(total_rain);
+ f.setSnowMMDay(total_snow);
m_forecasts << f;
}
last_day = d;
f.setMaxTemperature(0);
f.setMinTemperature(500);
+ f.setWindMaxSpeed(0);
+ f.setWindMinSpeed(255);
+ total_rain = 0;
+ total_snow = 0;
}
- if (t.hour() >12 && t.hour() <= 13) { //Set the general weather description for that around mid-day
+ if (t.hour() >=12 && t.hour() < 15) { //Set the general weather description for that around mid-day
+ qDebug() << "Midday" << main.value("pressure") << main.value("pressure").toDouble();
f.setDateTime(dt);
f.setDescription(desc);
f.setWeatherCode(code);
+ f.setPressure(int(main.value("pressure").toDouble()));
+ f.setHumidity(int(main.value("humidity").toDouble()));
}
if (max_temp > f.maxTemperature()){
f.setMaxTemperature(max_temp);
@@ -177,6 +206,12 @@
if (min_temp < f.minTemperature()) {
f.setMinTemperature(min_temp);
}
+ if (wind_speed > f.windMaxSpeed()) {
+ f.setWindMaxSpeed(wind_speed);
+ }
+ if (wind_speed < f.windMinSpeed()) {
+ f.setWindMinSpeed(wind_speed);
+ }
}
m_forecasts << f;
@@ -283,7 +318,7 @@
return m_maxTemperature;
}
-int CurrentWeather::dateTime() const
+qlonglong CurrentWeather::dateTime() const
{
return m_dateTime;
}
@@ -328,17 +363,97 @@
m_description = description;
}
-void CurrentWeather::Forecast::setDateTime(int dateTime)
+void CurrentWeather::Forecast::setDateTime(qlonglong dateTime)
{
m_dateTime = dateTime;
}
+uint8_t CurrentWeather::Forecast::rainMMDay() const
+{
+ return m_rainMMDay;
+}
+
+void CurrentWeather::Forecast::setRainMMDay(uint8_t newRainMMDay)
+{
+ m_rainMMDay = newRainMMDay;
+}
+
+uint8_t CurrentWeather::Forecast::snowMMDay() const
+{
+ return m_snowMMDay;
+}
+
+void CurrentWeather::Forecast::setSnowMMDay(uint8_t newSnowMMDay)
+{
+ m_snowMMDay = newSnowMMDay;
+}
+
+uint8_t CurrentWeather::Forecast::clouds() const
+{
+ return m_clouds;
+}
+
+void CurrentWeather::Forecast::setClouds(uint8_t newClouds)
+{
+ m_clouds = newClouds;
+}
+
+uint8_t CurrentWeather::Forecast::humidity() const
+{
+ return m_humidity;
+}
+
+void CurrentWeather::Forecast::setHumidity(uint8_t newHumidity)
+{
+ m_humidity = newHumidity;
+}
+
+uint8_t CurrentWeather::Forecast::pressure() const
+{
+ return m_pressure;
+}
+
+void CurrentWeather::Forecast::setPressure(uint8_t newPressure)
+{
+ m_pressure = newPressure;
+}
+
+uint8_t CurrentWeather::Forecast::windDirection() const
+{
+ return m_windDirection;
+}
+
+void CurrentWeather::Forecast::setWindDirection(uint8_t newWindDirection)
+{
+ m_windDirection = newWindDirection;
+}
+
+uint8_t CurrentWeather::Forecast::windMaxSpeed() const
+{
+ return m_windMaxSpeed;
+}
+
+void CurrentWeather::Forecast::setWindMaxSpeed(uint8_t newWindMaxSpeed)
+{
+ m_windMaxSpeed = newWindMaxSpeed;
+}
+
+uint8_t CurrentWeather::Forecast::windMinSpeed() const
+{
+ return m_windMinSpeed;
+}
+
+void CurrentWeather::Forecast::setWindMinSpeed(uint8_t newWindMinSpeed)
+{
+ m_windMinSpeed = newWindMinSpeed;
+}
+
QString CurrentWeather::Forecast::description() const
{
return m_description;
}
-int CurrentWeather::Forecast::dateTime() const
+qlonglong CurrentWeather::Forecast::dateTime() const
{
return m_dateTime;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/lib/src/weather/currentweather.h
^
|
@@ -58,16 +58,49 @@
void setDescription(const QString &description);
QString description() const;
- int dateTime() const;
- void setDateTime(int dateTime);
+ qlonglong dateTime() const;
+ void setDateTime(qlonglong dateTime);
+ uint8_t rainMMDay() const;
+ void setRainMMDay(uint8_t newRainMMDay);
+
+ uint8_t snowMMDay() const;
+ void setSnowMMDay(uint8_t newSnowMMDay);
+
+ uint8_t clouds() const;
+ void setClouds(uint8_t newClouds);
+
+ uint8_t humidity() const;
+ void setHumidity(uint8_t newHumidity);
+
+ uint8_t pressure() const;
+ void setPressure(uint8_t newPressure);
+
+ uint8_t windMinSpeed() const;
+ void setWindMinSpeed(uint8_t newWindMinSpeed);
+
+ uint8_t windMaxSpeed() const;
+ void setWindMaxSpeed(uint8_t newWindMaxSpeed);
+
+ uint8_t windDirection() const;
+ void setWindDirection(uint8_t newWindDirection);
private:
+ int m_temperature = 0;
int m_minTemperature = 0;
int m_maxTemperature = 0;
int m_weatherCode = 0;
QString m_description;
- int m_dateTime = 0;
+ qlonglong m_dateTime = 0;
+ uint8_t m_clouds = 0;
+ uint8_t m_windMinSpeed = 0;
+ uint8_t m_windMaxSpeed = 0;
+ uint8_t m_windDirection = 0;
+ uint8_t m_rainMMDay = 0;
+ uint8_t m_snowMMDay = 0;
+ uint8_t m_humidity = 0;
+ uint8_t m_pressure = 0;
+
};
@@ -81,7 +114,7 @@
int maxTemperature() const;
int weatherCode() const;
QString description() const;
- int dateTime() const;
+ qlonglong dateTime() const;
Q_INVOKABLE void refresh();
@@ -111,7 +144,7 @@
int m_maxTemperature = 0;
int m_weatherCode = 0;
QString m_description;
- int m_dateTime = 0;
+ qlonglong m_dateTime = 0;
QList<Forecast> m_forecasts;
};
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/media/screenshot_activity.png
^
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/media/screenshot_main.png
^
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/media/screenshot_sleep.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/harbour-amazfish-ui.desktop
^
|
@@ -4,6 +4,10 @@
Icon=harbour-amazfish-ui
Exec=harbour-amazfish-ui
Name=Amazfish
+
+[X-Sailjail]
+Sandboxing=Disabled
+
# translation example:
# your app name in German locale (de)
#
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/icons.qrc
^
|
@@ -26,5 +26,7 @@
<file>qml/custom-icons/icon-strava.png</file>
<file>qml/custom-icons/icon-m-cycling.png</file>
<file>qml/custom-icons/icon-m-indoor cycling.png</file>
+ <file>qml/custom-icons/icon-m-swimming.png</file>
+ <file>qml/custom-icons/icon-m-open swimming.png</file>
</qresource>
</RCC>
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/custom-icons/icon-m-open swimming.png
^
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/custom-icons/icon-m-swimming.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/harbour-amazfish.qml
^
|
@@ -62,7 +62,7 @@
id: checkState
interval: 5000
repeat: true
- running: true
+ running: ENABLE_SYSTEMD === "YES"
onTriggered: {
systemdServiceIface.updateProperties()
@@ -114,21 +114,22 @@
signalsEnabled: true
function updateProperties() {
- var activeProperty = systemdServiceIface.getProperty("ActiveState");
- if (activeProperty === "active") {
- serviceActiveState = true;
- } else {
- serviceActiveState = false;
- }
-
- var serviceEnabledProperty = systemdServiceIface.getProperty("UnitFileState");
- if (serviceEnabledProperty === "enabled") {
- serviceEnabledState = true;
- }
- else {
- serviceEnabledState = false;
+ if (ENABLE_SYSTEMD === "YES"){
+ var activeProperty = systemdServiceIface.getProperty("ActiveState");
+ if (activeProperty === "active") {
+ serviceActiveState = true;
+ } else {
+ serviceActiveState = false;
+ }
+
+ var serviceEnabledProperty = systemdServiceIface.getProperty("UnitFileState");
+ if (serviceEnabledProperty === "enabled") {
+ serviceEnabledState = true;
+ }
+ else {
+ serviceEnabledState = false;
+ }
}
-
}
onPropertiesChanged: updateProperties()
@@ -145,18 +146,21 @@
signal unitNew(string name)
onUnitNew: {
- if (name == "harbour-amazfish.service") {
+ if (name == "harbour-amazfish.service" && ENABLE_SYSTEMD === "YES") {
systemdServiceIface.updateProperties()
}
}
function enableService() {
- systemdManager.typedCall("EnableUnitFiles", [{"type":"as", "value":["harbour-amazfish.service"]}, {"type":"b", "value":false}, {"type":"b", "value":true}])
+ if(ENABLE_SYSTEMD === "YES") {
+ systemdManager.typedCall("EnableUnitFiles", [{"type":"as", "value":["harbour-amazfish.service"]}, {"type":"b", "value":false}, {"type":"b", "value":true}])
+ }
}
function disableService() {
- systemdManager.typedCall("DisableUnitFiles", [{"type":"as", "value":["harbour-amazfish.service"]}, {"type":"b", "value":false}])
-
+ if (ENABLE_SYSTEMD === "YES") {
+ systemdManager.typedCall("DisableUnitFiles", [{"type":"as", "value":["harbour-amazfish.service"]}, {"type":"b", "value":false}])
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/pages/FirstPage.qml
^
|
@@ -249,7 +249,7 @@
ButtonPL {
text: qsTr("Enable on boot")
- visible: serviceEnabledState == false
+ visible: serviceEnabledState == false && (ENABLE_SYSTEMD === "YES")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/pages/PairSelectDeviceType.qml
^
|
@@ -44,25 +44,25 @@
icon: "../pics/devices/amazfit-gts.png"
auth: true
}
-
+/*
ListElement {
- deviceType: "Amazfit GTS2"
+ deviceType: "Amazfit GTS 2"
icon: "../pics/devices/amazfit-gts2.png"
auth: true
}
-
+*/
ListElement {
deviceType: "Amazfit GTR"
icon: "../pics/devices/amazfit-gtr.png"
auth: true
}
-
+/*
ListElement {
- deviceType: "Amazfit GTR2"
+ deviceType: "Amazfit GTR 2"
icon: "../pics/devices/amazfit-gtr2.png"
auth: true
}
-
+*/
ListElement {
deviceType: "Amazfit Cor"
icon: "../pics/devices/amazfit-cor.png"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/pages/Settings-app.qml
^
|
@@ -59,6 +59,14 @@
text: qsTr("Navigation notifications")
}
+ TextSwitchPL {
+ id: chkSimulateEventSupport
+ visible: supportsFeature(Amazfish.FEATURE_ALERT) && !supportsFeature(Amazfish.FEATURE_EVENT_REMINDER)
+
+ width: parent.width
+ text: qsTr("Simulate event reminder support")
+ }
+
SectionHeaderPL {
text: qsTr("Refresh rates")
}
@@ -92,10 +100,12 @@
SectionHeaderPL {
text: qsTr("Amazfish Service")
+ visible: (ENABLE_SYSTEMD === "YES")
}
TextSwitchPL {
id: chkServiceEnabled
+ visible: (ENABLE_SYSTEMD === "YES")
checked: serviceEnabledState === false ? false : true
text: qsTr("Start service on boot")
onCheckedChanged: {
@@ -110,11 +120,12 @@
LabelPL {
width: parent.width
text: qsTr("Start/Stop the Amazfish Background Service")
+ visible: (ENABLE_SYSTEMD === "YES")
}
Row {
id: serviceButtonRow
-
+ visible: (ENABLE_SYSTEMD === "YES")
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
spacing: 10
@@ -166,6 +177,7 @@
chkAutoSyncData.checked = AmazfishConfig.appAutoSyncData;
chkNotifyLowBattery.checked = AmazfishConfig.appNotifyLowBattery;
chkNavigationNotification.checked = AmazfishConfig.appNavigationNotification;
+ chkSimulateEventSupport.checked = AmazfishConfig.appSimulateEventSupport;
}
function saveSettings() {
@@ -175,6 +187,7 @@
AmazfishConfig.appAutoSyncData = chkAutoSyncData.checked;
AmazfishConfig.appNotifyLowBattery = chkNotifyLowBattery.checked;
AmazfishConfig.appNavigationNotification = chkNavigationNotification.checked;
+ AmazfishConfig.appSimulateEventSupport = chkSimulateEventSupport.checked;
AmazfishConfig.localAdapter = cboLocalAdapter.value;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/pages/Settings-device.qml
^
|
@@ -19,7 +19,7 @@
id: cboLanguage
label: qsTr("Language")
- //"zh_CN", "zh_TW", "en_US", "es_ES", "ru_RU", "de_DE", "it_IT", "fr_FR", "tr_TR"
+ //"zh_CN", "zh_TW", "en_US", "es_ES", "ru_RU", "de_DE", "it_IT", "fr_FR", "tr_TR", "nl_NL"
model: ListModel {
ListElement { itemText: qsTr("en_US") }
ListElement { itemText: qsTr("es_ES") }
@@ -30,6 +30,7 @@
ListElement { itemText: qsTr("it_IT") }
ListElement { itemText: qsTr("fr_FR") }
ListElement { itemText: qsTr("tr_TR") }
+ ListElement { itemText: qsTr("nl_NL") }
}
Component.onCompleted: {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/pages/SportPage.qml
^
|
@@ -145,6 +145,7 @@
accessToken: "pk.eyJ1IjoiamRyZXNjaGVyIiwiYSI6ImNqYmVta256YTJsdjUzMm1yOXU0cmxibGoifQ.JiMiONJkWdr0mVIjajIFZQ"
cacheDatabaseDefaultPath: true
+ styleUrl: "mapbox://styles/mapbox/outdoors-v11"
visible: true
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/qml/tools/JSTools.js
^
|
@@ -224,13 +224,15 @@
[
{ name: "running", stravaType: "Run" },
{ name: "cycling", stravaType: "Ride" },
- { name: "mountainBiking", stravaType: "Ride" },
+ { name: "mountainbiking", stravaType: "Ride" },
{ name: "walking", stravaType: "Walk" },
- { name: "inlineSkating", stravaType: "InlineSkate" },
+ { name: "inlineskating", stravaType: "InlineSkate" },
{ name: "skiing", stravaType: "AlpineSki" },
{ name: "hiking", stravaType: "Hike" },
{ name: "indoor cycling", stravaType: "VirtualRide" },
- { name: "treadmill", stravaType: "VirtualRun" }
+ { name: "treadmill", stravaType: "VirtualRun" },
+ { name: "swimming", stravaType: "Swim" },
+ { name: "open swimming", stravaType: "Swim" }
]
function toStravaType(t)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/src/harbour-amazfish-ui.cpp
^
|
@@ -53,6 +53,10 @@
QCoreApplication::setApplicationName("harbour-amazfish");
QGuiApplication::setApplicationDisplayName("Amazfish");
+ // disable new QML connection syntax debug messages for as long as
+ // older Qt versions (5.12 and older) are supported
+ QLoggingCategory::setFilterRules(QStringLiteral("qt.qml.connections=false"));
+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
// add fallback icon path
QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << ":qml/custom-icons");
@@ -91,6 +95,12 @@
view->rootContext()->setContextProperty("STRAVA_CLIENT_SECRET", encryptDecrypt("}{s{--z*.x{y{ss///x/x){*xz{(|yy/{syr-/})"));
view->rootContext()->setContextProperty("STRAVA_CLIENT_ID", "13707");
+#ifdef DISABLE_SYSTEMD
+ view->rootContext()->setContextProperty("ENABLE_SYSTEMD", "NO");
+#else
+ view->rootContext()->setContextProperty("ENABLE_SYSTEMD", "YES");
+#endif
+
#ifdef MER_EDITION_SAILFISH
view->setSource(SailfishApp::pathTo("qml/harbour-amazfish.qml"));
view->show();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui-de.ts
^
|
@@ -256,12 +256,8 @@
<translation>Service</translation>
</message>
<message>
- <source>Start</source>
- <translation>Start</translation>
- </message>
- <message>
- <source>Enable</source>
- <translation>Aktivieren</translation>
+ <source>Enable on boot</source>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -305,6 +301,10 @@
<source>VO2 Max</source>
<translation>VO2 Max</translation>
</message>
+ <message>
+ <source>%1 bpm</source>
+ <translation type="unfinished">%1 bpm</translation>
+ </message>
</context>
<context>
<name>JSTools</name>
@@ -491,6 +491,61 @@
<source>Navigation notifications</source>
<translation>Navigationsbenachrichtigungen</translation>
</message>
+ <message>
+ <source>Simulate event reminder support</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Button Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Settings-button-action</name>
+ <message>
+ <source>Button Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Double Press Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Triple Press Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quad Press Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Settings</source>
+ <translation type="unfinished">Einstellungen speichern</translation>
+ </message>
+ <message>
+ <source>No Action</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next Track</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Previous Track</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Volume Up</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Volume Down</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Custom Script</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-device</name>
@@ -586,6 +641,10 @@
<source>Huami Display Items</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>nl_NL</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-huami-shortcuts</name>
@@ -685,6 +744,10 @@
<source>AliPay</source>
<translation>AliPay</translation>
</message>
+ <message>
+ <source>Timer</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-menu</name>
@@ -720,6 +783,10 @@
<source>Debug Info</source>
<translation>Debuginfo</translation>
</message>
+ <message>
+ <source>Strava</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-profile</name>
@@ -815,19 +882,6 @@
<translation>Schlaf</translation>
</message>
<message>
- <source>Note: last nights sleep is updated at mid-day</source>
- <translation>Notiz: Schlafdaten werden mittags aktualisiert</translation>
- </message>
- <message>
- <source>h:mm</source>
- <extracomment>Format of sleep hours</extracomment>
- <translation>Format der Schlafdaten</translation>
- </message>
- <message>
- <source>Deep %1</source>
- <translation>Tiefschlaf</translation>
- </message>
- <message>
<source>MM/dd</source>
<extracomment>Format for day on the sleep summary graph</extracomment>
<translation>Format für die Schlafdatenzusammenfassung</translation>
@@ -836,6 +890,14 @@
<source>Hours</source>
<translation>Stunden</translation>
</message>
+ <message>
+ <source>%1 hrs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Deep %1 hrs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SportPage</name>
@@ -869,7 +931,7 @@
</message>
<message>
<source>Max Altitude</source>
- <translation">Max. Höhe</translation>
+ <translation>Max. Höhe</translation>
</message>
<message>
<source>Min Altitude</source>
@@ -1007,6 +1069,10 @@
<source>swolf</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Send to Strava</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SportsSummaryPage</name>
@@ -1018,6 +1084,10 @@
<source>Download Next Activity</source>
<translation>Weitere Aktivitäten abrufen</translation>
</message>
+ <message>
+ <source>Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>StepsPage</name>
@@ -1027,6 +1097,88 @@
</message>
</context>
<context>
+ <name>StravaSettingsPage</name>
+ <message>
+ <source>Strava settings</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logout</source>
+ <translation type="unfinished"></translation>
+ </message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui-es.ts
^
|
@@ -495,6 +495,10 @@
<source>Button Actions</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Simulate event reminder support</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-button-action</name>
@@ -637,6 +641,10 @@
<source>Huami Display Items</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>nl_NL</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-huami-shortcuts</name>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui-nl.ts
^
|
@@ -0,0 +1,1192 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="nl_NL">
+<context>
+ <name>AddCityPage</name>
+ <message>
+ <source>Set Location</source>
+ <translation>Locatie instellen</translation>
+ </message>
+</context>
+<context>
+ <name>Alarm</name>
+ <message>
+ <source>Enabled</source>
+ <translation>Ingeschakeld</translation>
+ </message>
+ <message>
+ <source>Mon</source>
+ <translation>Ma</translation>
+ </message>
+ <message>
+ <source>Tue</source>
+ <translation>Di</translation>
+ </message>
+ <message>
+ <source>Wed</source>
+ <translation>Wo</translation>
+ </message>
+ <message>
+ <source>Thu</source>
+ <translation>Do</translation>
+ </message>
+ <message>
+ <source>Fri</source>
+ <translation>Vr</translation>
+ </message>
+ <message>
+ <source>Sat</source>
+ <translation>Za</translation>
+ </message>
+ <message>
+ <source>Sun</source>
+ <translation>Zo</translation>
+ </message>
+</context>
+<context>
+ <name>AnalysisPage</name>
+ <message>
+ <source>Analysis</source>
+ <translation>Analyse</translation>
+ </message>
+ <message>
+ <source>Heartrate</source>
+ <translation>Hartslag</translation>
+ </message>
+ <message>
+ <source>Steps</source>
+ <translation>Stappen</translation>
+ </message>
+ <message>
+ <source>Intensity</source>
+ <translation>Intensiteit</translation>
+ </message>
+</context>
+<context>
+ <name>AuthKeyDialog</name>
+ <message>
+ <source>Enter auth key</source>
+ <translation>Auth-sleutel invoeren</translation>
+ </message>
+</context>
+<context>
+ <name>BipFirmwarePage</name>
+ <message>
+ <source>Send file</source>
+ <translation>Verstuur bestand</translation>
+ </message>
+ <message>
+ <source>Download File</source>
+ <translation>Download bestand</translation>
+ </message>
+ <message>
+ <source>Select a file to download.</source>
+ <translation>Selecteer een bestand om te downloaden.</translation>
+ </message>
+ <message>
+ <source>None</source>
+ <translation>Geen</translation>
+ </message>
+ <message>
+ <source>Choose File</source>
+ <translation>Kies bestand</translation>
+ </message>
+ <message>
+ <source>File type/version: </source>
+ <translation>Bestandstype/-versie: </translation>
+ </message>
+ <message>
+ <source>File not supported on this device</source>
+ <translation>Bestand niet ondersteund op dit apparaat</translation>
+ </message>
+</context>
+<context>
+ <name>DaemonInterface</name>
+ <message>
+ <source>Unexpected error</source>
+ <translation>Onverwachte fout</translation>
+ </message>
+</context>
+<context>
+ <name>DebugInfo</name>
+ <message>
+ <source>Refresh</source>
+ <translation>Verversen</translation>
+ </message>
+ <message>
+ <source>Address: </source>
+ <translation>Adres: </translation>
+ </message>
+ <message>
+ <source>Serial No: </source>
+ <translation>Serienummer: </translation>
+ </message>
+ <message>
+ <source>Hardware Rev: </source>
+ <translation>Hardware-revisie: </translation>
+ </message>
+ <message>
+ <source>Software Rev: </source>
+ <translation>Software-revisie: </translation>
+ </message>
+ <message>
+ <source>Connection State: </source>
+ <translation>Verbindingsstatus: </translation>
+ </message>
+ <message>
+ <source>GPS Ver: </source>
+ <translation>GPS-versie: </translation>
+ </message>
+ <message>
+ <source>Test Notification</source>
+ <translation>Testmelding</translation>
+ </message>
+ <message>
+ <source>Test Email</source>
+ <translation>Test e-mail</translation>
+ </message>
+ <message>
+ <source>Test Call</source>
+ <translation>Test oproep</translation>
+ </message>
+ <message>
+ <source>Fetch debug log</source>
+ <translation>Foutenlogboek ophalen</translation>
+ </message>
+ <message>
+ <source>Test Popup</source>
+ <translation>Test melding</translation>
+ </message>
+ <message>
+ <source>Debugging</source>
+ <translation>Foutopsporing</translation>
+ </message>
+ <message>
+ <source>Information</source>
+ <translation>Informatie</translation>
+ </message>
+ <message>
+ <source>Model: </source>
+ <translation>Model: </translation>
+ </message>
+ <message>
+ <source>Firmware Rev: </source>
+ <translation>Firmware-revisie: </translation>
+ </message>
+ <message>
+ <source>Manufacturer: </source>
+ <translation>Fabrikant: </translation>
+ </message>
+ <message>
+ <source>A:</source>
+ <translation>A:</translation>
+ </message>
+ <message>
+ <source>S:</source>
+ <translation>S:</translation>
+ </message>
+ <message>
+ <source>Function Tests</source>
+ <translation>Functionele testen</translation>
+ </message>
+ <message>
+ <source>Send Weather</source>
+ <translation>Verstuur weer</translation>
+ </message>
+ <message>
+ <source>Update Calendar</source>
+ <translation>Agenda bijwerken</translation>
+ </message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui-ru.ts
^
|
@@ -495,6 +495,10 @@
<source>Button Actions</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Simulate event reminder support</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-button-action</name>
@@ -637,6 +641,10 @@
<source>Huami Display Items</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>nl_NL</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-huami-shortcuts</name>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui-sv.ts
^
|
@@ -495,6 +495,10 @@
<source>Button Actions</source>
<translation>Knappåtgärder</translation>
</message>
+ <message>
+ <source>Simulate event reminder support</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-button-action</name>
@@ -637,6 +641,10 @@
<source>Huami Display Items</source>
<translation>Huami skärmenheter</translation>
</message>
+ <message>
+ <source>nl_NL</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>Settings-huami-shortcuts</name>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/translations/harbour-amazfish-ui.ts
^
|
@@ -386,43 +386,43 @@
<name>JSTools</name>
<message>
<location filename="../qml/tools/JSTools.js" line="87"/>
- <location filename="../qml/tools/JSTools.js" line="295"/>
+ <location filename="../qml/tools/JSTools.js" line="297"/>
<source>Empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="88"/>
<location filename="../qml/tools/JSTools.js" line="89"/>
- <location filename="../qml/tools/JSTools.js" line="296"/>
- <location filename="../qml/tools/JSTools.js" line="297"/>
+ <location filename="../qml/tools/JSTools.js" line="298"/>
+ <location filename="../qml/tools/JSTools.js" line="299"/>
<source>Heartrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="90"/>
<location filename="../qml/tools/JSTools.js" line="91"/>
- <location filename="../qml/tools/JSTools.js" line="298"/>
- <location filename="../qml/tools/JSTools.js" line="299"/>
+ <location filename="../qml/tools/JSTools.js" line="300"/>
+ <location filename="../qml/tools/JSTools.js" line="301"/>
<source>Pace</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="92"/>
<location filename="../qml/tools/JSTools.js" line="93"/>
- <location filename="../qml/tools/JSTools.js" line="300"/>
- <location filename="../qml/tools/JSTools.js" line="301"/>
+ <location filename="../qml/tools/JSTools.js" line="302"/>
+ <location filename="../qml/tools/JSTools.js" line="303"/>
<source>Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="94"/>
- <location filename="../qml/tools/JSTools.js" line="302"/>
+ <location filename="../qml/tools/JSTools.js" line="304"/>
<source>Altitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="95"/>
- <location filename="../qml/tools/JSTools.js" line="303"/>
+ <location filename="../qml/tools/JSTools.js" line="305"/>
<source>Distance</source>
<translation type="unfinished"></translation>
</message>
@@ -433,7 +433,7 @@
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="97"/>
- <location filename="../qml/tools/JSTools.js" line="304"/>
+ <location filename="../qml/tools/JSTools.js" line="306"/>
<source>Duration</source>
<translation type="unfinished"></translation>
</message>
@@ -548,28 +548,28 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="63"/>
+ <location filename="../qml/pages/Settings-app.qml" line="71"/>
<source>Refresh rates</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="80"/>
+ <location filename="../qml/pages/Settings-app.qml" line="88"/>
<source>Refresh weather every (</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="80"/>
- <location filename="../qml/pages/Settings-app.qml" line="89"/>
+ <location filename="../qml/pages/Settings-app.qml" line="88"/>
+ <location filename="../qml/pages/Settings-app.qml" line="97"/>
<source>) minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="89"/>
+ <location filename="../qml/pages/Settings-app.qml" line="97"/>
<source>Refresh calendar every (</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="69"/>
+ <location filename="../qml/pages/Settings-app.qml" line="77"/>
<source>Sync activity data each hour</source>
<translation type="unfinished"></translation>
</message>
@@ -594,37 +594,42 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="94"/>
+ <location filename="../qml/pages/Settings-app.qml" line="67"/>
+ <source>Simulate event reminder support</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings-app.qml" line="102"/>
<source>Amazfish Service</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="100"/>
+ <location filename="../qml/pages/Settings-app.qml" line="110"/>
<source>Start service on boot</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="112"/>
+ <location filename="../qml/pages/Settings-app.qml" line="122"/>
<source>Start/Stop the Amazfish Background Service</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="124"/>
+ <location filename="../qml/pages/Settings-app.qml" line="135"/>
<source>Start</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="133"/>
+ <location filename="../qml/pages/Settings-app.qml" line="144"/>
<source>Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="143"/>
+ <location filename="../qml/pages/Settings-app.qml" line="154"/>
<source>Button Actions</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-app.qml" line="155"/>
+ <location filename="../qml/pages/Settings-app.qml" line="166"/>
<source>Save Settings</source>
<translation type="unfinished"></translation>
</message>
@@ -745,62 +750,67 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="42"/>
+ <location filename="../qml/pages/Settings-device.qml" line="33"/>
+ <source>nl_NL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Settings-device.qml" line="43"/>
<source>Date Display</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="45"/>
+ <location filename="../qml/pages/Settings-device.qml" line="46"/>
<source>Time</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="46"/>
+ <location filename="../qml/pages/Settings-device.qml" line="47"/>
<source>Date/Time</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="56"/>
+ <location filename="../qml/pages/Settings-device.qml" line="57"/>
<source>Time Format</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="60"/>
+ <location filename="../qml/pages/Settings-device.qml" line="61"/>
<source>12hr</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="94"/>
+ <location filename="../qml/pages/Settings-device.qml" line="95"/>
<source>Huami Display Items</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="59"/>
+ <location filename="../qml/pages/Settings-device.qml" line="60"/>
<source>24hr</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/Settings-device.qml" line="70"/>
+ <location filename="../qml/pages/Settings-device.qml" line="71"/>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.4.tar.bz2/ui/ui.pro
^
|
@@ -167,6 +167,7 @@
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-amazfish-ui-de.ts \
+ translations/harbour-amazfish-ui-nl.ts \
translations/harbour-amazfish-ui-ru.ts \
translations/harbour-amazfish-ui-sv.ts \
translations/harbour-amazfish-ui-es.ts
@@ -194,6 +195,10 @@
error("Please specify platform using FLAVOR=platform as qmake option. Supported platforms: kirigami, silica, qtcontrols, uuitk.")
}
+equals(DISABLE_SYSTEMD, "yes") {
+ DEFINES += DISABLE_SYSTEMD
+}
+
flavor_silica {
message(SailfishOS build)
CONFIG += sailfishapp sailfishapp_no_deploy_qml sailfishapp_i18n
|