summaryrefslogtreecommitdiff
path: root/metawatch/metawatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'metawatch/metawatch.h')
-rw-r--r--metawatch/metawatch.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/metawatch/metawatch.h b/metawatch/metawatch.h
index 685b2a7..d468bc1 100644
--- a/metawatch/metawatch.h
+++ b/metawatch/metawatch.h
@@ -61,6 +61,14 @@ public:
ReadLightSensorResponse = 0x59
};
+ enum NvalValue {
+ ReservedNval = 0,
+ LinkKey = 0x1,
+ IdleBufferConfiguration = 0x2,
+ TimeFormat = 0x2009,
+ DateFormat = 0x200a
+ };
+
enum Mode {
IdleMode = 0,
ApplicationMode = 1,
@@ -174,10 +182,14 @@ protected:
{ }
};
+ /** The "packets to be sent" asynchronous queue **/
QQueue<Message> _toSend;
QTimer* _sendTimer;
Message _partialReceived;
+ /** Pending nvals to be written once the read operation is finished. */
+ QMap<NvalValue, int> _nvals;
+
static const quint8 bitRevTable[16];
static const quint16 crcTable[256];
static quint16 calcCrc(const QByteArray& data, int size);
@@ -190,6 +202,9 @@ protected:
*/
void sendIfNotQueued(const Message& msg);
+ static uint nvalSize(NvalValue value);
+ void nvalWrite(NvalValue value, int data);
+
/* Some functions that wrap sending some watch messages. */
void setVibrateMode(bool enable, uint on, uint off, uint cycles);
void updateLcdLine(Mode mode, const QImage& image, int line);
@@ -204,6 +219,7 @@ protected:
void handleMessage(const Message& msg);
void handleDeviceTypeMessage(const Message& msg);
void handleRealTimeClockMessage(const Message& msg);
+ void handleNvalOperationMessage(const Message& msg);
void handleStatusChangeMessage(const Message& msg);
void handleButtonEventMessage(const Message& msg);
void handleBatteryVoltageMessage(const Message& msg);