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

Public Member Functions

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

Public Attributes

quint8 developerId
 The DeveloperDataIdMessage FIT message's developerId field.
 
quint8 applicationId
 The DeveloperDataIdMessage FIT message's applicationId field.
 
Manufacturer manufacturerId
 The DeveloperDataIdMessage FIT message's manufacturerId field.
 
quint8 developerDataIndex
 The DeveloperDataIdMessage FIT message's developerDataIndex field.
 
quint32 applicationVersion
 The DeveloperDataIdMessage FIT message's applicationVersion 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 DeveloperDataIdMessagePrivate class provides private implementation for the DeveloperDataIdMessage.

See also
DeveloperDataIdMessage

Definition at line 38 of file developerdataidmessage_p.h.

Constructor & Destructor Documentation

◆ DeveloperDataIdMessagePrivate()

DeveloperDataIdMessagePrivate::DeveloperDataIdMessagePrivate ( DeveloperDataIdMessage *const  q)
explicit

Constructs a DeveloperDataIdMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 194 of file developerdataidmessage.cpp.

196  , developerId(0xFF)
197  , applicationId(0xFF)
198  , manufacturerId(static_cast<Manufacturer>(-1))
199  , developerDataIndex(0xFF)
200  , applicationVersion(0xFFFFFFFF)
201 {
202  globalMessageNumber = MesgNum::DeveloperDataId;
203 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
quint8 applicationId
The DeveloperDataIdMessage FIT message's applicationId field.
quint32 applicationVersion
The DeveloperDataIdMessage FIT message's applicationVersion field.
quint8 developerId
The DeveloperDataIdMessage FIT message's developerId field.
quint8 developerDataIndex
The DeveloperDataIdMessage FIT message's developerDataIndex field.
Manufacturer manufacturerId
The DeveloperDataIdMessage FIT message's manufacturerId field.
Manufacturer
Garmin FIT Manufacturer type.
Definition: types.h:1484

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~DeveloperDataIdMessagePrivate()

DeveloperDataIdMessagePrivate::~DeveloperDataIdMessagePrivate ( )
virtual

Destroys the DeveloperDataIdMessagePrivate object.

Definition at line 210 of file developerdataidmessage.cpp.

211 {
212 
213 }

Member Function Documentation

◆ setField()

bool DeveloperDataIdMessagePrivate::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 215 of file developerdataidmessage.cpp.

217 {
218  switch (fieldId) {
219  case 0: // See Profile.xlsx::Messages:developer_data_id.developerId
220  if (!verify(data, baseType, 1, FitBaseType::Byte, "developer_data_id.developerId")) return false;
221  this->developerId = static_cast<quint8>(data.at(0));
222  break;
223  case 1: // See Profile.xlsx::Messages:developer_data_id.applicationId
224  if (!verify(data, baseType, 1, FitBaseType::Byte, "developer_data_id.applicationId")) return false;
225  this->applicationId = static_cast<quint8>(data.at(0));
226  break;
227  case 2: // See Profile.xlsx::Messages:developer_data_id.manufacturerId
228  if (!verify(data, baseType, 2, FitBaseType::Uint16, "developer_data_id.manufacturerId")) return false;
229  this->manufacturerId = static_cast<Manufacturer>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
230  break;
231  case 3: // See Profile.xlsx::Messages:developer_data_id.developerDataIndex
232  if (!verify(data, baseType, 1, FitBaseType::Uint8, "developer_data_id.developerDataIndex")) return false;
233  this->developerDataIndex = static_cast<quint8>(data.at(0));
234  break;
235  case 4: // See Profile.xlsx::Messages:developer_data_id.applicationVersion
236  if (!verify(data, baseType, 4, FitBaseType::Uint32, "developer_data_id.applicationVersion")) return false;
237  this->applicationVersion = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
238  break;
239  default:
240  qWarning() << "ignoring unknown developer_data_id message field number" << fieldId << bigEndian;
241  // Fall through to return true, as its still 'safe' to continue parsing data messages.
242  }
243  return true;
244 }
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: