diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-03-31 12:34:07 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-03-31 13:36:54 +0200 |
| commit | 435b5066f57ed0f0710dcc61ca927380e3916a7e (patch) | |
| tree | c44e364bf7ec242b718178e8fc0e4cae4475d33b /daemon/watchconnector.h | |
| parent | 55ca91c31d6469869903272e5263b85199b68728 (diff) | |
Store Watch HW&SW versions in API object
Diffstat (limited to 'daemon/watchconnector.h')
| -rw-r--r-- | daemon/watchconnector.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/daemon/watchconnector.h b/daemon/watchconnector.h index 2ed4996..400908c 100644 --- a/daemon/watchconnector.h +++ b/daemon/watchconnector.h @@ -31,10 +31,12 @@ #define WATCHCONNECTOR_H #include <functional> +#include <QDebug> #include <QObject> #include <QPointer> #include <QStringList> #include <QTimer> +#include <QDateTime> #include <QBluetoothDeviceInfo> #include <QBluetoothSocket> #include <QBluetoothServiceInfo> @@ -94,7 +96,8 @@ public: musicPREVIOUS = 5, musicVOLUME_UP = 6, musicVOLUME_DOWN = 7, - musicGET_NOW_PLAYING = 8 + musicGET_NOW_PLAYING = 8, + musicSEND_NOW_PLAYING = 9 }; enum SystemMessage { systemFIRMWARE_AVAILABLE = 0, @@ -186,6 +189,25 @@ public: }; QMap<HardwareRevision, QString> firmwareMapping; + struct SoftwareVersion { + QDateTime build; + QString version; + QString commit; + bool is_recovery; + HardwareRevision hw_revision; + QString hw_string; + quint8 metadata_version; + }; + + struct WatchVersions { + SoftwareVersion main; + SoftwareVersion safe; + QDateTime bootLoaderBuild; + QString hardwareRevision; + QString serialNumber; + QByteArray address; + }; + typedef QMap<int, QVariant> Dict; enum DictItemType { typeBYTES, @@ -201,7 +223,7 @@ public: inline bool isConnected() const { return is_connected; } inline QString name() const { return socket != nullptr ? socket->peerName() : ""; } - inline QString serialNumber() const { return _serialNumber; } + inline WatchVersions versions() const { return _versions; } void setEndpointHandler(uint endpoint, const EndpointHandlerFunc &func); void clearEndpointHandler(uint endpoint); @@ -259,7 +281,10 @@ private: QTimer reconnectTimer; QString _last_name; QString _last_address; - QString _serialNumber; + WatchVersions _versions; }; +QDebug operator<< (QDebug d, const WatchConnector::SoftwareVersion &ver); +QDebug operator<< (QDebug d, const WatchConnector::WatchVersions &ver); + #endif // WATCHCONNECTOR_H |
