blob: 40f8963126fa748e8d2168c833d60f7ac23c71ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "watchcommands.h"
using namespace watch;
WatchCommands::WatchCommands(WatchConnector *watch, QObject *parent) :
QObject(parent), watch(watch)
{
connect(watch, SIGNAL(messageDecoded(uint,uint,QByteArray)), SLOT(processMessage(uint,uint,QByteArray)));
}
void WatchCommands::processMessage(uint endpoint, uint datalen, QByteArray data)
{
if (endpoint == WatchConnector::watchPHONE_CONTROL) {
if (data.length() >= 5) {
if (data.at(4) == WatchConnector::callHANGUP) {
emit hangup();
}
}
} else if (endpoint == WatchConnector::watchPHONE_VERSION) {
watch->sendPhoneVersion();
}
}
|