[-]
[+]
|
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.5</param>
+ <param name="revision">2.0.6</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/README.md
^
|
@@ -18,6 +18,7 @@
These are devices I have, have tested and will try not to break any functioanlity for an include:
* Amazfit Bip
* Amazfit GTS
+ * Amazfit GTR2
* Pinetime Infinitme
* Bangle.js
@@ -26,14 +27,31 @@
These are devices which are properly implemented in the application, but I do not have and are tested by the commuity, and include:
* Amazfit BipS
* Amazfit Bip Lite
+ * Amazfit GTS2
+
I do not promise not to break funcaionality in these, but will fix where I can
### Bronze
These are devices which use a protocol that is close to another suppored device, and so is treated like that device. Your mileage may vary with these devices.
* MiBand 2/3/4
- * AMzfit Cor
- * Amazfit GTR
+ * Amazfit Cor
+
+## Note for GTR2 / GTS2 owners
+
+These watches fail to follow the bluetooth specification, which states that the "Appearance" characterstic should be readable without auth/encryption. Infact, it seems this
+characterstic is not readnable at all, even though it is available, and this causes a failure in Bluez. It seems like Android/iOS are less strict in this regard.
+
+A patch has been added to Bluez which makes it not read the characteristic if it has previously been read and cached, and this allows us to work around the issue.
+
+The device cache is in /var/lib/bluetooth/[host mac address]/[watch mac address/info.
+
+As root, add the line
+Appearance=0x0192
+under the [General] heading and restart bluetooth with
+systemctl restart bluetooth
+
+Do this after pairing the watch in Amazfish.
## Powered by KEXI
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/daemon.pro
^
|
@@ -97,9 +97,12 @@
src/devices/bipdevice.cpp \
src/devices/bipsdevice.cpp \
src/devices/gtr2device.cpp \
+ src/devices/gtr2firmwareinfo.cpp \
src/devices/gtrdevice.cpp \
src/devices/gts2device.cpp \
+ src/devices/gts2firmwareinfo.cpp \
src/devices/huamidevice.cpp \
+ src/devices/huamifirmwareinfo.cpp \
src/devices/infinitimefirmwareinfo.cpp \
src/navigationinterface.cpp \
src/devices/abstractfirmwareinfo.cpp \
@@ -161,9 +164,12 @@
src/devices/bipdevice.h \
src/devices/bipsdevice.h \
src/devices/gtr2device.h \
+ src/devices/gtr2firmwareinfo.h \
src/devices/gtrdevice.h \
src/devices/gts2device.h \
+ src/devices/gts2firmwareinfo.h \
src/devices/huamidevice.h \
+ src/devices/huamifirmwareinfo.h \
src/devices/infinitimefirmwareinfo.h \
src/navigationinterface.h \
src/devices/abstractfirmwareinfo.h \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/activitykind.cpp
^
|
@@ -25,6 +25,10 @@
return JumpRope;
} else if (type == 60) {
return Yoga;
+ } else if (type == 11) {
+ return TrailRunning;
+ } else if (type == 105) {
+ return Skiing;
}
return Activity;
}
@@ -82,6 +86,12 @@
if (type == Yoga) {
return "Yoga";
}
+ if (type == TrailRunning) {
+ return "Trail Running";
+ }
+ if (type == Skiing) {
+ return "Skiing";
+ }
return "Unknown";
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/activitykind.h
^
|
@@ -23,7 +23,9 @@
IndoorCycling = 0x00000800,
EllipticalTrainer = 0x00001000,
JumpRope = 0x00002000,
- Yoga = 0x00004000
+ Yoga = 0x00004000,
+ TrailRunning = 0x00008000,
+ Skiing = 0x00010000
};
static Type fromBipType(int type);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/deviceinterface.cpp
^
|
@@ -119,7 +119,8 @@
connect(m_device, &AbstractDevice::buttonPressed, this, &DeviceInterface::handleButtonPressed, Qt::UniqueConnection);
connect(m_device, &AbstractDevice::informationChanged, this, &DeviceInterface::slot_informationChanged, Qt::UniqueConnection);
connect(m_device, &AbstractDevice::deviceEvent, this, &DeviceInterface::deviceEvent, Qt::UniqueConnection);
- return m_device->pair();
+ m_device->pair();
+ return "pairing";
}
qDebug() << "DeviceInterface::pair:device not created";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/abstractdevice.cpp
^
|
@@ -4,16 +4,19 @@
AbstractDevice::AbstractDevice(const QString &pairedName, QObject *parent) : QBLEDevice(parent)
{
+ qDebug() << Q_FUNC_INFO;
+
setConnectionState("disconnected");
m_pairedName = pairedName;
m_reconnectTimer = new QTimer(this);
m_reconnectTimer->setInterval(60000);
connect(m_reconnectTimer, &QTimer::timeout, this, &AbstractDevice::reconnectionTimer);
+ //connect(this, &QBLEDevice::pairFinished, this, &AbstractDevice::devicePairFinished);
}
-QString AbstractDevice::pair()
+void AbstractDevice::pair()
{
- qDebug() << "AbstractDevice::pair";
+ qDebug() << Q_FUNC_INFO;
m_needsAuth = true;
m_pairing = true;
@@ -22,21 +25,6 @@
setConnectionState("pairing");
QBLEDevice::pair();
- QBLEDevice::connectToDevice();
- return "pairing";
-}
-
-void AbstractDevice::pairAsync()
-{
- qDebug() << "AbstractDevice::pairAsync";
-
- m_needsAuth = true;
- m_pairing = true;
- m_autoreconnect = true;
- //disconnectFromDevice();
- setConnectionState("pairing");
-
- QBLEDevice::pairAsync();
}
void AbstractDevice::connectToDevice()
@@ -71,8 +59,17 @@
}
}
+void AbstractDevice::devicePairFinished(const QString &status)
+{
+ qDebug() << Q_FUNC_INFO;
+ if (status == "paired") {
+ setConnectionState("paired");
+ }
+}
+
void AbstractDevice::setConnectionState(const QString &state)
{
+ qDebug() << Q_FUNC_INFO << state;
if (state != m_connectionState) {
m_connectionState = state;
emit connectionStateChanged();
@@ -84,12 +81,12 @@
return m_connectionState;
}
-bool AbstractDevice::supportsFeature(AbstractDevice::Feature f)
+bool AbstractDevice::supportsFeature(AbstractDevice::Feature f) const
{
return (supportedFeatures() & f) == f;
}
-QString AbstractDevice::deviceName()
+QString AbstractDevice::deviceName() const
{
return m_pairedName;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/abstractdevice.h
^
|
@@ -74,18 +74,17 @@
explicit AbstractDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual QString pair() override;
- virtual void pairAsync() override;
+ virtual void pair() override;
virtual void connectToDevice() override;
virtual void disconnectFromDevice() override;
virtual QString connectionState() const;
- bool supportsFeature(Feature f);
- virtual int supportedFeatures() = 0;
+ bool supportsFeature(Feature f) const;
+ virtual int supportedFeatures() const = 0;
- virtual QString deviceType() = 0;
- QString deviceName();
+ virtual QString deviceType() const = 0;
+ QString deviceName() const;
virtual void abortOperations();
//Firmware handling
@@ -129,6 +128,7 @@
private:
void reconnectionTimer();
+ void devicePairFinished(const QString& status);
QString m_pairedName;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/banglejsdevice.cpp
^
|
@@ -9,7 +9,7 @@
connect(this, &QBLEDevice::propertiesChanged, this, &BangleJSDevice::onPropertiesChanged, Qt::UniqueConnection);
}
-QString BangleJSDevice::pair()
+void BangleJSDevice::pair()
{
qDebug() << Q_FUNC_INFO;
@@ -21,10 +21,9 @@
emit connectionStateChanged();
QBLEDevice::connectToDevice();
- return "pairing";
}
-int BangleJSDevice::supportedFeatures()
+int BangleJSDevice::supportedFeatures() const
{
return FEATURE_HRM |
FEATURE_ALERT |
@@ -32,7 +31,7 @@
FEATURE_WEATHER;
}
-QString BangleJSDevice::deviceType()
+QString BangleJSDevice::deviceType() const
{
return "pinetimejf";
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/banglejsdevice.h
^
|
@@ -9,9 +9,9 @@
public:
explicit BangleJSDevice(const QString &pairedName, QObject *parent = 0);
- virtual QString pair() override;
- virtual int supportedFeatures() override;
- virtual QString deviceType() override;
+ virtual void pair() override;
+ virtual int supportedFeatures() const override;
+ virtual QString deviceType() const override;
virtual void abortOperations() override;
virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/bipdevice.cpp
^
|
@@ -7,11 +7,10 @@
BipDevice::BipDevice(const QString &pairedName, QObject *parent) : HuamiDevice(pairedName, parent)
{
qDebug() << Q_FUNC_INFO;
- connect(this, &QBLEDevice::propertiesChanged, this, &BipDevice::onPropertiesChanged);
}
-int BipDevice::supportedFeatures()
+int BipDevice::supportedFeatures() const
{
return FEATURE_HRM |
FEATURE_WEATHER |
@@ -22,7 +21,7 @@
FEATURE_BUTTON_ACTION;
}
-QString BipDevice::deviceType()
+QString BipDevice::deviceType() const
{
return "amazfitbip";
}
@@ -77,29 +76,6 @@
}
}
-void BipDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
-{
- qDebug() << Q_FUNC_INFO << interface << map << list;
-
- if (interface == "org.bluez.Device1") {
- m_reconnectTimer->start();
- if (deviceProperty("ServicesResolved").toBool() ) {
- initialise();
- }
- if (map.contains("Connected")) {
- bool value = map["Connected"].toBool();
-
- if (!value) {
- qDebug() << "DisConnected!";
- setConnectionState("disconnected");
- } else {
- setConnectionState("connected");
- }
- }
- }
-
-}
-
void BipDevice::sendWeather(CurrentWeather *weather)
{
sendWeatherHuami(weather, (softwareRevision() > "V0.0.8.74"));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/bipdevice.h
^
|
@@ -83,8 +83,8 @@
public:
explicit BipDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual int supportedFeatures() override;
- virtual QString deviceType() override;
+ virtual int supportedFeatures() const override;
+ virtual QString deviceType() const override;
virtual QStringList supportedDisplayItems() const override;
virtual void applyDeviceSetting(AbstractDevice::Settings s) override;
@@ -96,8 +96,7 @@
virtual void navigationNarrative(const QString &flag, const QString &narrative, const QString &manDist, int progress) override;
protected:
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
- virtual void initialise();
+ void initialise() override;
private:
void parseServices();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/bipfirmwareinfo.h
^
|
@@ -4,9 +4,9 @@
#include <QByteArray>
#include <QString>
#include <QMap>
-#include "abstractfirmwareinfo.h"
+#include "huamifirmwareinfo.h"
-class BipFirmwareInfo final : public AbstractFirmwareInfo
+class BipFirmwareInfo final : public HuamiFirmwareInfo
{
public:
explicit BipFirmwareInfo(const QByteArray &bytes);
@@ -17,59 +17,6 @@
void determineFirmwareType();
void determineFirmwareVersion();
- const uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
- 0x48, 0x4d, 0x52, 0x45, 0x53
- };
-
- const uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
- 0x4e, 0x45, 0x52, 0x45, 0x53
- };
-
- const uint8_t WATCHFACE_HEADER[6] = {
- 0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
- };
-
- const uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
- 0x48, 0x4d, 0x5a, 0x4b
- };
-
- const uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
- 0x4e, 0x45, 0x5a, 0x4b
- };
-
- const uint8_t GPS_HEADER[16] = {
- 0xcb, 0x51, 0xc1, 0x30, 0x41, 0x9e, 0x5e, 0xd3,
- 0x51, 0x35, 0xdf, 0x66, 0xed, 0xd9, 0x5f, 0xa7
- };
-
- const uint8_t GPS_HEADER2[16] = {
- 0x10, 0x50, 0x26, 0x76, 0x8f, 0x4a, 0xa1, 0x49,
- 0xa7, 0x26, 0xd0, 0xe6, 0x4a, 0x21, 0x88, 0xd4
- };
-
- const uint8_t GPS_HEADER3[16] = {
- 0xeb, 0xfa, 0xc5, 0x89, 0xf0, 0x5c, 0x2e, 0xcc,
- 0xfa, 0xf3, 0x62, 0xeb, 0x92, 0xc6, 0xa1, 0xbb
- };
-
- const uint8_t GPS_HEADER4[16] = {
- 0x0b, 0x61, 0x53, 0xed, 0x83, 0xac, 0x07, 0x21,
- 0x8c, 0x36, 0x2e, 0x8c, 0x9c, 0x08, 0x54, 0xa6
- };
-
- // this is the same as Cor
- const uint8_t FW_HEADER[16] = {
- 0x00, 0x98, 0x00, 0x20, 0xA5, 0x04, 0x00, 0x20, 0xAD, 0x04, 0x00, 0x20, 0xC5, 0x04, 0x00, 0x20
- };
-
- const uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
- 0xa0, 0x80, 0x08, 0x00, 0x8b
- };
-
- const uint8_t GPS_CEP_HEADER[4]{ // probably wrong
- 0x2a, 0x12, 0xa0, 0x02
- };
-
QMap<uint16_t, QString> m_crcMap;
void populateCrcMap();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/biplitedevice.cpp
^
|
@@ -7,43 +7,11 @@
qDebug() << "Creating Bip Lite Device";
}
-QString BipLiteDevice::deviceType()
+QString BipLiteDevice::deviceType() const
{
return "amazfitbiplite";
}
-void BipLiteDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
-{
- qDebug() << "BipLiteDevice::onPropertiesChanged:" << interface << map << list;
-
- if (interface == "org.bluez.Device1") {
- m_reconnectTimer->start();
- if (deviceProperty("ServicesResolved").toBool() ) {
- initialise();
- }
- if (map.contains("Connected")) {
- bool value = map["Connected"].toBool();
-
- if (!value) {
- qDebug() << "DisConnected!";
- setConnectionState("disconnected");
- } else {
- setConnectionState("connected");
- }
- } else if (map.contains("Paired")) {
- bool value = map["Paired"].toBool();
-
- if (value) {
- qDebug() << "Paired!";
- if (m_connectionState == "pairing" && m_pairing) {
- connectToDevice();
- }
- }
- }
- }
-
-}
-
void BipLiteDevice::initialise()
{
setConnectionState("connected");
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/biplitedevice.h
^
|
@@ -9,15 +9,14 @@
public:
explicit BipLiteDevice(const QString &pairedName, QObject *parent = 0);
- virtual QString deviceType() override;
+ virtual QString deviceType() const override;
virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
private:
- void initialise();
+ void initialise() override;
void parseServices();
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list) override;
private:
QString pairedName;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/biplitefirmwareinfo.h
^
|
@@ -1,9 +1,9 @@
#ifndef BIPLITEFIRMWAREINFO_H
#define BIPLITEFIRMWAREINFO_H
-#include "abstractfirmwareinfo.h"
+#include "huamifirmwareinfo.h"
-class BipLiteFirmwareInfo : public AbstractFirmwareInfo
+class BipLiteFirmwareInfo : public HuamiFirmwareInfo
{
public:
explicit BipLiteFirmwareInfo(const QByteArray &bytes);
@@ -14,58 +14,6 @@
void determineFirmwareType();
void determineFirmwareVersion();
- const uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
- 0x48, 0x4d, 0x52, 0x45, 0x53
- };
-
- const uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
- 0x4e, 0x45, 0x52, 0x45, 0x53
- };
-
- const uint8_t WATCHFACE_HEADER[6] = {
- 0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
- };
-
- const uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
- 0x48, 0x4d, 0x5a, 0x4b
- };
-
- const uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
- 0x4e, 0x45, 0x5a, 0x4b
- };
-
- const uint8_t GPS_HEADER[16] = {
- 0xcb, 0x51, 0xc1, 0x30, 0x41, 0x9e, 0x5e, 0xd3,
- 0x51, 0x35, 0xdf, 0x66, 0xed, 0xd9, 0x5f, 0xa7
- };
-
- const uint8_t GPS_HEADER2[16] = {
- 0x10, 0x50, 0x26, 0x76, 0x8f, 0x4a, 0xa1, 0x49,
- 0xa7, 0x26, 0xd0, 0xe6, 0x4a, 0x21, 0x88, 0xd4
- };
-
- const uint8_t GPS_HEADER3[16] = {
- 0xeb, 0xfa, 0xc5, 0x89, 0xf0, 0x5c, 0x2e, 0xcc,
- 0xfa, 0xf3, 0x62, 0xeb, 0x92, 0xc6, 0xa1, 0xbb
- };
-
- const uint8_t GPS_HEADER4[16] = {
- 0x0b, 0x61, 0x53, 0xed, 0x83, 0xac, 0x07, 0x21,
- 0x8c, 0x36, 0x2e, 0x8c, 0x9c, 0x08, 0x54, 0xa6
- };
-
- // this is the same as Cor
- const uint8_t FW_HEADER[16] = {
- 0x00, 0x98, 0x00, 0x20, 0xA5, 0x04, 0x00, 0x20, 0xAD, 0x04, 0x00, 0x20, 0xC5, 0x04, 0x00, 0x20
- };
-
- const uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
- 0xa0, 0x80, 0x08, 0x00, 0x8b
- };
-
- const uint8_t GPS_CEP_HEADER[4]{ // probably wrong
- 0x2a, 0x12, 0xa0, 0x02
- };
QMap<uint16_t, QString> m_crcMap;
void populateCrcMap();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/bipsdevice.cpp
^
|
@@ -7,12 +7,12 @@
qDebug() << Q_FUNC_INFO;
}
-QString BipSDevice::deviceType()
+QString BipSDevice::deviceType() const
{
return "amazfitbips";
}
-int BipSDevice::supportedFeatures()
+int BipSDevice::supportedFeatures() const
{
return FEATURE_HRM |
FEATURE_WEATHER |
@@ -122,29 +122,6 @@
}
}
-void BipSDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
-{
- qDebug() << Q_FUNC_INFO << interface << map << list;
-
- if (interface == "org.bluez.Device1") {
- m_reconnectTimer->start();
- if (deviceProperty("ServicesResolved").toBool() ) {
- initialise();
- }
- if (map.contains("Connected")) {
- bool value = map["Connected"].toBool();
-
- if (!value) {
- qDebug() << "DisConnected!";
- setConnectionState("disconnected");
- } else {
- setConnectionState("connected");
- }
- }
- }
-
-}
-
void BipSDevice::applyDeviceSetting(AbstractDevice::Settings s)
{
MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/bipsdevice.h
^
|
@@ -9,8 +9,8 @@
public:
explicit BipSDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual QString deviceType() override;
- virtual int supportedFeatures() override;
+ virtual QString deviceType() const override;
+ virtual int supportedFeatures() const override;
virtual QStringList supportedDisplayItems() const override;
virtual void applyDeviceSetting(Settings s) override;
@@ -20,13 +20,11 @@
virtual void setMusicStatus(bool playing, const QString &artist, const QString &album, const QString &track, int duration = 0, int position = 0) override;
protected:
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list) override;
+ void initialise() override;
private:
Q_SLOT void serviceEvent(uint8_t event);
-
void parseServices();
- void initialise();
};
#endif // BIPSDEVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtr2device.cpp
^
|
@@ -1,6 +1,16 @@
#include "gtr2device.h"
+#include "gtr2firmwareinfo.h"
-Gtr2Device::Gtr2Device(const QString &pairedName, QObject *parent) : GtrDevice(pairedName,parent)
+Gtr2Device::Gtr2Device(const QString &pairedName, QObject *parent) : Gts2Device(pairedName,parent)
{
- m_ActivitySampleSize = 8;
+}
+
+QString Gtr2Device::deviceType() const
+{
+ return "amazfitgtr2";
+}
+
+AbstractFirmwareInfo *Gtr2Device::firmwareInfo(const QByteArray &bytes)
+{
+ return new Gtr2FirmwareInfo(bytes);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtr2device.h
^
|
@@ -1,13 +1,16 @@
#ifndef GTR2DEVICE_H
#define GTR2DEVICE_H
-#include "gtrdevice.h"
+#include "gts2device.h"
#include <QObject>
-class Gtr2Device : public GtrDevice
+class Gtr2Device : public Gts2Device
{
public:
explicit Gtr2Device(const QString &pairedName, QObject *parent = nullptr);
+ QString deviceType() const override;
+ virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+
};
#endif // GTR2DEVICE_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtr2firmwareinfo.cpp
^
|
@@ -0,0 +1,96 @@
+#include "gtr2firmwareinfo.h"
+
+Gtr2FirmwareInfo::Gtr2FirmwareInfo(const QByteArray &bytes) : HuamiFirmwareInfo()
+{
+ m_bytes = bytes;
+
+ calculateCRC16();
+ calculateCRC32();
+ determineFirmwareType();
+ determineFirmwareVersion();
+
+ //qDebug() << mBytes;
+ qDebug() << m_type << m_version << m_crc16 << m_crc32;
+}
+
+bool Gtr2FirmwareInfo::supportedOnDevice(const QString &device) const
+{
+ qDebug() << "Checking if device suppoerted: " << device;
+ return device == "Amazfit GTR 2" && m_type != Invalid && !m_version.contains("unknown");
+}
+
+void Gtr2FirmwareInfo::determineFirmwareType() {
+ qDebug() << "Determining firmware type";
+ m_type = Invalid;
+
+ if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(NEWRES_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Res_Compressed;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER2)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER3)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER4))) {
+ m_type = GPS;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_ALMANAC_HEADER))) {
+ m_type = GPS_ALMANAC;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(AGPS_UIHH_HEADER))) {
+ m_type = GPS_UIHH;
+ }
+// if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(FW_HEADER2)) == FW_OFFSET) {
+// m_version = m_crcMap[m_crc16];
+// qDebug() << "Version:" << m_version << "CRC:" << m_crc16;
+// m_type = Firmware;
+// }
+
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Watchface;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(NEWFT_HEADER))) {
+ if (m_bytes.at(10) == 0x01) {
+ m_type = Font;
+ } else if (m_bytes.at(10) == 0x02) {
+ m_type = Font_Latin;
+ }
+ }
+}
+
+void Gtr2FirmwareInfo::determineFirmwareVersion()
+{
+ QString version;
+
+ switch (m_type) {
+ case Firmware:
+ version = "FW (unknown)";
+ break;
+ case Res:
+ version = "RES (unknown)";
+ break;
+ case Res_Compressed:
+ version = "RES_COMPRESSED (unknown)";
+ break;
+ case Font:
+ version = "FONT (unknown)";
+ break;
+ case Font_Latin:
+ version = "FONT LATIN (unknown)";
+ break;
+ case GPS:
+ version = "GPS (unknown)";
+ break;
+ case GPS_CEP:
+ version = "CEP";
+ break;
+ case GPS_UIHH:
+ version = "GPS_UIHH";
+ break;
+ case GPS_ALMANAC:
+ version = "ALM";
+ break;
+ case Watchface:
+ version = "Watchface";
+ break;
+ default:
+ version = "(unknown)";
+ }
+
+ m_version = version;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtr2firmwareinfo.h
^
|
@@ -0,0 +1,19 @@
+#ifndef GTR2FIRMWAREINFO_H
+#define GTR2FIRMWAREINFO_H
+
+#include "huamifirmwareinfo.h"
+
+class Gtr2FirmwareInfo : public HuamiFirmwareInfo
+{
+public:
+ explicit Gtr2FirmwareInfo(const QByteArray &bytes);
+
+ virtual bool supportedOnDevice(const QString &device) const override;
+
+private:
+ void determineFirmwareType();
+ void determineFirmwareVersion();
+
+};
+
+#endif // GTR2FIRMWAREINFO_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtrdevice.cpp
^
|
@@ -8,35 +8,9 @@
connect(this, &QBLEDevice::propertiesChanged, this, &GtrDevice::onPropertiesChanged, Qt::UniqueConnection);
}
-void GtrDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
+QString GtrDevice::deviceType() const
{
- qDebug() << Q_FUNC_INFO << interface << map << list;
-
- if (interface == "org.bluez.Device1") {
- m_reconnectTimer->start();
- if (deviceProperty("ServicesResolved").toBool() ) {
- initialise();
- }
- if (map.contains("Connected")) {
- bool value = map["Connected"].toBool();
-
- if (!value) {
- qDebug() << "DisConnected!";
- setConnectionState("disconnected");
- } else {
- setConnectionState("connected");
- }
- } else if (map.contains("Paired")) {
- bool value = map["Paired"].toBool();
-
- if (value) {
- qDebug() << "Paired!";
- if (m_connectionState == "pairing" && m_pairing) {
- connectToDevice();
- }
- }
- }
- }
+ return "amazfitgtr";
}
bool GtrDevice::is47mm(const QString &version) const
@@ -55,15 +29,6 @@
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);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtrdevice.h
^
|
@@ -8,12 +8,13 @@
{
public:
explicit GtrDevice(const QString &pairedName, QObject *parent = nullptr);
+ QString deviceType() const override;
-private:
+protected:
void initialise() override;
- void parseServices() override;
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list) override;
+ void parseServices();
+private:
bool is47mm(const QString &version) const;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gts2device.cpp
^
|
@@ -1,6 +1,88 @@
#include "gts2device.h"
+#include "gts2firmwareinfo.h"
Gts2Device::Gts2Device(const QString &pairedName, QObject *parent) : GtsDevice(pairedName, parent)
{
+ qDebug() << Q_FUNC_INFO;
m_ActivitySampleSize = 8;
}
+
+QString Gts2Device::deviceType() const
+{
+ return "amazfitgts2";
+}
+
+QStringList Gts2Device::supportedDisplayItems() const
+{
+ QStringList items;
+
+ items << "goal";
+ items << "pai";
+ items << "hr";
+ items << "workout";
+ items << "activity";
+ items << "weather";
+ items << "alarm";
+ items << "events"; //schedule?
+ items << "stress";
+ items << "spo2";
+ items << "music";
+ items << "widgets";
+ items << "settings";
+
+ return items;
+}
+
+AbstractFirmwareInfo *Gts2Device::firmwareInfo(const QByteArray &bytes)
+{
+ return new Gts2FirmwareInfo(bytes);
+}
+
+void Gts2Device::initialise()
+{
+ qDebug() << Q_FUNC_INFO;
+ parseServices();
+
+ MiBandService *mi = qobject_cast<MiBandService*>(service(MiBandService::UUID_SERVICE_MIBAND));
+ if (mi) {
+ 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);
+
+ connect(mi, &MiBandService::message, this, &HuamiDevice::message, Qt::UniqueConnection);
+ connect(mi, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
+ connect(mi, &MiBandService::buttonPressed, this, &Gts2Device::handleButtonPressed, Qt::UniqueConnection);
+ connect(mi, &MiBandService::informationChanged, this, &HuamiDevice::informationChanged, Qt::UniqueConnection);
+ connect(mi, &MiBandService::serviceEvent, this, &Gts2Device::serviceEvent, Qt::UniqueConnection);
+ }
+
+ MiBand2Service *mi2 = qobject_cast<MiBand2Service*>(service(MiBand2Service::UUID_SERVICE_MIBAND2));
+ if (mi2) {
+ qDebug() << "Got mi2 service";
+ connect(mi2, &MiBand2Service::authenticated, this, &HuamiDevice::authenticated, Qt::UniqueConnection);
+ connect(mi2, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
+
+ mi2->enableNotification(MiBand2Service::UUID_CHARACTERISITIC_MIBAND2_AUTH);
+ }
+
+ if (mi2) {
+ mi2->initialise(false);
+ }
+
+ BipFirmwareService *fw = qobject_cast<BipFirmwareService*>(service(BipFirmwareService::UUID_SERVICE_FIRMWARE));
+ if (fw) {
+ connect(fw, &BipFirmwareService::message, this, &HuamiDevice::message, Qt::UniqueConnection);
+ connect(fw, &BipFirmwareService::downloadProgress, this, &HuamiDevice::downloadProgress, Qt::UniqueConnection);
+ connect(fw, &QBLEService::operationRunningChanged, this, &QBLEDevice::operationRunningChanged, Qt::UniqueConnection);
+ }
+
+ DeviceInfoService *info = qobject_cast<DeviceInfoService*>(service(DeviceInfoService::UUID_SERVICE_DEVICEINFO));
+ if (info) {
+ connect(info, &DeviceInfoService::informationChanged, this, &HuamiDevice::informationChanged, Qt::UniqueConnection);
+ }
+
+ HRMService *hrm = qobject_cast<HRMService*>(service(HRMService::UUID_SERVICE_HRM));
+ if (hrm) {
+ connect(hrm, &HRMService::informationChanged, this, &HuamiDevice::informationChanged, Qt::UniqueConnection);
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gts2device.h
^
|
@@ -13,6 +13,12 @@
Q_OBJECT
public:
explicit Gts2Device(const QString &pairedName, QObject *parent = nullptr);
+ QString deviceType() const override;
+ QStringList supportedDisplayItems() const override;
+ virtual AbstractFirmwareInfo *firmwareInfo(const QByteArray &bytes) override;
+
+protected:
+ void initialise() override;
};
#endif // GTS2DEVICE_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gts2firmwareinfo.cpp
^
|
@@ -0,0 +1,96 @@
+#include "gts2firmwareinfo.h"
+
+Gts2FirmwareInfo::Gts2FirmwareInfo(const QByteArray &bytes) : HuamiFirmwareInfo()
+{
+ m_bytes = bytes;
+
+ calculateCRC16();
+ calculateCRC32();
+ determineFirmwareType();
+ determineFirmwareVersion();
+
+ //qDebug() << mBytes;
+ qDebug() << m_type << m_version << m_crc16 << m_crc32;
+}
+
+bool Gts2FirmwareInfo::supportedOnDevice(const QString &device) const
+{
+ qDebug() << "Checking if device suppoerted: " << device;
+ return device == "Amazfit GTS 2" && m_type != Invalid && !m_version.contains("unknown");
+}
+
+void Gts2FirmwareInfo::determineFirmwareType() {
+ qDebug() << "Determining firmware type";
+ m_type = Invalid;
+
+ if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(NEWRES_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Res_Compressed;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER2)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER3)) || m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_HEADER4))) {
+ m_type = GPS;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(GPS_ALMANAC_HEADER))) {
+ m_type = GPS_ALMANAC;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(AGPS_UIHH_HEADER))) {
+ m_type = GPS_UIHH;
+ }
+// if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(FW_HEADER2)) == FW_OFFSET) {
+// m_version = m_crcMap[m_crc16];
+// qDebug() << "Version:" << m_version << "CRC:" << m_crc16;
+// m_type = Firmware;
+// }
+
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET || m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(WATCHFACE_HEADER)) == COMPRESSED_RES_HEADER_OFFSET_NEW) {
+ m_type = Watchface;
+ }
+ if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(NEWFT_HEADER))) {
+ if (m_bytes.at(10) == 0x01) {
+ m_type = Font;
+ } else if (m_bytes.at(10) == 0x02) {
+ m_type = Font_Latin;
+ }
+ }
+}
+
+void Gts2FirmwareInfo::determineFirmwareVersion()
+{
+ QString version;
+
+ switch (m_type) {
+ case Firmware:
+ version = "FW (unknown)";
+ break;
+ case Res:
+ version = "RES (unknown)";
+ break;
+ case Res_Compressed:
+ version = "RES_COMPRESSED (unknown)";
+ break;
+ case Font:
+ version = "FONT (unknown)";
+ break;
+ case Font_Latin:
+ version = "FONT LATIN (unknown)";
+ break;
+ case GPS:
+ version = "GPS (unknown)";
+ break;
+ case GPS_CEP:
+ version = "CEP";
+ break;
+ case GPS_UIHH:
+ version = "GPS_UIHH";
+ break;
+ case GPS_ALMANAC:
+ version = "ALM";
+ break;
+ case Watchface:
+ version = "Watchface";
+ break;
+ default:
+ version = "(unknown)";
+ }
+
+ m_version = version;
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gts2firmwareinfo.h
^
|
@@ -0,0 +1,19 @@
+#ifndef GTS2FIRMWAREINFO_H
+#define GTS2FIRMWAREINFO_H
+
+#include "huamifirmwareinfo.h"
+
+class Gts2FirmwareInfo : public HuamiFirmwareInfo
+{
+public:
+ explicit Gts2FirmwareInfo(const QByteArray &bytes);
+
+ virtual bool supportedOnDevice(const QString &device) const override;
+
+private:
+ void determineFirmwareType();
+ void determineFirmwareVersion();
+
+};
+
+#endif // GTS2FIRMWAREINFO_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtsdevice.cpp
^
|
@@ -10,15 +10,14 @@
GtsDevice::GtsDevice(const QString &pairedName, QObject *parent) : HuamiDevice(pairedName, parent)
{
qDebug() << "Creating GTS Device";
- connect(this, &QBLEDevice::propertiesChanged, this, &GtsDevice::onPropertiesChanged, Qt::UniqueConnection);
}
-QString GtsDevice::deviceType()
+QString GtsDevice::deviceType() const
{
return "amazfitgts";
}
-int GtsDevice::supportedFeatures()
+int GtsDevice::supportedFeatures() const
{
return FEATURE_HRM |
FEATURE_WEATHER |
@@ -39,38 +38,6 @@
}
}
-void GtsDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
-{
- qDebug() << Q_FUNC_INFO << interface << map << list;
-
- if (interface == "org.bluez.Device1") {
- m_reconnectTimer->start();
- if (deviceProperty("ServicesResolved").toBool() ) {
- initialise();
- }
- if (map.contains("Connected")) {
- bool value = map["Connected"].toBool();
-
- if (!value) {
- qDebug() << "DisConnected!";
- setConnectionState("disconnected");
- } else {
- setConnectionState("connected");
- }
- } else if (map.contains("Paired")) {
- bool value = map["Paired"].toBool();
-
- if (value) {
- qDebug() << "Paired!";
- if (m_connectionState == "pairing" && m_pairing) {
- connectToDevice();
- }
- }
- }
- }
-
-}
-
void GtsDevice::serviceEvent(uint8_t event)
{
switch(event) {
@@ -148,11 +115,11 @@
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;
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtsdevice.h
^
|
@@ -9,10 +9,10 @@
public:
explicit GtsDevice(const QString &pairedName, QObject *parent = nullptr);
- virtual QString deviceType() override;
+ QString deviceType() const override;
virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
virtual void sendEventReminder(int id, const QDateTime &dt, const QString &event) override;
- virtual int supportedFeatures() override;
+ virtual int supportedFeatures() const override;
void prepareFirmwareDownload(const AbstractFirmwareInfo *info) override;
virtual void applyDeviceSetting(Settings s) override;
@@ -30,10 +30,8 @@
protected:
Q_SLOT void serviceEvent(uint8_t event);
- virtual void initialise();
- virtual void parseServices();
-
- virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
+ void initialise() override;
+ void parseServices();
private:
QString pairedName;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtsfirmwareinfo.cpp
^
|
@@ -32,7 +32,7 @@
if (m_bytes.startsWith(UCHARARR_TO_BYTEARRAY(AGPS_UIHH_HEADER))) {
m_type = GPS_UIHH;
}
- if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(FW_HEADER)) == FW_OFFSET) {
+ if (m_bytes.indexOf(UCHARARR_TO_BYTEARRAY(FW_HEADER2)) == FW_OFFSET) {
m_version = m_crcMap[m_crc16];
qDebug() << "Version:" << m_version << "CRC:" << m_crc16;
m_type = Firmware;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/gtsfirmwareinfo.h
^
|
@@ -1,9 +1,9 @@
#ifndef GTSFIRMWAREINFO_H
#define GTSFIRMWAREINFO_H
-#include "abstractfirmwareinfo.h"
+#include "huamifirmwareinfo.h"
-class GtsFirmwareInfo : public AbstractFirmwareInfo
+class GtsFirmwareInfo : public HuamiFirmwareInfo
{
public:
explicit GtsFirmwareInfo(const QByteArray &bytes);
@@ -14,67 +14,6 @@
void determineFirmwareType();
void determineFirmwareVersion();
- const int FW_OFFSET = 0x3;
- const int FONT_TYPE_OFFSET = 0x9;
- const int COMPRESSED_RES_HEADER_OFFSET = 0x9;
- const int COMPRESSED_RES_HEADER_OFFSET_NEW = 0xd;
-
- const uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
- 0x48, 0x4d, 0x52, 0x45, 0x53
- };
-
- const uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
- 0x4e, 0x45, 0x52, 0x45, 0x53
- };
-
- const uint8_t WATCHFACE_HEADER[6] = { //HMDIAL watchface
- 0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
- };
-
- const uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
- 0x48, 0x4d, 0x5a, 0x4b
- };
-
- const uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
- 0x4e, 0x45, 0x5a, 0x4b
- };
-
- const uint8_t GPS_HEADER[16] = {
- 0xcb, 0x51, 0xc1, 0x30, 0x41, 0x9e, 0x5e, 0xd3,
- 0x51, 0x35, 0xdf, 0x66, 0xed, 0xd9, 0x5f, 0xa7
- };
-
- const uint8_t GPS_HEADER2[16] = {
- 0x10, 0x50, 0x26, 0x76, 0x8f, 0x4a, 0xa1, 0x49,
- 0xa7, 0x26, 0xd0, 0xe6, 0x4a, 0x21, 0x88, 0xd4
- };
-
- const uint8_t GPS_HEADER3[16] = {
- 0xeb, 0xfa, 0xc5, 0x89, 0xf0, 0x5c, 0x2e, 0xcc,
- 0xfa, 0xf3, 0x62, 0xeb, 0x92, 0xc6, 0xa1, 0xbb
- };
-
- const uint8_t GPS_HEADER4[16] = {
- 0x0b, 0x61, 0x53, 0xed, 0x83, 0xac, 0x07, 0x21,
- 0x8c, 0x36, 0x2e, 0x8c, 0x9c, 0x08, 0x54, 0xa6
- };
-
- const uint8_t FW_HEADER[5] = {
- 0x20, 0x99, 0x12, 0x01, 0x08 //probably nonsense
- };
-
- const uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
- 0xa0, 0x80, 0x08, 0x00, 0x8b
- };
-
- const uint8_t GPS_CEP_HEADER[4]{ // probably wrong
- 0x2a, 0x12, 0xa0, 0x02
- };
-
- const uint8_t AGPS_UIHH_HEADER[5]{ // probably wrong
- 'U', 'I', 'H', 'H', 0x04
- };
-
QMap<uint16_t, QString> m_crcMap;
void populateCrcMap();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/huamidevice.cpp
^
|
@@ -5,9 +5,11 @@
#include <QtXml/QtXml>
HuamiDevice::HuamiDevice(const QString &pairedName, QObject *parent) : AbstractDevice(pairedName, parent)
-{
+{
+ qDebug() << Q_FUNC_INFO;
m_keyPressTimer = new QTimer(this);
m_keyPressTimer->setInterval(500);
+ connect(this, &QBLEDevice::propertiesChanged, this, &HuamiDevice::onPropertiesChanged);
connect(m_keyPressTimer, &QTimer::timeout, this, &HuamiDevice::buttonPressTimeout);
}
@@ -314,3 +316,31 @@
break;
}
}
+
+void HuamiDevice::onPropertiesChanged(QString interface, QVariantMap map, QStringList list)
+{
+ qDebug() << Q_FUNC_INFO << interface << map << list;
+
+ if (interface == "org.bluez.Device1") {
+ m_reconnectTimer->start();
+ if (map.contains("Paired")) {
+ bool value = map["Paired"].toBool();
+
+ if (value) {
+ setConnectionState("paired");
+ }
+ }
+ if (map.contains("Connected")) {
+ bool value = map["Connected"].toBool();
+
+ if (!value) {
+ setConnectionState("disconnected");
+ } else {
+ setConnectionState("connected");
+ }
+ }
+ if (deviceProperty("ServicesResolved").toBool() ) {
+ initialise();
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/huamidevice.h
^
|
@@ -50,6 +50,9 @@
Q_SLOT void batteryInfoChanged();
Q_SLOT void serviceEvent(char event);
+ virtual void onPropertiesChanged(QString interface, QVariantMap map, QStringList list);
+ virtual void initialise() = 0;
+
int m_ActivitySampleSize = 4;
private:
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/huamifirmwareinfo.cpp
^
|
@@ -0,0 +1,6 @@
+#include "huamifirmwareinfo.h"
+
+HuamiFirmwareInfo::HuamiFirmwareInfo() : AbstractFirmwareInfo()
+{
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/huamifirmwareinfo.h
^
|
@@ -0,0 +1,79 @@
+#ifndef HUAMIFIRMWAREINFO_H
+#define HUAMIFIRMWAREINFO_H
+
+#include "abstractfirmwareinfo.h"
+
+class HuamiFirmwareInfo : public AbstractFirmwareInfo
+{
+public:
+ HuamiFirmwareInfo();
+
+ const int FW_OFFSET = 0x3;
+ const int FONT_TYPE_OFFSET = 0x9;
+ const int COMPRESSED_RES_HEADER_OFFSET = 0x9;
+ const int COMPRESSED_RES_HEADER_OFFSET_NEW = 0xd;
+
+ const uint8_t RES_HEADER[5]{ // HMRES resources file (*.res)
+ 0x48, 0x4d, 0x52, 0x45, 0x53
+ };
+
+ const uint8_t NEWRES_HEADER[5] = { // NERES resources file (*.res)
+ 0x4e, 0x45, 0x52, 0x45, 0x53
+ };
+
+ const uint8_t WATCHFACE_HEADER[6] = { //HMDIAL watchface
+ 0x48, 0x4d, 0x44, 0x49, 0x41, 0x4c
+ };
+
+ const uint8_t FT_HEADER[4] = { // HMZK font file (*.ft, *.ft.xx)
+ 0x48, 0x4d, 0x5a, 0x4b
+ };
+
+ const uint8_t NEWFT_HEADER[4] = { // NEZK font file (*.ft, *.ft.xx)
+ 0x4e, 0x45, 0x5a, 0x4b
+ };
+
+ const uint8_t GPS_HEADER[16] = {
+ 0xcb, 0x51, 0xc1, 0x30, 0x41, 0x9e, 0x5e, 0xd3,
+ 0x51, 0x35, 0xdf, 0x66, 0xed, 0xd9, 0x5f, 0xa7
+ };
+
+ const uint8_t GPS_HEADER2[16] = {
+ 0x10, 0x50, 0x26, 0x76, 0x8f, 0x4a, 0xa1, 0x49,
+ 0xa7, 0x26, 0xd0, 0xe6, 0x4a, 0x21, 0x88, 0xd4
+ };
+
+ const uint8_t GPS_HEADER3[16] = {
+ 0xeb, 0xfa, 0xc5, 0x89, 0xf0, 0x5c, 0x2e, 0xcc,
+ 0xfa, 0xf3, 0x62, 0xeb, 0x92, 0xc6, 0xa1, 0xbb
+ };
+
+ const uint8_t GPS_HEADER4[16] = {
+ 0x0b, 0x61, 0x53, 0xed, 0x83, 0xac, 0x07, 0x21,
+ 0x8c, 0x36, 0x2e, 0x8c, 0x9c, 0x08, 0x54, 0xa6
+ };
+
+ const uint8_t GPS_ALMANAC_HEADER[5] = { // probably wrong
+ 0xa0, 0x80, 0x08, 0x00, 0x8b
+ };
+
+ const uint8_t GPS_CEP_HEADER[4]{ // probably wrong
+ 0x2a, 0x12, 0xa0, 0x02
+ };
+
+ const uint8_t AGPS_UIHH_HEADER[5]{ // probably wrong
+ 'U', 'I', 'H', 'H', 0x04
+ };
+
+ // this is the same as Cor
+ const uint8_t FW_HEADER[16] = {
+ 0x00, 0x98, 0x00, 0x20, 0xA5, 0x04, 0x00, 0x20, 0xAD, 0x04, 0x00, 0x20, 0xC5, 0x04, 0x00, 0x20
+ };
+
+ const uint8_t FW_HEADER2[5] = {
+ 0x20, 0x99, 0x12, 0x01, 0x08 //probably nonsense
+ };
+
+};
+
+#endif // HUAMIFIRMWAREINFO_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/pinetimejfdevice.cpp
^
|
@@ -19,7 +19,7 @@
connect(this, &QBLEDevice::propertiesChanged, this, &PinetimeJFDevice::onPropertiesChanged, Qt::UniqueConnection);
}
-QString PinetimeJFDevice::pair()
+void PinetimeJFDevice::pair()
{
qDebug() << "AbstractDevice::pair";
@@ -31,10 +31,9 @@
emit connectionStateChanged();
QBLEDevice::connectToDevice();
- return "pairing";
}
-int PinetimeJFDevice::supportedFeatures()
+int PinetimeJFDevice::supportedFeatures() const
{
return FEATURE_HRM |
FEATURE_ALERT |
@@ -42,7 +41,7 @@
FEATURE_STEPS;
}
-QString PinetimeJFDevice::deviceType()
+QString PinetimeJFDevice::deviceType() const
{
return "pinetimejf";
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/devices/pinetimejfdevice.h
^
|
@@ -9,9 +9,9 @@
public:
explicit PinetimeJFDevice(const QString &pairedName, QObject *parent = 0);
- virtual QString pair() override;
- virtual int supportedFeatures() override;
- virtual QString deviceType() override;
+ virtual void pair() override;
+ virtual int supportedFeatures() const override;
+ virtual QString deviceType() const override;
virtual void abortOperations() override;
virtual void sendAlert(const QString &sender, const QString &subject, const QString &message) override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/services/mibandservice.cpp
^
|
@@ -61,36 +61,47 @@
m_operationTimeout = new QTimer();
connect(m_operationTimeout, &QTimer::timeout, this, &MiBandService::operationTimeout);
- displayItmesIdMap["status"] = 0x01;
- displayItmesIdMap["hr"] = 0x02;
- displayItmesIdMap["workout"] = 0x03;
- displayItmesIdMap["weather"] = 0x04;
- displayItmesIdMap["notifications"] = 0x06;
- displayItmesIdMap["more"] = 0x07;
- displayItmesIdMap["dnd"] = 0x08;
- displayItmesIdMap["alarm"] = 0x09;
- displayItmesIdMap["takephoto"] = 0x0a;
- displayItmesIdMap["music"] = 0x0b;
- displayItmesIdMap["stopwatch"] = 0x0c;
- displayItmesIdMap["timer"] = 0x0d;
- displayItmesIdMap["findphone"] = 0x0e;
- displayItmesIdMap["mutephone"] = 0x0f;
- displayItmesIdMap["nfc"] = 0x10;
- displayItmesIdMap["alipay"] = 0x11;
- displayItmesIdMap["watchface"] = 0x12;
- displayItmesIdMap["settings"] = 0x13;
- displayItmesIdMap["activity"] = 0x14;
- displayItmesIdMap["eventreminder"] = 0x15;
- displayItmesIdMap["compass"] = 0x16;
- displayItmesIdMap["pai"] = 0x19;
- displayItmesIdMap["worldclock"] = 0x1a;
- displayItmesIdMap["timer_stopwatch"] = 0x1b;
- displayItmesIdMap["stress"] = 0x1c;
- displayItmesIdMap["period"] = 0x1d;
- displayItmesIdMap["goal"] = 0x21;
- displayItmesIdMap["sleep"] = 0x23;
- displayItmesIdMap["spo2"] = 0x24;
- displayItmesIdMap["alexa"] = 0x39;
+ displayItemsIdMap["status"] = 0x01;
+ displayItemsIdMap["hr"] = 0x02;
+ displayItemsIdMap["workout"] = 0x03;
+ displayItemsIdMap["weather"] = 0x04;
+ displayItemsIdMap["notifications"] = 0x06;
+ displayItemsIdMap["more"] = 0x07;
+ displayItemsIdMap["dnd"] = 0x08;
+ displayItemsIdMap["alarm"] = 0x09;
+ displayItemsIdMap["takephoto"] = 0x0a;
+ displayItemsIdMap["music"] = 0x0b;
+ displayItemsIdMap["stopwatch"] = 0x0c;
+ displayItemsIdMap["timer"] = 0x0d;
+ displayItemsIdMap["findphone"] = 0x0e;
+ displayItemsIdMap["mutephone"] = 0x0f;
+ displayItemsIdMap["nfc"] = 0x10;
+ displayItemsIdMap["alipay"] = 0x11;
+ displayItemsIdMap["watchface"] = 0x12;
+ displayItemsIdMap["settings"] = 0x13;
+ displayItemsIdMap["activity"] = 0x14;
+ displayItemsIdMap["eventreminder"] = 0x15;
+ displayItemsIdMap["compass"] = 0x16;
+ displayItemsIdMap["pai"] = 0x19;
+ displayItemsIdMap["worldclock"] = 0x1a;
+ displayItemsIdMap["timer_stopwatch"] = 0x1b;
+ displayItemsIdMap["stress"] = 0x1c;
+ displayItemsIdMap["period"] = 0x1d;
+ displayItemsIdMap["goal"] = 0x21;
+ displayItemsIdMap["sleep"] = 0x23;
+ displayItemsIdMap["spo2"] = 0x24;
+ displayItemsIdMap["events"] = 0x26;
+ displayItemsIdMap["widgets"] = 0x28;
+ displayItemsIdMap["breathing"] = 0x33;
+ displayItemsIdMap["steps"] = 0x34;
+ displayItemsIdMap["distance"] = 0x35;
+ displayItemsIdMap["calories"] = 0x36;
+ displayItemsIdMap["pomodoro"] = 0x38;
+ displayItemsIdMap["alexa"] = 0x39;
+ displayItemsIdMap["battery"] = 0x3a;
+ displayItemsIdMap["temperature"] = 0x40;
+ displayItemsIdMap["barometer"] = 0x41;
+ displayItemsIdMap["flashlight"] = 0x43;
}
void MiBandService::characteristicChanged(const QString &characteristic, const QByteArray &value)
@@ -580,7 +591,7 @@
command += QByteArray(1, (char)0x12);
for (QString &key : enabledList) {
- uint8_t id = displayItmesIdMap[key];
+ uint8_t id = displayItemsIdMap[key];
if (id != 0) {
command += QByteArray(1, (char)index++);
command += QByteArray(1, (char)0x00);
@@ -593,7 +604,7 @@
if (device) {
allList = device->supportedDisplayItems();
for (QString &key : allList) {
- uint8_t id = displayItmesIdMap[key];
+ uint8_t id = displayItemsIdMap[key];
if (!enabledList.contains(key)) {
command += QByteArray(1, (char)index++);
@@ -662,6 +673,8 @@
sampleSize = device->activitySampleSize();
}
+ qDebug() << "Sample size is " << sampleSize;
+
m_activityFetchOperation = new ActivityFetchOperation(this, m_conn, sampleSize);
m_activityFetchOperation->start();
emit operationRunningChanged();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/daemon/src/services/mibandservice.h
^
|
@@ -186,7 +186,7 @@
KDbConnection *m_conn = nullptr;
QTimer *m_operationTimeout = nullptr;
- QMap<QString, uint8_t> displayItmesIdMap;
+ QMap<QString, uint8_t> displayItemsIdMap;
};
#endif // MIBANDSERVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/documentation/build-instructions.md
^
|
@@ -31,21 +31,14 @@
## In Ubuntu 20.04, with default Ubuntu repository, QT is in version 5.12.8
-### Prepare git repo
-Clone amazfish repository:
-
-```
-git clone https://github.com/piggz/harbour-amazfish.git`
-```
+### Install dependencies
-Initialise and sync submodules:
+Most dependencies can be installed from the Ubuntu package repositories:
```
-git submodule init
-git submodule update
+sudo apt update
+sudo apt install -y qt5-default libkdb3-dev libkf5contacts-dev libkf5coreaddons-dev qtlocation5-dev qtconnectivity5-dev qtpositioning5-dev qml-module-qtbluetooth
```
-### Install dependencies
-
Two depedencies can be found on git repos
https://git.sailfishos.org/mer-core/nemo-qml-plugin-dbus
and
@@ -60,21 +53,39 @@
```
```
+cd ..
+```
+
+```
git clone https://git.sailfishos.org/mer-core/nemo-qml-plugin-dbus.git
cd nemo-qml-plugin-dbus
qmake
make
sudo make install
```
-Other dependencies can be installed from the Ubuntu package repositories:
+
```
-sudo apt install qt5-default libkdb3-dev libkf5contacts-dev libkf5coreaddons-dev qtlocation5-dev qtconnectivity5-dev qtpositioning5-dev qml-module-qtbluetooth
+cd ..
```
-### Build process
+### Prepare git repo
+Clone amazfish repository:
```
+git clone https://github.com/piggz/harbour-amazfish.git
cd harbour-amazfish
+```
+
+Initialise and sync submodules:
+
+```
+git submodule init
+git submodule update
+```
+
+### Build process
+
+```
mkdir build
cd build
qmake FLAVOR=kirigami ..
@@ -82,7 +93,6 @@
```
Here, you may get an error like this:
-
```
Project ERROR: Unknown module(s) in QT: CoreAddons
```
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/harbour-amazfish-ui.svg
^
|
(renamed from harbour-amazfish.svg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/lib/src/amazfish.cpp
^
|
@@ -53,6 +53,12 @@
if (type == Amazfish::ActivityType::Yoga) {
return "Yoga";
}
+ if (type == Amazfish::ActivityType::TrailRunning) {
+ return "Trail Running";
+ }
+ if (type == Amazfish::ActivityType::Skiing) {
+ return "Skiing";
+ }
return "Unknown";
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/lib/src/amazfish.h
^
|
@@ -24,7 +24,9 @@
IndoorCycling = 0x00000800,
EllipticalTrainer = 0x00001000,
JumpRope = 0x00002000,
- Yoga = 0x00004000
+ Yoga = 0x00004000,
+ TrailRunning = 0x00008000,
+ Skiing = 0x00010000
};
Q_ENUM(ActivityType)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/qble/qbledevice.cpp
^
|
@@ -19,37 +19,11 @@
this, SLOT(onPropertiesChangedInt(QString, QVariantMap, QStringList)));
}
-QString QBLEDevice::pair()
+void QBLEDevice::pair()
{
qDebug() << "QBLEDevice::pair";
- QDBusMessage reply = m_deviceInterface->call("Pair");
-
- return reply.errorMessage();
-}
-
-void QBLEDevice::pairAsync()
-{
- qDebug() << "QBLEDevice::pairAsync";
-
- QDBusPendingCall async = m_deviceInterface->asyncCall("Pair");
-
- QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
-
- QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
- this, SLOT(pairFinished(QDBusPendingCallWatcher*)));
-}
-
-void QBLEDevice::onPairFinished(QDBusPendingCallWatcher *call)
-{
- QDBusPendingReply<QDBusMessage> reply = *call;
- if (reply.isError()) {
- qDebug() << "QBLECharacteristic::readFinished:" << reply.error().message();
- emit( reply.error().message());
- } else {
- emit pairFinished("paired");
- }
- call->deleteLater();
+ m_deviceInterface->asyncCall("Pair");
}
void QBLEDevice::connectToDevice()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/qble/qbledevice.h
^
|
@@ -16,8 +16,7 @@
QBLEService *service(const QString &uuid) const;
void setDevicePath(const QString &path);
- virtual QString pair();
- virtual void pairAsync();
+ virtual void pair();
virtual void connectToDevice();
virtual void disconnectFromDevice();
@@ -25,7 +24,6 @@
QString devicePath() const;
Q_SIGNAL void propertiesChanged(const QString &interface, const QVariantMap &map, const QStringList &list);
- Q_SIGNAL void pairFinished(const QString &message);
Q_SIGNAL void operationRunningChanged();
Q_INVOKABLE bool operationRunning();
@@ -42,7 +40,6 @@
QDBusInterface *m_deviceInterface = nullptr;
void introspect();
- Q_SLOT void onPairFinished(QDBusPendingCallWatcher *call);
Q_SLOT void onPropertiesChangedInt(const QString &interface, const QVariantMap &map, const QStringList &list);
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/icons.qrc
^
|
@@ -28,5 +28,7 @@
<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>
+ <file>qml/custom-icons/icon-m-skiing.png</file>
+ <file>qml/custom-icons/icon-m-trail running.png</file>
</qresource>
</RCC>
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/qml/custom-icons/icon-m-skiing.png
^
|
|
Added |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/qml/custom-icons/icon-m-trail running.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/qml/pages/PairPage.qml
^
|
@@ -15,18 +15,18 @@
property string deviceType
property string _placeholderText
+ property string _deviceName
+ property string _deviceAddress
Connections {
target: DaemonInterfaceInstance
- onPaired: {
- if (!error) {
- // Set values from the signal
- AmazfishConfig.pairedAddress = address
- AmazfishConfig.pairedName = name
+ onConnectionStateChanged: {
+ if (DaemonInterfaceInstance.connectionState == "paired" || DaemonInterfaceInstance.connectionState == "connected") {
+ AmazfishConfig.pairedAddress = _deviceAddress
+ AmazfishConfig.pairedName = _deviceName
+ console.log("Paired with", AmazfishConfig.pairedName, AmazfishConfig.pairedAddress, _deviceName, _deviceAddress);
app.pages.pop(app.rootPage);
- } else {
- _placeholderText = error
}
}
}
@@ -65,10 +65,13 @@
id: listItem
contentHeight: styler.themeItemSizeLarge
onClicked: {
- AmazfishConfig.pairedAddress = ""
- AmazfishConfig.pairedName = ""
- discoveryModel.running = false
- DaemonInterfaceInstance.pair(model.deviceName, model.remoteAddress)
+ AmazfishConfig.pairedAddress = "";
+ AmazfishConfig.pairedName = "";
+ discoveryModel.running = false;
+ _deviceName = model.deviceName;
+ _deviceAddress = AmazfishConfig.localAdapter+"/dev_" + model.remoteAddress.replace(/:/g, '_');
+
+ DaemonInterfaceInstance.pair(_deviceName, _deviceAddress)
}
Item {
@@ -136,7 +139,7 @@
BusyIndicatorPL {
id: busyIndicator
- running: (discoveryModel.running && !page.count) || DaemonInterfaceInstance.pairing
+ running: (discoveryModel.running && !page.count) || DaemonInterfaceInstance.connectionState == "pairing"
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/qml/pages/PairSelectDeviceType.qml
^
|
@@ -44,25 +44,25 @@
icon: "../pics/devices/amazfit-gts.png"
auth: true
}
-/*
+
ListElement {
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 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.6.tar.bz2/ui/qml/tools/JSTools.js
^
|
@@ -232,7 +232,9 @@
{ name: "indoor cycling", stravaType: "VirtualRide" },
{ name: "treadmill", stravaType: "VirtualRun" },
{ name: "swimming", stravaType: "Swim" },
- { name: "open swimming", stravaType: "Swim" }
+ { name: "open swimming", stravaType: "Swim" },
+ { name: "trail running", stravaType: "Run" },
+ { name: "yoga", stravaType: "Yoga" }
]
function toStravaType(t)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/src/daemoninterface.cpp
^
|
@@ -57,7 +57,7 @@
{
qDebug(Q_FUNC_INFO);
- if (m_pairing) {
+ if (m_connectionState == "pairing") {
return;
}
@@ -66,14 +66,8 @@
return;
}
- m_pairing = true;
- emit pairingChanged();
- address.replace(QChar(':'), QChar('_')).prepend(AmazfishConfig::instance()->localAdapter() + "/dev_");
auto watcher = new QDBusPendingCallWatcher(iface->asyncCall(QStringLiteral("pair"), name, address));
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, name, address]() {
- m_pairing = false;
- emit pairingChanged();
- emit paired(name, address, watcher->error().name());
watcher->deleteLater();
});
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/src/daemoninterface.h
^
|
@@ -20,8 +20,6 @@
{
Q_OBJECT
- Q_PROPERTY(bool pairing MEMBER m_pairing NOTIFY pairingChanged)
-
//Device Interface
Q_PROPERTY(QString connectionState MEMBER m_connectionState NOTIFY connectionStateChanged)
Q_PROPERTY(bool operationRunning READ operationRunning NOTIFY operationRunningChanged)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.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="297"/>
+ <location filename="../qml/tools/JSTools.js" line="299"/>
<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="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>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="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>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="302"/>
- <location filename="../qml/tools/JSTools.js" line="303"/>
+ <location filename="../qml/tools/JSTools.js" line="304"/>
+ <location filename="../qml/tools/JSTools.js" line="305"/>
<source>Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="94"/>
- <location filename="../qml/tools/JSTools.js" line="304"/>
+ <location filename="../qml/tools/JSTools.js" line="306"/>
<source>Altitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/tools/JSTools.js" line="95"/>
- <location filename="../qml/tools/JSTools.js" line="305"/>
+ <location filename="../qml/tools/JSTools.js" line="307"/>
<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="306"/>
+ <location filename="../qml/tools/JSTools.js" line="308"/>
<source>Duration</source>
<translation type="unfinished"></translation>
</message>
@@ -446,22 +446,22 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/PairPage.qml" line="119"/>
+ <location filename="../qml/pages/PairPage.qml" line="122"/>
<source>Stop scanning</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/PairPage.qml" line="120"/>
+ <location filename="../qml/pages/PairPage.qml" line="123"/>
<source>Scan for devices</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/PairPage.qml" line="130"/>
+ <location filename="../qml/pages/PairPage.qml" line="133"/>
<source>Scanning for devices…</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../qml/pages/PairPage.qml" line="132"/>
+ <location filename="../qml/pages/PairPage.qml" line="135"/>
<source>Pairing…</source>
<translation type="unfinished"></translation>
</message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-amazfish-2.0.6.tar.bz2/ui/ui.pro
^
|
@@ -247,7 +247,7 @@
desktopfile.files = harbour-amazfish-ui.desktop
desktopfile.path = $$PREFIX/share/applications
-appicon.files = ../harbour-amazfish.svg
+appicon.files = ../harbour-amazfish-ui.svg
appicon.path = $$PREFIX/share/icons/hicolor/scalable/apps
INSTALLS += qmlplatform qml js icons target desktopfile appicon
|