QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AntRxMessagePrivate Class Reference
Inheritance diagram for AntRxMessagePrivate:
[legend]
Collaboration diagram for AntRxMessagePrivate:
[legend]

Public Member Functions

 AntRxMessagePrivate (AntRxMessage *const q)
 
virtual ~AntRxMessagePrivate ()
 
- Public Member Functions inherited from AbstractDataMessagePrivate
 AbstractDataMessagePrivate (AbstractDataMessage *const q)
 
virtual ~AbstractDataMessagePrivate ()
 
bool setFields (const DataDefinition *const defn, const QByteArray &record)
 

Public Attributes

DateTime timestamp
 The AntRxMessage FIT message's timestamp field.
 
quint16 fractionalTimestamp
 The AntRxMessage FIT message's fractionalTimestamp field.
 
quint8 mesgId
 The AntRxMessage FIT message's mesgId field.
 
quint8 mesgData
 The AntRxMessage FIT message's mesgData field.
 
quint8 channelNumber
 The AntRxMessage FIT message's channelNumber field.
 
quint8 data
 The AntRxMessage FIT message's data field.
 
- Public Attributes inherited from AbstractDataMessagePrivate
MesgNum globalMessageNumber
 FIT Globla Message Number for this FIT Data Message.
 

Protected Member Functions

bool setField (const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
 
- Protected Member Functions inherited from AbstractDataMessagePrivate
bool verify (const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDataMessagePrivate
AbstractDataMessage *const q_ptr
 Internal q-pointer.
 

Detailed Description

The AntRxMessagePrivate class provides private implementation for the AntRxMessage.

See also
AntRxMessage

Definition at line 38 of file antrxmessage_p.h.

Constructor & Destructor Documentation

◆ AntRxMessagePrivate()

AntRxMessagePrivate::AntRxMessagePrivate ( AntRxMessage *const  q)
explicit

Constructs a AntRxMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 215 of file antrxmessage.cpp.

217  , timestamp(static_cast<DateTime>(-1))
218  , fractionalTimestamp(0xFFFF)
219  , mesgId(0xFF)
220  , mesgData(0xFF)
221  , channelNumber(0xFF)
222  , data(0xFF)
223 {
224  globalMessageNumber = MesgNum::AntRx;
225 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint16 fractionalTimestamp
The AntRxMessage FIT message's fractionalTimestamp field.
quint8 mesgData
The AntRxMessage FIT message's mesgData field.
quint8 channelNumber
The AntRxMessage FIT message's channelNumber field.
quint8 data
The AntRxMessage FIT message's data field.
quint8 mesgId
The AntRxMessage FIT message's mesgId field.
DateTime timestamp
The AntRxMessage FIT message's timestamp field.
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~AntRxMessagePrivate()

AntRxMessagePrivate::~AntRxMessagePrivate ( )
virtual

Destroys the AntRxMessagePrivate object.

Definition at line 232 of file antrxmessage.cpp.

233 {
234 
235 }

Member Function Documentation

◆ setField()

bool AntRxMessagePrivate::setField ( const int  fieldId,
const QByteArray &  data,
const FitBaseType  baseType,
const bool  bigEndian 
)
overrideprotectedvirtual

Sets the value of the fieldId field.

Derived classes must implement this method to extract the baseType value from data, and assign the extracted value the fieldId field.

Parameters
fieldIdThe field number within the given FIT data message.
dataThe raw data to extract the field value from.
baseTypeThe FIT base type for the field.
bigEndianWhether or not multibyte values in record are big-endian.
Returns
true if the field was set, or safely ignored; false otherwise.

Implements AbstractDataMessagePrivate.

Definition at line 237 of file antrxmessage.cpp.

239 {
240  switch (fieldId) {
241  case 253: // See Profile.xlsx::Messages:ant_rx.timestamp
242  if (!verify(data, baseType, 4, FitBaseType::Uint32, "ant_rx.timestamp")) return false;
243  this->timestamp = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
244  break;
245  case 0: // See Profile.xlsx::Messages:ant_rx.fractionalTimestamp
246  if (!verify(data, baseType, 2, FitBaseType::Uint16, "ant_rx.fractionalTimestamp")) return false;
247  this->fractionalTimestamp = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
248  break;
249  case 1: // See Profile.xlsx::Messages:ant_rx.mesgId
250  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_rx.mesgId")) return false;
251  this->mesgId = static_cast<quint8>(data.at(0));
252  break;
253  case 2: // See Profile.xlsx::Messages:ant_rx.mesgData
254  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_rx.mesgData")) return false;
255  this->mesgData = static_cast<quint8>(data.at(0));
256  break;
257  case 3: // See Profile.xlsx::Messages:ant_rx.channelNumber
258  if (!verify(data, baseType, 1, FitBaseType::Uint8, "ant_rx.channelNumber")) return false;
259  this->channelNumber = static_cast<quint8>(data.at(0));
260  break;
261  case 4: // See Profile.xlsx::Messages:ant_rx.data
262  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_rx.data")) return false;
263  this->data = static_cast<quint8>(data.at(0));
264  break;
265  default:
266  qWarning() << "ignoring unknown ant_rx message field number" << fieldId << bigEndian;
267  // Fall through to return true, as its still 'safe' to continue parsing data messages.
268  }
269  return true;
270 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)

References data, and AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

The documentation for this class was generated from the following files: