ITS
AltitudeData.cpp
Go to the documentation of this file.
1 #include "AltitudeData.h"
2 
3 #include <QDataStream>
4 
6 {
7  m_altitudeValue = 0;
9 }
10 
11 AltitudeData::AltitudeData(char *data, int *offset)
12 {
13  m_altitudeValue = extractInt(data, 4, offset);
14  m_altitudeConfidence = extractUInt(data, 1, offset);
15 }
16 
18 {
21 }
22 
23 QByteArray AltitudeData::toBin()
24 {
25  QByteArray bin;
26  QDataStream ds(&bin, QIODevice::WriteOnly);
27 
29 
30  return bin;
31 }
32 
34 {
35  Altitude_t ret;
36 
39 
40  return ret;
41 }
42 
44 {
45  return QString("Altitude ::= {\n"
46  "\tAltitudeValue ::= %1\n"
47  "\tAltitudeConfidence ::= %2\n"
48  "}")
49  .arg(m_altitudeValue)
51 }
QString toString()
toString Human readable encoder of the Altitude.
C++ style of the Altitude.
QByteArray toBin()
toBin Byte array encoder of the Altitude.
AltitudeData()
AltitudeData AltitudeData constructor.
Definition: AltitudeData.cpp:5
quint64 extractUInt(char *data, int l, int *offset)
extractUInt Extract an unsigned integer from byte array.
Definition: apiData.cpp:3
AltitudeConfidence_t altitudeConfidence
Definition: Altitude.h:25
AltitudeValue_t altitudeValue
Definition: Altitude.h:24
Altitude_t toASN()
toASN C style encoder of the Altitude.
qint64 extractInt(char *data, int l, int *offset)
extractInt Extract an signed integer from byte array.
Definition: apiData.cpp:22
quint8 m_altitudeConfidence
Definition: AltitudeData.h:75
qint32 m_altitudeValue
Definition: AltitudeData.h:74