diff options
author | Javier <dev.git@javispedro.com> | 2015-12-14 01:52:17 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-12-14 01:52:17 +0100 |
commit | 702e018ca9e780bb076033ce5d1d370d4eb7319e (patch) | |
tree | 2012493213c630d7281718aadd1a6fa9a2c92885 /saprotocol.h | |
parent | ce8a092a235c8d59f01631c80786f920eb6a777b (diff) | |
download | sapd-702e018ca9e780bb076033ce5d1d370d4eb7319e.tar.gz sapd-702e018ca9e780bb076033ce5d1d370d4eb7319e.zip |
properly handle data frames with sequence numbers
Diffstat (limited to 'saprotocol.h')
-rw-r--r-- | saprotocol.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/saprotocol.h b/saprotocol.h index 443206b..79c6bcd 100644 --- a/saprotocol.h +++ b/saprotocol.h @@ -83,7 +83,7 @@ public: }; struct Frame { - quint8 protocolVersion; + quint8 protocolVersion; // Always 0 so far. FrameType type; quint16 sessionId; QByteArray data; @@ -93,6 +93,20 @@ public: static QByteArray packFrame(const Frame& frame); static QByteArray packFrame(quint16 sessionId, const QByteArray &data); + + struct DataFrame { + bool withSeqNum; // (not actually present in frame) + // The following fields are only present if "withSeqNum": + quint16 seqNum; // Monotonically increasing, but only for certain sessions... + quint8 unk_1; // No idea, seems to be always 0 + QByteArray data; + }; + + static DataFrame unpackDataFrame(const QByteArray &data, bool withSeqNum); + static QByteArray packDataFrame(const DataFrame& frame); + + /* Default session messages */ + enum DefaultSessionMessageType { ServiceConnectionRequest = 1, ServiceConnectionResponse = 2, @@ -156,6 +170,8 @@ public: static ServiceTerminationResponseFrame unpackServiceTerminationResponseFrame(const QByteArray &data); static QByteArray packServiceTerminationResponseFrame(const ServiceTerminationResponseFrame &frame); + /* Capability discovery messages */ + static const QLatin1String capabilityDiscoveryProfile; static const quint16 capabilityDiscoveryChannel = 255; static const quint16 capabilityDiscoveryAgentId = 0xFFFF; |