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

Public Member Functions

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

Public Attributes

quint16 softwareVersion
 The FileCreatorMessage FIT message's softwareVersion field.
 
quint8 hardwareVersion
 The FileCreatorMessage FIT message's hardwareVersion 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 FileCreatorMessagePrivate class provides private implementation for the FileCreatorMessage.

See also
FileCreatorMessage

Definition at line 38 of file filecreatormessage_p.h.

Constructor & Destructor Documentation

◆ FileCreatorMessagePrivate()

FileCreatorMessagePrivate::FileCreatorMessagePrivate ( FileCreatorMessage *const  q)
explicit

Constructs a FileCreatorMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 131 of file filecreatormessage.cpp.

133  , softwareVersion(0xFFFF)
134  , hardwareVersion(0xFF)
135 {
136  globalMessageNumber = MesgNum::FileCreator;
137 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint16 softwareVersion
The FileCreatorMessage FIT message's softwareVersion field.
quint8 hardwareVersion
The FileCreatorMessage FIT message's hardwareVersion field.

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~FileCreatorMessagePrivate()

FileCreatorMessagePrivate::~FileCreatorMessagePrivate ( )
virtual

Destroys the FileCreatorMessagePrivate object.

Definition at line 144 of file filecreatormessage.cpp.

145 {
146 
147 }

Member Function Documentation

◆ setField()

bool FileCreatorMessagePrivate::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 149 of file filecreatormessage.cpp.

151 {
152  switch (fieldId) {
153  case 0: // See Profile.xlsx::Messages:file_creator.softwareVersion
154  if (!verify(data, baseType, 2, FitBaseType::Uint16, "file_creator.softwareVersion")) return false;
155  this->softwareVersion = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
156  break;
157  case 1: // See Profile.xlsx::Messages:file_creator.hardwareVersion
158  if (!verify(data, baseType, 1, FitBaseType::Uint8, "file_creator.hardwareVersion")) return false;
159  this->hardwareVersion = static_cast<quint8>(data.at(0));
160  break;
161  default:
162  qWarning() << "ignoring unknown file_creator message field number" << fieldId << bigEndian;
163  // Fall through to return true, as its still 'safe' to continue parsing data messages.
164  }
165  return true;
166 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

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