diff options
Diffstat (limited to 'daemon/watchconnector.h')
| -rw-r--r-- | daemon/watchconnector.h | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/daemon/watchconnector.h b/daemon/watchconnector.h index 36d0936..dafaa83 100644 --- a/daemon/watchconnector.h +++ b/daemon/watchconnector.h @@ -49,11 +49,13 @@ class WatchConnector : public QObject Q_OBJECT LOG4QT_DECLARE_QCLASS_LOGGER + Q_ENUMS(Endpoints) + Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(QString connected READ isConnected NOTIFY connectedChanged) public: - enum { + enum Endpoints { watchTIME = 11, watchVERSION = 16, watchPHONE_VERSION = 17, @@ -71,6 +73,7 @@ public: watchNOTIFICATION = 3000, watchRESOURCE = 4000, watchAPP_MANAGER = 6000, + watchDATA_LOGGING = 6778, watchSCREENSHOT = 8000, watchPUTBYTES = 48879 }; @@ -85,35 +88,76 @@ public: callSTART = 8, callEND = 9 }; + enum { + musicPLAY_PAUSE = 1, + musicPAUSE = 2, + musicPLAY = 3, + musicNEXT = 4, + musicPREVIOUS = 5, + musicVOLUME_UP = 6, + musicVOLUME_DOWN = 7, + musicGET_NOW_PLAYING = 8, + musicSEND_NOW_PLAYING = 9 + }; + enum { + leadEMAIL = 0, + leadSMS = 1, + leadNOW_PLAYING_DATA = 16 + }; + enum { + sessionCapGAMMA_RAY = 0x80000000 + }; + enum { + remoteCapTELEPHONY = 16, + remoteCapSMS = 32, + remoteCapGPS = 64, + remoteCapBTLE = 128, + remoteCapCAMERA_REAR = 256, + remoteCapACCEL = 512, + remoteCapGYRO = 1024, + remoteCapCOMPASS = 2048 + }; + enum { + osUNKNOWN = 0, + osIOS = 1, + osANDROID = 2, + osOSX = 3, + osLINUX = 4, + osWINDOWS = 5 + }; + + explicit WatchConnector(QObject *parent = 0); virtual ~WatchConnector(); bool isConnected() const { return is_connected; } - QString name() const { if (socket != nullptr) return socket->peerName(); return ""; } + QString name() const { return socket != nullptr ? socket->peerName() : ""; } QString timeStamp(); - QString decodeEndpoint(unsigned int val); + QString decodeEndpoint(uint val); signals: void messageReceived(QString peer, QString msg); + void messageDecoded(uint endpoint, uint datalen, QByteArray data); void nameChanged(); void connectedChanged(); - void hangup(); public slots: void sendData(const QByteArray &data); - void sendMessage(unsigned int endpoint, QByteArray data); - void ping(unsigned int val); - void sendNotification(unsigned int lead, QString sender, QString data, QString subject); + void sendMessage(uint endpoint, QByteArray data); + void ping(uint val); + void sendNotification(uint lead, QString sender, QString data, QString subject); void sendSMSNotification(QString sender, QString data); void sendEmailNotification(QString sender, QString data, QString subject); + void sendMusicNowPlaying(QString track, QString album, QString artist); + void sendPhoneVersion(); void buildData(QByteArray &res, QStringList data); - QByteArray buildMessageData(unsigned int lead, QStringList data); + QByteArray buildMessageData(uint lead, QStringList data); - void phoneControl(char act, unsigned int cookie, QStringList datas); - void ring(QString number, QString name, bool incoming=true, unsigned int cookie=0); - void startPhoneCall(unsigned int cookie=0); - void endPhoneCall(unsigned int cookie=0); + void phoneControl(char act, uint cookie, QStringList datas); + void ring(QString number, QString name, bool incoming=true, uint cookie=0); + void startPhoneCall(uint cookie=0); + void endPhoneCall(uint cookie=0); void deviceConnect(const QString &name, const QString &address); void disconnect(); |
