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

Public Member Functions

 AntTxMessagePrivate (AntTxMessage *const q)
 
virtual ~AntTxMessagePrivate ()
 
- 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 AntTxMessage FIT message's timestamp field.
 
quint16 fractionalTimestamp
 The AntTxMessage FIT message's fractionalTimestamp field.
 
quint8 mesgId
 The AntTxMessage FIT message's mesgId field.
 
quint8 mesgData
 The AntTxMessage FIT message's mesgData field.
 
quint8 channelNumber
 The AntTxMessage FIT message's channelNumber field.
 
quint8 data
 The AntTxMessage 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 AntTxMessagePrivate class provides private implementation for the AntTxMessage.

See also
AntTxMessage

Definition at line 38 of file anttxmessage_p.h.

Constructor & Destructor Documentation

◆ AntTxMessagePrivate()

AntTxMessagePrivate::AntTxMessagePrivate ( AntTxMessage *const  q)
explicit

Constructs a AntTxMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 215 of file anttxmessage.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::AntTx;
225 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint8 mesgData
The AntTxMessage FIT message's mesgData field.
quint16 fractionalTimestamp
The AntTxMessage FIT message's fractionalTimestamp field.
quint8 data
The AntTxMessage FIT message's data field.
DateTime timestamp
The AntTxMessage FIT message's timestamp field.
quint8 channelNumber
The AntTxMessage FIT message's channelNumber field.
quint8 mesgId
The AntTxMessage FIT message's mesgId field.
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~AntTxMessagePrivate()

AntTxMessagePrivate::~AntTxMessagePrivate ( )
virtual

Destroys the AntTxMessagePrivate object.

Definition at line 232 of file anttxmessage.cpp.

233 {
234 
235 }

Member Function Documentation

◆ setField()

bool AntTxMessagePrivate::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 anttxmessage.cpp.

239 {
240  switch (fieldId) {
241  case 253: // See Profile.xlsx::Messages:ant_tx.timestamp
242  if (!verify(data, baseType, 4, FitBaseType::Uint32, "ant_tx.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_tx.fractionalTimestamp
246  if (!verify(data, baseType, 2, FitBaseType::Uint16, "ant_tx.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_tx.mesgId
250  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_tx.mesgId")) return false;
251  this->mesgId = static_cast<quint8>(data.at(0));
252  break;
253  case 2: // See Profile.xlsx::Messages:ant_tx.mesgData
254  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_tx.mesgData")) return false;
255  this->mesgData = static_cast<quint8>(data.at(0));
256  break;
257  case 3: // See Profile.xlsx::Messages:ant_tx.channelNumber
258  if (!verify(data, baseType, 1, FitBaseType::Uint8, "ant_tx.channelNumber")) return false;
259  this->channelNumber = static_cast<quint8>(data.at(0));
260  break;
261  case 4: // See Profile.xlsx::Messages:ant_tx.data
262  if (!verify(data, baseType, 1, FitBaseType::Byte, "ant_tx.data")) return false;
263  this->data = static_cast<quint8>(data.at(0));
264  break;
265  default:
266  qWarning() << "ignoring unknown ant_tx 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: