QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bikeprofilemessage.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2021 Paul Colby
3 
4  This file is part of QtFit.
5 
6  QtFit is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  QtFit is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with QtFit. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \file
22  * \note This file is automatcially generated. Any changes here are likely to be overwritten.
23  */
24 
25 /*!
26  * \file
27  * Defines the BikeProfileMessage, and BikeProfileMessagePrivate classes.
28  */
29 
30 #include "bikeprofilemessage.h"
31 #include "bikeprofilemessage_p.h"
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class BikeProfileMessage
40  *
41  * The BikeProfileMessage class represents a FIT BikeProfileMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a BikeProfileMessage object.
48  *
49  * Typically, instances of this class will be returned by FitStreamReader::readNext, but this
50  * constructor may be used, along with the relevant setter methods, to create a valid message.
51  */
53 {
54 
55 }
56 
57 /*!
58  * \internal
59  *
60  * Constructs a BikeProfileMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the BikeProfileMessage data message's \c messageIndex field's current value.
71  *
72  * \return the \c messageIndex field value.
73  */
75 {
76  Q_D(const BikeProfileMessage);
77  return d->messageIndex;
78 }
79 
80 /*!
81  * Returns the BikeProfileMessage data message's \c name field's current value.
82  *
83  * \return the \c name field value.
84  */
85 QString BikeProfileMessage::name() const
86 {
87  Q_D(const BikeProfileMessage);
88  return d->name;
89 }
90 
91 /*!
92  * Returns the BikeProfileMessage data message's \c sport field's current value.
93  *
94  * \return the \c sport field value.
95  */
97 {
98  Q_D(const BikeProfileMessage);
99  return d->sport;
100 }
101 
102 /*!
103  * Returns the BikeProfileMessage data message's \c subSport field's current value.
104  *
105  * \return the \c subSport field value.
106  */
108 {
109  Q_D(const BikeProfileMessage);
110  return d->subSport;
111 }
112 
113 /*!
114  * Returns the BikeProfileMessage data message's \c odometer field's current value.
115  *
116  * \return the \c odometer field value.
117  */
119 {
120  Q_D(const BikeProfileMessage);
121  return d->odometer;
122 }
123 
124 /*!
125  * Returns the BikeProfileMessage data message's \c bikeSpdAntId field's current value.
126  *
127  * \return the \c bikeSpdAntId field value.
128  */
130 {
131  Q_D(const BikeProfileMessage);
132  return d->bikeSpdAntId;
133 }
134 
135 /*!
136  * Returns the BikeProfileMessage data message's \c bikeCadAntId field's current value.
137  *
138  * \return the \c bikeCadAntId field value.
139  */
141 {
142  Q_D(const BikeProfileMessage);
143  return d->bikeCadAntId;
144 }
145 
146 /*!
147  * Returns the BikeProfileMessage data message's \c bikeSpdcadAntId field's current value.
148  *
149  * \return the \c bikeSpdcadAntId field value.
150  */
152 {
153  Q_D(const BikeProfileMessage);
154  return d->bikeSpdcadAntId;
155 }
156 
157 /*!
158  * Returns the BikeProfileMessage data message's \c bikePowerAntId field's current value.
159  *
160  * \return the \c bikePowerAntId field value.
161  */
163 {
164  Q_D(const BikeProfileMessage);
165  return d->bikePowerAntId;
166 }
167 
168 /*!
169  * Returns the BikeProfileMessage data message's \c customWheelsize field's current value.
170  *
171  * \return the \c customWheelsize field value.
172  */
174 {
175  Q_D(const BikeProfileMessage);
176  return d->customWheelsize;
177 }
178 
179 /*!
180  * Returns the BikeProfileMessage data message's \c autoWheelsize field's current value.
181  *
182  * \return the \c autoWheelsize field value.
183  */
185 {
186  Q_D(const BikeProfileMessage);
187  return d->autoWheelsize;
188 }
189 
190 /*!
191  * Returns the BikeProfileMessage data message's \c bikeWeight field's current value.
192  *
193  * \return the \c bikeWeight field value.
194  */
196 {
197  Q_D(const BikeProfileMessage);
198  return d->bikeWeight;
199 }
200 
201 /*!
202  * Returns the BikeProfileMessage data message's \c powerCalFactor field's current value.
203  *
204  * \return the \c powerCalFactor field value.
205  */
207 {
208  Q_D(const BikeProfileMessage);
209  return d->powerCalFactor;
210 }
211 
212 /*!
213  * Returns the BikeProfileMessage data message's \c autoWheelCal field's current value.
214  *
215  * \return the \c autoWheelCal field value.
216  */
218 {
219  Q_D(const BikeProfileMessage);
220  return d->autoWheelCal;
221 }
222 
223 /*!
224  * Returns the BikeProfileMessage data message's \c autoPowerZero field's current value.
225  *
226  * \return the \c autoPowerZero field value.
227  */
229 {
230  Q_D(const BikeProfileMessage);
231  return d->autoPowerZero;
232 }
233 
234 /*!
235  * Returns the BikeProfileMessage data message's \c id field's current value.
236  *
237  * \return the \c id field value.
238  */
240 {
241  Q_D(const BikeProfileMessage);
242  return d->id;
243 }
244 
245 /*!
246  * Returns the BikeProfileMessage data message's \c spdEnabled field's current value.
247  *
248  * \return the \c spdEnabled field value.
249  */
251 {
252  Q_D(const BikeProfileMessage);
253  return d->spdEnabled;
254 }
255 
256 /*!
257  * Returns the BikeProfileMessage data message's \c cadEnabled field's current value.
258  *
259  * \return the \c cadEnabled field value.
260  */
262 {
263  Q_D(const BikeProfileMessage);
264  return d->cadEnabled;
265 }
266 
267 /*!
268  * Returns the BikeProfileMessage data message's \c spdcadEnabled field's current value.
269  *
270  * \return the \c spdcadEnabled field value.
271  */
273 {
274  Q_D(const BikeProfileMessage);
275  return d->spdcadEnabled;
276 }
277 
278 /*!
279  * Returns the BikeProfileMessage data message's \c powerEnabled field's current value.
280  *
281  * \return the \c powerEnabled field value.
282  */
284 {
285  Q_D(const BikeProfileMessage);
286  return d->powerEnabled;
287 }
288 
289 /*!
290  * Returns the BikeProfileMessage data message's \c crankLength field's current value.
291  *
292  * \return the \c crankLength field value.
293  */
295 {
296  Q_D(const BikeProfileMessage);
297  return d->crankLength;
298 }
299 
300 /*!
301  * Returns the BikeProfileMessage data message's \c enabled field's current value.
302  *
303  * \return the \c enabled field value.
304  */
306 {
307  Q_D(const BikeProfileMessage);
308  return d->enabled;
309 }
310 
311 /*!
312  * Returns the BikeProfileMessage data message's \c bikeSpdAntIdTransType field's current value.
313  *
314  * \return the \c bikeSpdAntIdTransType field value.
315  */
317 {
318  Q_D(const BikeProfileMessage);
319  return d->bikeSpdAntIdTransType;
320 }
321 
322 /*!
323  * Returns the BikeProfileMessage data message's \c bikeCadAntIdTransType field's current value.
324  *
325  * \return the \c bikeCadAntIdTransType field value.
326  */
328 {
329  Q_D(const BikeProfileMessage);
330  return d->bikeCadAntIdTransType;
331 }
332 
333 /*!
334  * Returns the BikeProfileMessage data message's \c bikeSpdcadAntIdTransType field's current value.
335  *
336  * \return the \c bikeSpdcadAntIdTransType field value.
337  */
339 {
340  Q_D(const BikeProfileMessage);
341  return d->bikeSpdcadAntIdTransType;
342 }
343 
344 /*!
345  * Returns the BikeProfileMessage data message's \c bikePowerAntIdTransType field's current value.
346  *
347  * \return the \c bikePowerAntIdTransType field value.
348  */
350 {
351  Q_D(const BikeProfileMessage);
352  return d->bikePowerAntIdTransType;
353 }
354 
355 /*!
356  * Returns the BikeProfileMessage data message's \c odometerRollover field's current value.
357  *
358  * Rollover counter that can be used to extend the odometer
359  *
360  * \return the \c odometerRollover field value.
361  */
363 {
364  Q_D(const BikeProfileMessage);
365  return d->odometerRollover;
366 }
367 
368 /*!
369  * Returns the BikeProfileMessage data message's \c frontGearNum field's current value.
370  *
371  * Number of front gears
372  *
373  * \return the \c frontGearNum field value.
374  */
376 {
377  Q_D(const BikeProfileMessage);
378  return d->frontGearNum;
379 }
380 
381 /*!
382  * Returns the BikeProfileMessage data message's \c frontGear field's current value.
383  *
384  * Number of teeth on each gear 0 is innermost
385  *
386  * \return the \c frontGear field value.
387  */
389 {
390  Q_D(const BikeProfileMessage);
391  return d->frontGear;
392 }
393 
394 /*!
395  * Returns the BikeProfileMessage data message's \c rearGearNum field's current value.
396  *
397  * Number of rear gears
398  *
399  * \return the \c rearGearNum field value.
400  */
402 {
403  Q_D(const BikeProfileMessage);
404  return d->rearGearNum;
405 }
406 
407 /*!
408  * Returns the BikeProfileMessage data message's \c rearGear field's current value.
409  *
410  * Number of teeth on each gear 0 is innermost
411  *
412  * \return the \c rearGear field value.
413  */
415 {
416  Q_D(const BikeProfileMessage);
417  return d->rearGear;
418 }
419 
420 /*!
421  * Returns the BikeProfileMessage data message's \c shimanoDi2Enabled field's current value.
422  *
423  * \return the \c shimanoDi2Enabled field value.
424  */
426 {
427  Q_D(const BikeProfileMessage);
428  return d->shimanoDi2Enabled;
429 }
430 
431 /*!
432  * Sets the \c messageIndex field to \a messageIndex.
433  *
434  * \param messageIndex The field value to set.
435  */
437 {
438  Q_D(BikeProfileMessage);
439  d->messageIndex = messageIndex;
440 }
441 /*!
442  * Sets the \c name field to \a name.
443  *
444  * \param name The field value to set.
445  */
446 void BikeProfileMessage::setName(const QString name)
447 {
448  Q_D(BikeProfileMessage);
449  d->name = name;
450 }
451 /*!
452  * Sets the \c sport field to \a sport.
453  *
454  * \param sport The field value to set.
455  */
457 {
458  Q_D(BikeProfileMessage);
459  d->sport = sport;
460 }
461 /*!
462  * Sets the \c subSport field to \a subSport.
463  *
464  * \param subSport The field value to set.
465  */
467 {
468  Q_D(BikeProfileMessage);
469  d->subSport = subSport;
470 }
471 /*!
472  * Sets the \c odometer field to \a odometer.
473  *
474  * \param odometer The field value to set.
475  */
476 void BikeProfileMessage::setOdometer(const quint32 odometer)
477 {
478  Q_D(BikeProfileMessage);
479  d->odometer = odometer;
480 }
481 /*!
482  * Sets the \c bikeSpdAntId field to \a bikeSpdAntId.
483  *
484  * \param bikeSpdAntId The field value to set.
485  */
487 {
488  Q_D(BikeProfileMessage);
489  d->bikeSpdAntId = bikeSpdAntId;
490 }
491 /*!
492  * Sets the \c bikeCadAntId field to \a bikeCadAntId.
493  *
494  * \param bikeCadAntId The field value to set.
495  */
497 {
498  Q_D(BikeProfileMessage);
499  d->bikeCadAntId = bikeCadAntId;
500 }
501 /*!
502  * Sets the \c bikeSpdcadAntId field to \a bikeSpdcadAntId.
503  *
504  * \param bikeSpdcadAntId The field value to set.
505  */
507 {
508  Q_D(BikeProfileMessage);
509  d->bikeSpdcadAntId = bikeSpdcadAntId;
510 }
511 /*!
512  * Sets the \c bikePowerAntId field to \a bikePowerAntId.
513  *
514  * \param bikePowerAntId The field value to set.
515  */
517 {
518  Q_D(BikeProfileMessage);
519  d->bikePowerAntId = bikePowerAntId;
520 }
521 /*!
522  * Sets the \c customWheelsize field to \a customWheelsize.
523  *
524  * \param customWheelsize The field value to set.
525  */
526 void BikeProfileMessage::setCustomWheelsize(const quint16 customWheelsize)
527 {
528  Q_D(BikeProfileMessage);
529  d->customWheelsize = customWheelsize;
530 }
531 /*!
532  * Sets the \c autoWheelsize field to \a autoWheelsize.
533  *
534  * \param autoWheelsize The field value to set.
535  */
536 void BikeProfileMessage::setAutoWheelsize(const quint16 autoWheelsize)
537 {
538  Q_D(BikeProfileMessage);
539  d->autoWheelsize = autoWheelsize;
540 }
541 /*!
542  * Sets the \c bikeWeight field to \a bikeWeight.
543  *
544  * \param bikeWeight The field value to set.
545  */
546 void BikeProfileMessage::setBikeWeight(const quint16 bikeWeight)
547 {
548  Q_D(BikeProfileMessage);
549  d->bikeWeight = bikeWeight;
550 }
551 /*!
552  * Sets the \c powerCalFactor field to \a powerCalFactor.
553  *
554  * \param powerCalFactor The field value to set.
555  */
556 void BikeProfileMessage::setPowerCalFactor(const quint16 powerCalFactor)
557 {
558  Q_D(BikeProfileMessage);
559  d->powerCalFactor = powerCalFactor;
560 }
561 /*!
562  * Sets the \c autoWheelCal field to \a autoWheelCal.
563  *
564  * \param autoWheelCal The field value to set.
565  */
566 void BikeProfileMessage::setAutoWheelCal(const bool autoWheelCal)
567 {
568  Q_D(BikeProfileMessage);
569  d->autoWheelCal = autoWheelCal;
570 }
571 /*!
572  * Sets the \c autoPowerZero field to \a autoPowerZero.
573  *
574  * \param autoPowerZero The field value to set.
575  */
576 void BikeProfileMessage::setAutoPowerZero(const bool autoPowerZero)
577 {
578  Q_D(BikeProfileMessage);
579  d->autoPowerZero = autoPowerZero;
580 }
581 /*!
582  * Sets the \c id field to \a id.
583  *
584  * \param id The field value to set.
585  */
586 void BikeProfileMessage::setId(const quint8 id)
587 {
588  Q_D(BikeProfileMessage);
589  d->id = id;
590 }
591 /*!
592  * Sets the \c spdEnabled field to \a spdEnabled.
593  *
594  * \param spdEnabled The field value to set.
595  */
596 void BikeProfileMessage::setSpdEnabled(const bool spdEnabled)
597 {
598  Q_D(BikeProfileMessage);
599  d->spdEnabled = spdEnabled;
600 }
601 /*!
602  * Sets the \c cadEnabled field to \a cadEnabled.
603  *
604  * \param cadEnabled The field value to set.
605  */
606 void BikeProfileMessage::setCadEnabled(const bool cadEnabled)
607 {
608  Q_D(BikeProfileMessage);
609  d->cadEnabled = cadEnabled;
610 }
611 /*!
612  * Sets the \c spdcadEnabled field to \a spdcadEnabled.
613  *
614  * \param spdcadEnabled The field value to set.
615  */
616 void BikeProfileMessage::setSpdcadEnabled(const bool spdcadEnabled)
617 {
618  Q_D(BikeProfileMessage);
619  d->spdcadEnabled = spdcadEnabled;
620 }
621 /*!
622  * Sets the \c powerEnabled field to \a powerEnabled.
623  *
624  * \param powerEnabled The field value to set.
625  */
626 void BikeProfileMessage::setPowerEnabled(const bool powerEnabled)
627 {
628  Q_D(BikeProfileMessage);
629  d->powerEnabled = powerEnabled;
630 }
631 /*!
632  * Sets the \c crankLength field to \a crankLength.
633  *
634  * \param crankLength The field value to set.
635  */
636 void BikeProfileMessage::setCrankLength(const quint8 crankLength)
637 {
638  Q_D(BikeProfileMessage);
639  d->crankLength = crankLength;
640 }
641 /*!
642  * Sets the \c enabled field to \a enabled.
643  *
644  * \param enabled The field value to set.
645  */
646 void BikeProfileMessage::setEnabled(const bool enabled)
647 {
648  Q_D(BikeProfileMessage);
649  d->enabled = enabled;
650 }
651 /*!
652  * Sets the \c bikeSpdAntIdTransType field to \a bikeSpdAntIdTransType.
653  *
654  * \param bikeSpdAntIdTransType The field value to set.
655  */
656 void BikeProfileMessage::setBikeSpdAntIdTransType(const quint8z bikeSpdAntIdTransType)
657 {
658  Q_D(BikeProfileMessage);
659  d->bikeSpdAntIdTransType = bikeSpdAntIdTransType;
660 }
661 /*!
662  * Sets the \c bikeCadAntIdTransType field to \a bikeCadAntIdTransType.
663  *
664  * \param bikeCadAntIdTransType The field value to set.
665  */
666 void BikeProfileMessage::setBikeCadAntIdTransType(const quint8z bikeCadAntIdTransType)
667 {
668  Q_D(BikeProfileMessage);
669  d->bikeCadAntIdTransType = bikeCadAntIdTransType;
670 }
671 /*!
672  * Sets the \c bikeSpdcadAntIdTransType field to \a bikeSpdcadAntIdTransType.
673  *
674  * \param bikeSpdcadAntIdTransType The field value to set.
675  */
676 void BikeProfileMessage::setBikeSpdcadAntIdTransType(const quint8z bikeSpdcadAntIdTransType)
677 {
678  Q_D(BikeProfileMessage);
679  d->bikeSpdcadAntIdTransType = bikeSpdcadAntIdTransType;
680 }
681 /*!
682  * Sets the \c bikePowerAntIdTransType field to \a bikePowerAntIdTransType.
683  *
684  * \param bikePowerAntIdTransType The field value to set.
685  */
686 void BikeProfileMessage::setBikePowerAntIdTransType(const quint8z bikePowerAntIdTransType)
687 {
688  Q_D(BikeProfileMessage);
689  d->bikePowerAntIdTransType = bikePowerAntIdTransType;
690 }
691 /*!
692  * Sets the \c odometerRollover field to \a odometerRollover.
693  *
694  * \param odometerRollover The field value to set.
695  */
696 void BikeProfileMessage::setOdometerRollover(const quint8 odometerRollover)
697 {
698  Q_D(BikeProfileMessage);
699  d->odometerRollover = odometerRollover;
700 }
701 /*!
702  * Sets the \c frontGearNum field to \a frontGearNum.
703  *
704  * \param frontGearNum The field value to set.
705  */
707 {
708  Q_D(BikeProfileMessage);
709  d->frontGearNum = frontGearNum;
710 }
711 /*!
712  * Sets the \c frontGear field to \a frontGear.
713  *
714  * \param frontGear The field value to set.
715  */
717 {
718  Q_D(BikeProfileMessage);
719  d->frontGear = frontGear;
720 }
721 /*!
722  * Sets the \c rearGearNum field to \a rearGearNum.
723  *
724  * \param rearGearNum The field value to set.
725  */
727 {
728  Q_D(BikeProfileMessage);
729  d->rearGearNum = rearGearNum;
730 }
731 /*!
732  * Sets the \c rearGear field to \a rearGear.
733  *
734  * \param rearGear The field value to set.
735  */
737 {
738  Q_D(BikeProfileMessage);
739  d->rearGear = rearGear;
740 }
741 /*!
742  * Sets the \c shimanoDi2Enabled field to \a shimanoDi2Enabled.
743  *
744  * \param shimanoDi2Enabled The field value to set.
745  */
746 void BikeProfileMessage::setShimanoDi2Enabled(const bool shimanoDi2Enabled)
747 {
748  Q_D(BikeProfileMessage);
749  d->shimanoDi2Enabled = shimanoDi2Enabled;
750 }
751 
752 /// \cond internal
753 
754 /*!
755  * \internal
756  *
757  * \class BikeProfileMessagePrivate
758  *
759  * The BikeProfileMessagePrivate class provides private implementation for the BikeProfileMessage.
760  *
761  * \sa BikeProfileMessage
762  */
763 
764 /*!
765  * \internal
766  *
767  * Constructs a BikeProfileMessagePrivate object with public implementation \a q.
768  *
769  * \param q Pointer to public implementaton.
770  */
771 BikeProfileMessagePrivate::BikeProfileMessagePrivate(BikeProfileMessage * const q)
773  , messageIndex(static_cast<MessageIndex>(-1))
774  , sport(static_cast<Sport>(-1))
775  , subSport(static_cast<SubSport>(-1))
776  , odometer(0xFFFFFFFF)
777  , bikeSpdAntId(0)
778  , bikeCadAntId(0)
779  , bikeSpdcadAntId(0)
780  , bikePowerAntId(0)
781  , customWheelsize(0xFFFF)
782  , autoWheelsize(0xFFFF)
783  , bikeWeight(0xFFFF)
784  , powerCalFactor(0xFFFF)
785  , autoWheelCal(static_cast<bool>(-1))
786  , autoPowerZero(static_cast<bool>(-1))
787  , id(0xFF)
788  , spdEnabled(static_cast<bool>(-1))
789  , cadEnabled(static_cast<bool>(-1))
790  , spdcadEnabled(static_cast<bool>(-1))
791  , powerEnabled(static_cast<bool>(-1))
792  , crankLength(0xFF)
793  , enabled(static_cast<bool>(-1))
794  , bikeSpdAntIdTransType(static_cast<quint8z>(-1))
795  , bikeCadAntIdTransType(static_cast<quint8z>(-1))
796  , bikeSpdcadAntIdTransType(static_cast<quint8z>(-1))
797  , bikePowerAntIdTransType(static_cast<quint8z>(-1))
798  , odometerRollover(0xFF)
799  , frontGearNum(static_cast<quint8z>(-1))
800  , frontGear(static_cast<quint8z>(-1))
801  , rearGearNum(static_cast<quint8z>(-1))
802  , rearGear(static_cast<quint8z>(-1))
803  , shimanoDi2Enabled(static_cast<bool>(-1))
804 {
805  globalMessageNumber = MesgNum::BikeProfile;
806 }
807 
808 /*!
809  * \internal
810  *
811  * Destroys the BikeProfileMessagePrivate object.
812  */
814 {
815 
816 }
817 
819  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
820 {
821  switch (fieldId) {
822  case 254: // See Profile.xlsx::Messages:bike_profile.messageIndex
823  if (!verify(data, baseType, 2, FitBaseType::Uint16, "bike_profile.messageIndex")) return false;
824  this->messageIndex = static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
825  break;
826  case 0: // See Profile.xlsx::Messages:bike_profile.name
827  if (!verify(data, baseType, 1, FitBaseType::String, "bike_profile.name")) return false;
828  this->name = QString::fromUtf8(data);
829  break;
830  case 1: // See Profile.xlsx::Messages:bike_profile.sport
831  if (!verify(data, baseType, 1, FitBaseType::Enum, "bike_profile.sport")) return false;
832  this->sport = static_cast<Sport>(data.at(0));
833  break;
834  case 2: // See Profile.xlsx::Messages:bike_profile.subSport
835  if (!verify(data, baseType, 1, FitBaseType::Enum, "bike_profile.subSport")) return false;
836  this->subSport = static_cast<SubSport>(data.at(0));
837  break;
838  case 3: // See Profile.xlsx::Messages:bike_profile.odometer
839  if (!verify(data, baseType, 4, FitBaseType::Uint32, "bike_profile.odometer")) return false;
840  this->odometer = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
841  break;
842  case 4: // See Profile.xlsx::Messages:bike_profile.bikeSpdAntId
843  if (!verify(data, baseType, 2, FitBaseType::Uint16z, "bike_profile.bikeSpdAntId")) return false;
844  this->bikeSpdAntId = static_cast<quint16z>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
845  break;
846  case 5: // See Profile.xlsx::Messages:bike_profile.bikeCadAntId
847  if (!verify(data, baseType, 2, FitBaseType::Uint16z, "bike_profile.bikeCadAntId")) return false;
848  this->bikeCadAntId = static_cast<quint16z>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
849  break;
850  case 6: // See Profile.xlsx::Messages:bike_profile.bikeSpdcadAntId
851  if (!verify(data, baseType, 2, FitBaseType::Uint16z, "bike_profile.bikeSpdcadAntId")) return false;
852  this->bikeSpdcadAntId = static_cast<quint16z>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
853  break;
854  case 7: // See Profile.xlsx::Messages:bike_profile.bikePowerAntId
855  if (!verify(data, baseType, 2, FitBaseType::Uint16z, "bike_profile.bikePowerAntId")) return false;
856  this->bikePowerAntId = static_cast<quint16z>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
857  break;
858  case 8: // See Profile.xlsx::Messages:bike_profile.customWheelsize
859  if (!verify(data, baseType, 2, FitBaseType::Uint16, "bike_profile.customWheelsize")) return false;
860  this->customWheelsize = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
861  break;
862  case 9: // See Profile.xlsx::Messages:bike_profile.autoWheelsize
863  if (!verify(data, baseType, 2, FitBaseType::Uint16, "bike_profile.autoWheelsize")) return false;
864  this->autoWheelsize = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
865  break;
866  case 10: // See Profile.xlsx::Messages:bike_profile.bikeWeight
867  if (!verify(data, baseType, 2, FitBaseType::Uint16, "bike_profile.bikeWeight")) return false;
868  this->bikeWeight = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
869  break;
870  case 11: // See Profile.xlsx::Messages:bike_profile.powerCalFactor
871  if (!verify(data, baseType, 2, FitBaseType::Uint16, "bike_profile.powerCalFactor")) return false;
872  this->powerCalFactor = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
873  break;
874  case 12: // See Profile.xlsx::Messages:bike_profile.autoWheelCal
875  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.autoWheelCal")) return false;
876  this->autoWheelCal = static_cast<bool>(data.at(0));
877  break;
878  case 13: // See Profile.xlsx::Messages:bike_profile.autoPowerZero
879  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.autoPowerZero")) return false;
880  this->autoPowerZero = static_cast<bool>(data.at(0));
881  break;
882  case 14: // See Profile.xlsx::Messages:bike_profile.id
883  if (!verify(data, baseType, 1, FitBaseType::Uint8, "bike_profile.id")) return false;
884  this->id = static_cast<quint8>(data.at(0));
885  break;
886  case 15: // See Profile.xlsx::Messages:bike_profile.spdEnabled
887  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.spdEnabled")) return false;
888  this->spdEnabled = static_cast<bool>(data.at(0));
889  break;
890  case 16: // See Profile.xlsx::Messages:bike_profile.cadEnabled
891  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.cadEnabled")) return false;
892  this->cadEnabled = static_cast<bool>(data.at(0));
893  break;
894  case 17: // See Profile.xlsx::Messages:bike_profile.spdcadEnabled
895  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.spdcadEnabled")) return false;
896  this->spdcadEnabled = static_cast<bool>(data.at(0));
897  break;
898  case 18: // See Profile.xlsx::Messages:bike_profile.powerEnabled
899  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.powerEnabled")) return false;
900  this->powerEnabled = static_cast<bool>(data.at(0));
901  break;
902  case 19: // See Profile.xlsx::Messages:bike_profile.crankLength
903  if (!verify(data, baseType, 1, FitBaseType::Uint8, "bike_profile.crankLength")) return false;
904  this->crankLength = static_cast<quint8>(data.at(0));
905  break;
906  case 20: // See Profile.xlsx::Messages:bike_profile.enabled
907  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.enabled")) return false;
908  this->enabled = static_cast<bool>(data.at(0));
909  break;
910  case 21: // See Profile.xlsx::Messages:bike_profile.bikeSpdAntIdTransType
911  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.bikeSpdAntIdTransType")) return false;
912  this->bikeSpdAntIdTransType = static_cast<quint8z>(data.at(0));
913  break;
914  case 22: // See Profile.xlsx::Messages:bike_profile.bikeCadAntIdTransType
915  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.bikeCadAntIdTransType")) return false;
916  this->bikeCadAntIdTransType = static_cast<quint8z>(data.at(0));
917  break;
918  case 23: // See Profile.xlsx::Messages:bike_profile.bikeSpdcadAntIdTransType
919  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.bikeSpdcadAntIdTransType")) return false;
920  this->bikeSpdcadAntIdTransType = static_cast<quint8z>(data.at(0));
921  break;
922  case 24: // See Profile.xlsx::Messages:bike_profile.bikePowerAntIdTransType
923  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.bikePowerAntIdTransType")) return false;
924  this->bikePowerAntIdTransType = static_cast<quint8z>(data.at(0));
925  break;
926  case 37: // See Profile.xlsx::Messages:bike_profile.odometerRollover
927  if (!verify(data, baseType, 1, FitBaseType::Uint8, "bike_profile.odometerRollover")) return false;
928  this->odometerRollover = static_cast<quint8>(data.at(0));
929  break;
930  case 38: // See Profile.xlsx::Messages:bike_profile.frontGearNum
931  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.frontGearNum")) return false;
932  this->frontGearNum = static_cast<quint8z>(data.at(0));
933  break;
934  case 39: // See Profile.xlsx::Messages:bike_profile.frontGear
935  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.frontGear")) return false;
936  this->frontGear = static_cast<quint8z>(data.at(0));
937  break;
938  case 40: // See Profile.xlsx::Messages:bike_profile.rearGearNum
939  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.rearGearNum")) return false;
940  this->rearGearNum = static_cast<quint8z>(data.at(0));
941  break;
942  case 41: // See Profile.xlsx::Messages:bike_profile.rearGear
943  if (!verify(data, baseType, 1, FitBaseType::Uint8z, "bike_profile.rearGear")) return false;
944  this->rearGear = static_cast<quint8z>(data.at(0));
945  break;
946  case 44: // See Profile.xlsx::Messages:bike_profile.shimanoDi2Enabled
947  if (!verify(data, baseType, 0, FitBaseType::Byte, "bike_profile.shimanoDi2Enabled")) return false;
948  this->shimanoDi2Enabled = static_cast<bool>(data.at(0));
949  break;
950  default:
951  qWarning() << "ignoring unknown bike_profile message field number" << fieldId << bigEndian;
952  // Fall through to return true, as its still 'safe' to continue parsing data messages.
953  }
954  return true;
955 }
956 
957 /// \endcond
958 
#define QTFIT_END_NAMESPACE
Macro for ending the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:78
#define QTFIT_BEGIN_NAMESPACE
Macro for starting the QtFit library's top-most namespace (if one is defined).
Definition: QtFit_global.h:77
Declares the BikeProfileMessage class.
Declares the BikeProfileMessagePrivate class.
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
The AbstractDataMessage class is the polymorphic base class for all FIT Data Message classes.
quint16z bikeCadAntId
The BikeProfileMessage FIT message's bikeCadAntId field.
quint16 powerCalFactor
The BikeProfileMessage FIT message's powerCalFactor field.
quint8z bikeSpdAntIdTransType
The BikeProfileMessage FIT message's bikeSpdAntIdTransType field.
bool powerEnabled
The BikeProfileMessage FIT message's powerEnabled field.
quint16 bikeWeight
The BikeProfileMessage FIT message's bikeWeight field.
bool shimanoDi2Enabled
The BikeProfileMessage FIT message's shimanoDi2Enabled field.
quint8z bikePowerAntIdTransType
The BikeProfileMessage FIT message's bikePowerAntIdTransType field.
bool enabled
The BikeProfileMessage FIT message's enabled field.
quint8z bikeSpdcadAntIdTransType
The BikeProfileMessage FIT message's bikeSpdcadAntIdTransType field.
quint8z frontGearNum
The BikeProfileMessage FIT message's frontGearNum field.
bool autoWheelCal
The BikeProfileMessage FIT message's autoWheelCal field.
quint16 customWheelsize
The BikeProfileMessage FIT message's customWheelsize field.
quint8z frontGear
The BikeProfileMessage FIT message's frontGear field.
quint16z bikeSpdAntId
The BikeProfileMessage FIT message's bikeSpdAntId field.
quint16z bikeSpdcadAntId
The BikeProfileMessage FIT message's bikeSpdcadAntId field.
quint8 crankLength
The BikeProfileMessage FIT message's crankLength field.
quint8z bikeCadAntIdTransType
The BikeProfileMessage FIT message's bikeCadAntIdTransType field.
quint16z bikePowerAntId
The BikeProfileMessage FIT message's bikePowerAntId field.
bool autoPowerZero
The BikeProfileMessage FIT message's autoPowerZero field.
quint8z rearGear
The BikeProfileMessage FIT message's rearGear field.
Sport sport
The BikeProfileMessage FIT message's sport field.
quint32 odometer
The BikeProfileMessage FIT message's odometer field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
quint8z rearGearNum
The BikeProfileMessage FIT message's rearGearNum field.
bool spdEnabled
The BikeProfileMessage FIT message's spdEnabled field.
MessageIndex messageIndex
The BikeProfileMessage FIT message's messageIndex field.
QString name
The BikeProfileMessage FIT message's name field.
SubSport subSport
The BikeProfileMessage FIT message's subSport field.
bool spdcadEnabled
The BikeProfileMessage FIT message's spdcadEnabled field.
quint16 autoWheelsize
The BikeProfileMessage FIT message's autoWheelsize field.
quint8 odometerRollover
The BikeProfileMessage FIT message's odometerRollover field.
bool cadEnabled
The BikeProfileMessage FIT message's cadEnabled field.
The BikeProfileMessage class represents a FIT BikeProfileMessage data message.
quint8 id() const
Returns the BikeProfileMessage data message's id field's current value.
bool enabled() const
Returns the BikeProfileMessage data message's enabled field's current value.
void setOdometerRollover(const quint8 odometerRollover)
Sets the odometerRollover field to odometerRollover.
void setPowerCalFactor(const quint16 powerCalFactor)
Sets the powerCalFactor field to powerCalFactor.
quint16z bikeSpdAntId() const
Returns the BikeProfileMessage data message's bikeSpdAntId field's current value.
void setBikeWeight(const quint16 bikeWeight)
Sets the bikeWeight field to bikeWeight.
void setCadEnabled(const bool cadEnabled)
Sets the cadEnabled field to cadEnabled.
quint8 odometerRollover() const
Returns the BikeProfileMessage data message's odometerRollover field's current value.
quint8z frontGear() const
Returns the BikeProfileMessage data message's frontGear field's current value.
bool spdEnabled() const
Returns the BikeProfileMessage data message's spdEnabled field's current value.
void setSubSport(const SubSport subSport)
Sets the subSport field to subSport.
bool cadEnabled() const
Returns the BikeProfileMessage data message's cadEnabled field's current value.
void setRearGearNum(const quint8z rearGearNum)
Sets the rearGearNum field to rearGearNum.
void setMessageIndex(const MessageIndex messageIndex)
Sets the messageIndex field to messageIndex.
bool shimanoDi2Enabled() const
Returns the BikeProfileMessage data message's shimanoDi2Enabled field's current value.
void setFrontGearNum(const quint8z frontGearNum)
Sets the frontGearNum field to frontGearNum.
void setEnabled(const bool enabled)
Sets the enabled field to enabled.
BikeProfileMessage()
Constructs a BikeProfileMessage object.
quint8z rearGearNum() const
Returns the BikeProfileMessage data message's rearGearNum field's current value.
void setPowerEnabled(const bool powerEnabled)
Sets the powerEnabled field to powerEnabled.
SubSport subSport() const
Returns the BikeProfileMessage data message's subSport field's current value.
quint8z bikePowerAntIdTransType() const
Returns the BikeProfileMessage data message's bikePowerAntIdTransType field's current value.
quint16 autoWheelsize() const
Returns the BikeProfileMessage data message's autoWheelsize field's current value.
void setFrontGear(const quint8z frontGear)
Sets the frontGear field to frontGear.
quint8z bikeCadAntIdTransType() const
Returns the BikeProfileMessage data message's bikeCadAntIdTransType field's current value.
void setBikePowerAntId(const quint16z bikePowerAntId)
Sets the bikePowerAntId field to bikePowerAntId.
quint16z bikePowerAntId() const
Returns the BikeProfileMessage data message's bikePowerAntId field's current value.
void setSpdEnabled(const bool spdEnabled)
Sets the spdEnabled field to spdEnabled.
bool powerEnabled() const
Returns the BikeProfileMessage data message's powerEnabled field's current value.
void setBikeCadAntId(const quint16z bikeCadAntId)
Sets the bikeCadAntId field to bikeCadAntId.
void setAutoWheelCal(const bool autoWheelCal)
Sets the autoWheelCal field to autoWheelCal.
bool autoWheelCal() const
Returns the BikeProfileMessage data message's autoWheelCal field's current value.
quint8z frontGearNum() const
Returns the BikeProfileMessage data message's frontGearNum field's current value.
bool spdcadEnabled() const
Returns the BikeProfileMessage data message's spdcadEnabled field's current value.
void setBikePowerAntIdTransType(const quint8z bikePowerAntIdTransType)
Sets the bikePowerAntIdTransType field to bikePowerAntIdTransType.
void setBikeSpdcadAntIdTransType(const quint8z bikeSpdcadAntIdTransType)
Sets the bikeSpdcadAntIdTransType field to bikeSpdcadAntIdTransType.
void setBikeSpdcadAntId(const quint16z bikeSpdcadAntId)
Sets the bikeSpdcadAntId field to bikeSpdcadAntId.
quint16 customWheelsize() const
Returns the BikeProfileMessage data message's customWheelsize field's current value.
void setName(const QString name)
Sets the name field to name.
void setSpdcadEnabled(const bool spdcadEnabled)
Sets the spdcadEnabled field to spdcadEnabled.
bool autoPowerZero() const
Returns the BikeProfileMessage data message's autoPowerZero field's current value.
quint8 crankLength() const
Returns the BikeProfileMessage data message's crankLength field's current value.
void setShimanoDi2Enabled(const bool shimanoDi2Enabled)
Sets the shimanoDi2Enabled field to shimanoDi2Enabled.
void setId(const quint8 id)
Sets the id field to id.
quint16 bikeWeight() const
Returns the BikeProfileMessage data message's bikeWeight field's current value.
quint16 powerCalFactor() const
Returns the BikeProfileMessage data message's powerCalFactor field's current value.
void setOdometer(const quint32 odometer)
Sets the odometer field to odometer.
void setSport(const Sport sport)
Sets the sport field to sport.
void setCrankLength(const quint8 crankLength)
Sets the crankLength field to crankLength.
quint32 odometer() const
Returns the BikeProfileMessage data message's odometer field's current value.
void setBikeCadAntIdTransType(const quint8z bikeCadAntIdTransType)
Sets the bikeCadAntIdTransType field to bikeCadAntIdTransType.
quint16z bikeCadAntId() const
Returns the BikeProfileMessage data message's bikeCadAntId field's current value.
quint8z bikeSpdcadAntIdTransType() const
Returns the BikeProfileMessage data message's bikeSpdcadAntIdTransType field's current value.
void setAutoPowerZero(const bool autoPowerZero)
Sets the autoPowerZero field to autoPowerZero.
quint8z rearGear() const
Returns the BikeProfileMessage data message's rearGear field's current value.
void setCustomWheelsize(const quint16 customWheelsize)
Sets the customWheelsize field to customWheelsize.
void setAutoWheelsize(const quint16 autoWheelsize)
Sets the autoWheelsize field to autoWheelsize.
void setBikeSpdAntId(const quint16z bikeSpdAntId)
Sets the bikeSpdAntId field to bikeSpdAntId.
Sport sport() const
Returns the BikeProfileMessage data message's sport field's current value.
void setRearGear(const quint8z rearGear)
Sets the rearGear field to rearGear.
void setBikeSpdAntIdTransType(const quint8z bikeSpdAntIdTransType)
Sets the bikeSpdAntIdTransType field to bikeSpdAntIdTransType.
quint8z bikeSpdAntIdTransType() const
Returns the BikeProfileMessage data message's bikeSpdAntIdTransType field's current value.
MessageIndex messageIndex() const
Returns the BikeProfileMessage data message's messageIndex field's current value.
quint16z bikeSpdcadAntId() const
Returns the BikeProfileMessage data message's bikeSpdcadAntId field's current value.
QString name() const
Returns the BikeProfileMessage data message's name field's current value.
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
Sport
Garmin FIT Sport type.
Definition: types.h:685
quint16 quint16z
16-bit unsigned integer, with 0-is-invalid semantics.
Definition: types.h:46
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263
QTFIT_BEGIN_NAMESPACE typedef quint8 quint8z
8-bit unsigned integer, with 0-is-invalid semantics.
Definition: types.h:45
SubSport
Garmin FIT SubSport type.
Definition: types.h:881