diff options
| author | Philipp Andreas <github@smurfy.de> | 2014-07-12 20:30:08 +0200 |
|---|---|---|
| committer | Philipp Andreas <github@smurfy.de> | 2014-07-12 20:30:08 +0200 |
| commit | 7abf6f3b40ddbb64de86cb56684d710a06c9a882 (patch) | |
| tree | 20d6d94ea593863ecddb6c39bc5e764dcd6fb3c5 /daemon/watchconnector.cpp | |
| parent | 84e775d768f0675ee733132b3762db647f1409ac (diff) | |
Adding support for PHONE_VERSION endpoint.
Diffstat (limited to 'daemon/watchconnector.cpp')
| -rw-r--r-- | daemon/watchconnector.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/daemon/watchconnector.cpp b/daemon/watchconnector.cpp index 088384d..8201018 100644 --- a/daemon/watchconnector.cpp +++ b/daemon/watchconnector.cpp @@ -136,12 +136,16 @@ void WatchConnector::decodeMsg(QByteArray data) logger()->debug() << "Length:" << datalen << " Endpoint:" << decodeEndpoint(endpoint); logger()->debug() << "Data:" << data.mid(index).toHex(); + + //TODO: move the handling to a seperate method/class if (endpoint == watchPHONE_CONTROL) { if (data.length() >= 5) { if (data.at(4) == callHANGUP) { emit hangup(); } } + } else if (endpoint == watchPHONE_VERSION) { + this->sendPhoneVersion(); } } @@ -237,6 +241,34 @@ QByteArray WatchConnector::buildMessageData(unsigned int lead, QStringList data) return res; } +void WatchConnector::sendPhoneVersion() +{ + unsigned int sessionCap = sessionCapGAMMA_RAY; + unsigned int remoteCap = remoteCapTELEPHONY | remoteCapSMS | osANDROID; + QByteArray res; + + //Prefix + res.append(0x01); + res.append(0xff); + res.append(0xff); + res.append(0xff); + res.append(0xff); + + //Session Capabilities + res.append((char)((sessionCap >> 24) & 0xff)); + res.append((char)((sessionCap >> 16) & 0xff)); + res.append((char)((sessionCap >> 8) & 0xff)); + res.append((char)(sessionCap & 0xff)); + + //Remote Capabilities + res.append((char)((remoteCap >> 24) & 0xff)); + res.append((char)((remoteCap >> 16) & 0xff)); + res.append((char)((remoteCap >> 8) & 0xff)); + res.append((char)(remoteCap & 0xff)); + + sendMessage(watchPHONE_VERSION, res); +} + void WatchConnector::ping(unsigned int val) { QByteArray res; |
