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

Public Member Functions

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

Public Attributes

quint8 channelNumber
 The AntChannelIdMessage FIT message's channelNumber field.
 
quint8z deviceType
 The AntChannelIdMessage FIT message's deviceType field.
 
quint16z deviceNumber
 The AntChannelIdMessage FIT message's deviceNumber field.
 
quint8z transmissionType
 The AntChannelIdMessage FIT message's transmissionType field.
 
DeviceIndex deviceIndex
 The AntChannelIdMessage FIT message's deviceIndex 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 AntChannelIdMessagePrivate class provides private implementation for the AntChannelIdMessage.

See also
AntChannelIdMessage

Definition at line 38 of file antchannelidmessage_p.h.

Constructor & Destructor Documentation

◆ AntChannelIdMessagePrivate()

AntChannelIdMessagePrivate::AntChannelIdMessagePrivate ( AntChannelIdMessage *const  q)
explicit

Constructs a AntChannelIdMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 194 of file antchannelidmessage.cpp.

196  , channelNumber(0xFF)
197  , deviceType(static_cast<quint8z>(-1))
198  , deviceNumber(0)
199  , transmissionType(static_cast<quint8z>(-1))
200  , deviceIndex(static_cast<DeviceIndex>(-1))
201 {
202  globalMessageNumber = MesgNum::AntChannelId;
203 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
DeviceIndex deviceIndex
The AntChannelIdMessage FIT message's deviceIndex field.
quint16z deviceNumber
The AntChannelIdMessage FIT message's deviceNumber field.
quint8 channelNumber
The AntChannelIdMessage FIT message's channelNumber field.
quint8z transmissionType
The AntChannelIdMessage FIT message's transmissionType field.
quint8z deviceType
The AntChannelIdMessage FIT message's deviceType field.
DeviceIndex
Garmin FIT DeviceIndex type.
Definition: types.h:278
QTFIT_BEGIN_NAMESPACE typedef quint8 quint8z
8-bit unsigned integer, with 0-is-invalid semantics.
Definition: types.h:45

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~AntChannelIdMessagePrivate()

AntChannelIdMessagePrivate::~AntChannelIdMessagePrivate ( )
virtual

Destroys the AntChannelIdMessagePrivate object.

Definition at line 210 of file antchannelidmessage.cpp.

211 {
212 
213 }

Member Function Documentation

◆ setField()

bool AntChannelIdMessagePrivate::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 antchannelidmessage.cpp.

217 {
218  switch (fieldId) {
219  case 0: // See Profile.xlsx::Messages:ant_channel_id.channelNumber
220  if (!verify(data, baseType, 1, FitBaseType::Uint8, "ant_channel_id.channelNumber")) return false;
221  this->channelNumber = static_cast<quint8>(data.at(0));
222  break;
223  case 1: // See Profile.xlsx::Messages:ant_channel_id.deviceType
224  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "ant_channel_id.deviceType")) return false;
225  this->deviceType = static_cast<quint8z>(data.at(0));
226  break;
227  case 2: // See Profile.xlsx::Messages:ant_channel_id.deviceNumber
228  if (!verify(data, baseType, 2, FitBaseType::Uint16z, "ant_channel_id.deviceNumber")) return false;
229  this->deviceNumber = static_cast<quint16z>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
230  break;
231  case 3: // See Profile.xlsx::Messages:ant_channel_id.transmissionType
232  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "ant_channel_id.transmissionType")) return false;
233  this->transmissionType = static_cast<quint8z>(data.at(0));
234  break;
235  case 4: // See Profile.xlsx::Messages:ant_channel_id.deviceIndex
236  if (!verify(data, baseType, 1, FitBaseType::Uint8, "ant_channel_id.deviceIndex")) return false;
237  this->deviceIndex = static_cast<DeviceIndex>(data.at(0));
238  break;
239  default:
240  qWarning() << "ignoring unknown ant_channel_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)
quint16 quint16z
16-bit unsigned integer, with 0-is-invalid semantics.
Definition: types.h:46

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

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