QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
devicesettingsmessage.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 DeviceSettingsMessage, and DeviceSettingsMessagePrivate classes.
28  */
29 
30 #include "devicesettingsmessage.h"
32 
33 #include <QDebug>
34 #include <QtEndian>
35 
37 
38 /*!
39  * \class DeviceSettingsMessage
40  *
41  * The DeviceSettingsMessage class represents a FIT DeviceSettingsMessage data message.
42  *
43  * \sa DataMessage
44  */
45 
46 /*!
47  * Constructs a DeviceSettingsMessage 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 DeviceSettingsMessage object with private implementation \a d.
61  *
62  * \param d Pointer to private implementation.
63  */
65 {
66 
67 }
68 
69 /*!
70  * Returns the DeviceSettingsMessage data message's \c activeTimeZone field's current value.
71  *
72  * Index into time zone arrays.
73  *
74  * \return the \c activeTimeZone field value.
75  */
77 {
78  Q_D(const DeviceSettingsMessage);
79  return d->activeTimeZone;
80 }
81 
82 /*!
83  * Returns the DeviceSettingsMessage data message's \c utcOffset field's current value.
84  *
85  * Offset from system time. Required to convert timestamp from system time to UTC.
86  *
87  * \return the \c utcOffset field value.
88  */
90 {
91  Q_D(const DeviceSettingsMessage);
92  return d->utcOffset;
93 }
94 
95 /*!
96  * Returns the DeviceSettingsMessage data message's \c timeOffset field's current value.
97  *
98  * Offset from system time.
99  *
100  * \return the \c timeOffset field value.
101  */
103 {
104  Q_D(const DeviceSettingsMessage);
105  return d->timeOffset;
106 }
107 
108 /*!
109  * Returns the DeviceSettingsMessage data message's \c timeMode field's current value.
110  *
111  * Display mode for the time
112  *
113  * \return the \c timeMode field value.
114  */
116 {
117  Q_D(const DeviceSettingsMessage);
118  return d->timeMode;
119 }
120 
121 /*!
122  * Returns the DeviceSettingsMessage data message's \c timeZoneOffset field's current value.
123  *
124  * timezone offset in 1/4 hour increments
125  *
126  * \return the \c timeZoneOffset field value.
127  */
129 {
130  Q_D(const DeviceSettingsMessage);
131  return d->timeZoneOffset;
132 }
133 
134 /*!
135  * Returns the DeviceSettingsMessage data message's \c backlightMode field's current value.
136  *
137  * Mode for backlight
138  *
139  * \return the \c backlightMode field value.
140  */
142 {
143  Q_D(const DeviceSettingsMessage);
144  return d->backlightMode;
145 }
146 
147 /*!
148  * Returns the DeviceSettingsMessage data message's \c activityTrackerEnabled field's current value.
149  *
150  * Enabled state of the activity tracker functionality
151  *
152  * \return the \c activityTrackerEnabled field value.
153  */
155 {
156  Q_D(const DeviceSettingsMessage);
157  return d->activityTrackerEnabled;
158 }
159 
160 /*!
161  * Returns the DeviceSettingsMessage data message's \c clockTime field's current value.
162  *
163  * UTC timestamp used to set the devices clock and date
164  *
165  * \return the \c clockTime field value.
166  */
168 {
169  Q_D(const DeviceSettingsMessage);
170  return d->clockTime;
171 }
172 
173 /*!
174  * Returns the DeviceSettingsMessage data message's \c pagesEnabled field's current value.
175  *
176  * Bitfield to configure enabled screens for each supported loop
177  *
178  * \return the \c pagesEnabled field value.
179  */
181 {
182  Q_D(const DeviceSettingsMessage);
183  return d->pagesEnabled;
184 }
185 
186 /*!
187  * Returns the DeviceSettingsMessage data message's \c moveAlertEnabled field's current value.
188  *
189  * Enabled state of the move alert
190  *
191  * \return the \c moveAlertEnabled field value.
192  */
194 {
195  Q_D(const DeviceSettingsMessage);
196  return d->moveAlertEnabled;
197 }
198 
199 /*!
200  * Returns the DeviceSettingsMessage data message's \c dateMode field's current value.
201  *
202  * Display mode for the date
203  *
204  * \return the \c dateMode field value.
205  */
207 {
208  Q_D(const DeviceSettingsMessage);
209  return d->dateMode;
210 }
211 
212 /*!
213  * Returns the DeviceSettingsMessage data message's \c displayOrientation field's current value.
214  *
215  * \return the \c displayOrientation field value.
216  */
218 {
219  Q_D(const DeviceSettingsMessage);
220  return d->displayOrientation;
221 }
222 
223 /*!
224  * Returns the DeviceSettingsMessage data message's \c mountingSide field's current value.
225  *
226  * \return the \c mountingSide field value.
227  */
229 {
230  Q_D(const DeviceSettingsMessage);
231  return d->mountingSide;
232 }
233 
234 /*!
235  * Returns the DeviceSettingsMessage data message's \c defaultPage field's current value.
236  *
237  * Bitfield to indicate one page as default for each supported loop
238  *
239  * \return the \c defaultPage field value.
240  */
242 {
243  Q_D(const DeviceSettingsMessage);
244  return d->defaultPage;
245 }
246 
247 /*!
248  * Returns the DeviceSettingsMessage data message's \c autosyncMinSteps field's current value.
249  *
250  * Minimum steps before an autosync can occur
251  *
252  * \return the \c autosyncMinSteps field value.
253  */
255 {
256  Q_D(const DeviceSettingsMessage);
257  return d->autosyncMinSteps;
258 }
259 
260 /*!
261  * Returns the DeviceSettingsMessage data message's \c autosyncMinTime field's current value.
262  *
263  * Minimum minutes before an autosync can occur
264  *
265  * \return the \c autosyncMinTime field value.
266  */
268 {
269  Q_D(const DeviceSettingsMessage);
270  return d->autosyncMinTime;
271 }
272 
273 /*!
274  * Returns the DeviceSettingsMessage data message's \c lactateThresholdAutodetectEnabled field's current value.
275  *
276  * Enable auto-detect setting for the lactate threshold feature.
277  *
278  * \return the \c lactateThresholdAutodetectEnabled field value.
279  */
281 {
282  Q_D(const DeviceSettingsMessage);
283  return d->lactateThresholdAutodetectEnabled;
284 }
285 
286 /*!
287  * Returns the DeviceSettingsMessage data message's \c bleAutoUploadEnabled field's current value.
288  *
289  * Automatically upload using BLE
290  *
291  * \return the \c bleAutoUploadEnabled field value.
292  */
294 {
295  Q_D(const DeviceSettingsMessage);
296  return d->bleAutoUploadEnabled;
297 }
298 
299 /*!
300  * Returns the DeviceSettingsMessage data message's \c autoSyncFrequency field's current value.
301  *
302  * Helps to conserve battery by changing modes
303  *
304  * \return the \c autoSyncFrequency field value.
305  */
307 {
308  Q_D(const DeviceSettingsMessage);
309  return d->autoSyncFrequency;
310 }
311 
312 /*!
313  * Returns the DeviceSettingsMessage data message's \c autoActivityDetect field's current value.
314  *
315  * Allows setting specific activities auto-activity detect enabled/disabled settings
316  *
317  * \return the \c autoActivityDetect field value.
318  */
320 {
321  Q_D(const DeviceSettingsMessage);
322  return d->autoActivityDetect;
323 }
324 
325 /*!
326  * Returns the DeviceSettingsMessage data message's \c numberOfScreens field's current value.
327  *
328  * Number of screens configured to display
329  *
330  * \return the \c numberOfScreens field value.
331  */
333 {
334  Q_D(const DeviceSettingsMessage);
335  return d->numberOfScreens;
336 }
337 
338 /*!
339  * Returns the DeviceSettingsMessage data message's \c smartNotificationDisplayOrientation field's current value.
340  *
341  * Smart Notification display orientation
342  *
343  * \return the \c smartNotificationDisplayOrientation field value.
344  */
346 {
347  Q_D(const DeviceSettingsMessage);
348  return d->smartNotificationDisplayOrientation;
349 }
350 
351 /*!
352  * Returns the DeviceSettingsMessage data message's \c tapInterface field's current value.
353  *
354  * \return the \c tapInterface field value.
355  */
357 {
358  Q_D(const DeviceSettingsMessage);
359  return d->tapInterface;
360 }
361 
362 /*!
363  * Returns the DeviceSettingsMessage data message's \c tapSensitivity field's current value.
364  *
365  * Used to hold the tap threshold setting
366  *
367  * \return the \c tapSensitivity field value.
368  */
370 {
371  Q_D(const DeviceSettingsMessage);
372  return d->tapSensitivity;
373 }
374 
375 /*!
376  * Sets the \c activeTimeZone field to \a activeTimeZone.
377  *
378  * \param activeTimeZone The field value to set.
379  */
380 void DeviceSettingsMessage::setActiveTimeZone(const quint8 activeTimeZone)
381 {
383  d->activeTimeZone = activeTimeZone;
384 }
385 /*!
386  * Sets the \c utcOffset field to \a utcOffset.
387  *
388  * \param utcOffset The field value to set.
389  */
390 void DeviceSettingsMessage::setUtcOffset(const quint32 utcOffset)
391 {
393  d->utcOffset = utcOffset;
394 }
395 /*!
396  * Sets the \c timeOffset field to \a timeOffset.
397  *
398  * \param timeOffset The field value to set.
399  */
400 void DeviceSettingsMessage::setTimeOffset(const quint32 timeOffset)
401 {
403  d->timeOffset = timeOffset;
404 }
405 /*!
406  * Sets the \c timeMode field to \a timeMode.
407  *
408  * \param timeMode The field value to set.
409  */
411 {
413  d->timeMode = timeMode;
414 }
415 /*!
416  * Sets the \c timeZoneOffset field to \a timeZoneOffset.
417  *
418  * \param timeZoneOffset The field value to set.
419  */
420 void DeviceSettingsMessage::setTimeZoneOffset(const qint8 timeZoneOffset)
421 {
423  d->timeZoneOffset = timeZoneOffset;
424 }
425 /*!
426  * Sets the \c backlightMode field to \a backlightMode.
427  *
428  * \param backlightMode The field value to set.
429  */
431 {
433  d->backlightMode = backlightMode;
434 }
435 /*!
436  * Sets the \c activityTrackerEnabled field to \a activityTrackerEnabled.
437  *
438  * \param activityTrackerEnabled The field value to set.
439  */
440 void DeviceSettingsMessage::setActivityTrackerEnabled(const bool activityTrackerEnabled)
441 {
443  d->activityTrackerEnabled = activityTrackerEnabled;
444 }
445 /*!
446  * Sets the \c clockTime field to \a clockTime.
447  *
448  * \param clockTime The field value to set.
449  */
451 {
453  d->clockTime = clockTime;
454 }
455 /*!
456  * Sets the \c pagesEnabled field to \a pagesEnabled.
457  *
458  * \param pagesEnabled The field value to set.
459  */
460 void DeviceSettingsMessage::setPagesEnabled(const quint16 pagesEnabled)
461 {
463  d->pagesEnabled = pagesEnabled;
464 }
465 /*!
466  * Sets the \c moveAlertEnabled field to \a moveAlertEnabled.
467  *
468  * \param moveAlertEnabled The field value to set.
469  */
470 void DeviceSettingsMessage::setMoveAlertEnabled(const bool moveAlertEnabled)
471 {
473  d->moveAlertEnabled = moveAlertEnabled;
474 }
475 /*!
476  * Sets the \c dateMode field to \a dateMode.
477  *
478  * \param dateMode The field value to set.
479  */
481 {
483  d->dateMode = dateMode;
484 }
485 /*!
486  * Sets the \c displayOrientation field to \a displayOrientation.
487  *
488  * \param displayOrientation The field value to set.
489  */
491 {
493  d->displayOrientation = displayOrientation;
494 }
495 /*!
496  * Sets the \c mountingSide field to \a mountingSide.
497  *
498  * \param mountingSide The field value to set.
499  */
501 {
503  d->mountingSide = mountingSide;
504 }
505 /*!
506  * Sets the \c defaultPage field to \a defaultPage.
507  *
508  * \param defaultPage The field value to set.
509  */
510 void DeviceSettingsMessage::setDefaultPage(const quint16 defaultPage)
511 {
513  d->defaultPage = defaultPage;
514 }
515 /*!
516  * Sets the \c autosyncMinSteps field to \a autosyncMinSteps.
517  *
518  * \param autosyncMinSteps The field value to set.
519  */
520 void DeviceSettingsMessage::setAutosyncMinSteps(const quint16 autosyncMinSteps)
521 {
523  d->autosyncMinSteps = autosyncMinSteps;
524 }
525 /*!
526  * Sets the \c autosyncMinTime field to \a autosyncMinTime.
527  *
528  * \param autosyncMinTime The field value to set.
529  */
530 void DeviceSettingsMessage::setAutosyncMinTime(const quint16 autosyncMinTime)
531 {
533  d->autosyncMinTime = autosyncMinTime;
534 }
535 /*!
536  * Sets the \c lactateThresholdAutodetectEnabled field to \a lactateThresholdAutodetectEnabled.
537  *
538  * \param lactateThresholdAutodetectEnabled The field value to set.
539  */
540 void DeviceSettingsMessage::setLactateThresholdAutodetectEnabled(const bool lactateThresholdAutodetectEnabled)
541 {
543  d->lactateThresholdAutodetectEnabled = lactateThresholdAutodetectEnabled;
544 }
545 /*!
546  * Sets the \c bleAutoUploadEnabled field to \a bleAutoUploadEnabled.
547  *
548  * \param bleAutoUploadEnabled The field value to set.
549  */
550 void DeviceSettingsMessage::setBleAutoUploadEnabled(const bool bleAutoUploadEnabled)
551 {
553  d->bleAutoUploadEnabled = bleAutoUploadEnabled;
554 }
555 /*!
556  * Sets the \c autoSyncFrequency field to \a autoSyncFrequency.
557  *
558  * \param autoSyncFrequency The field value to set.
559  */
561 {
563  d->autoSyncFrequency = autoSyncFrequency;
564 }
565 /*!
566  * Sets the \c autoActivityDetect field to \a autoActivityDetect.
567  *
568  * \param autoActivityDetect The field value to set.
569  */
571 {
573  d->autoActivityDetect = autoActivityDetect;
574 }
575 /*!
576  * Sets the \c numberOfScreens field to \a numberOfScreens.
577  *
578  * \param numberOfScreens The field value to set.
579  */
580 void DeviceSettingsMessage::setNumberOfScreens(const quint8 numberOfScreens)
581 {
583  d->numberOfScreens = numberOfScreens;
584 }
585 /*!
586  * Sets the \c smartNotificationDisplayOrientation field to \a smartNotificationDisplayOrientation.
587  *
588  * \param smartNotificationDisplayOrientation The field value to set.
589  */
591 {
593  d->smartNotificationDisplayOrientation = smartNotificationDisplayOrientation;
594 }
595 /*!
596  * Sets the \c tapInterface field to \a tapInterface.
597  *
598  * \param tapInterface The field value to set.
599  */
601 {
603  d->tapInterface = tapInterface;
604 }
605 /*!
606  * Sets the \c tapSensitivity field to \a tapSensitivity.
607  *
608  * \param tapSensitivity The field value to set.
609  */
611 {
613  d->tapSensitivity = tapSensitivity;
614 }
615 
616 /// \cond internal
617 
618 /*!
619  * \internal
620  *
621  * \class DeviceSettingsMessagePrivate
622  *
623  * The DeviceSettingsMessagePrivate class provides private implementation for the DeviceSettingsMessage.
624  *
625  * \sa DeviceSettingsMessage
626  */
627 
628 /*!
629  * \internal
630  *
631  * Constructs a DeviceSettingsMessagePrivate object with public implementation \a q.
632  *
633  * \param q Pointer to public implementaton.
634  */
635 DeviceSettingsMessagePrivate::DeviceSettingsMessagePrivate(DeviceSettingsMessage * const q)
637  , activeTimeZone(0xFF)
638  , utcOffset(0xFFFFFFFF)
639  , timeOffset(0xFFFFFFFF)
640  , timeMode(static_cast<TimeMode>(-1))
641  , timeZoneOffset(0x7F)
642  , backlightMode(static_cast<BacklightMode>(-1))
643  , activityTrackerEnabled(static_cast<bool>(-1))
644  , clockTime(static_cast<DateTime>(-1))
645  , pagesEnabled(0xFFFF)
646  , moveAlertEnabled(static_cast<bool>(-1))
647  , dateMode(static_cast<DateMode>(-1))
648  , displayOrientation(static_cast<DisplayOrientation>(-1))
649  , mountingSide(static_cast<Side>(-1))
650  , defaultPage(0xFFFF)
651  , autosyncMinSteps(0xFFFF)
652  , autosyncMinTime(0xFFFF)
653  , lactateThresholdAutodetectEnabled(static_cast<bool>(-1))
654  , bleAutoUploadEnabled(static_cast<bool>(-1))
655  , autoSyncFrequency(static_cast<AutoSyncFrequency>(-1))
656  , autoActivityDetect(static_cast<AutoActivityDetect>(-1))
657  , numberOfScreens(0xFF)
658  , smartNotificationDisplayOrientation(static_cast<DisplayOrientation>(-1))
659  , tapInterface(static_cast<Switch>(-1))
660  , tapSensitivity(static_cast<TapSensitivity>(-1))
661 {
662  globalMessageNumber = MesgNum::DeviceSettings;
663 }
664 
665 /*!
666  * \internal
667  *
668  * Destroys the DeviceSettingsMessagePrivate object.
669  */
671 {
672 
673 }
674 
676  const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian)
677 {
678  switch (fieldId) {
679  case 0: // See Profile.xlsx::Messages:device_settings.activeTimeZone
680  if (!verify(data, baseType, 1, FitBaseType::Uint8, "device_settings.activeTimeZone")) return false;
681  this->activeTimeZone = static_cast<quint8>(data.at(0));
682  break;
683  case 1: // See Profile.xlsx::Messages:device_settings.utcOffset
684  if (!verify(data, baseType, 4, FitBaseType::Uint32, "device_settings.utcOffset")) return false;
685  this->utcOffset = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
686  break;
687  case 2: // See Profile.xlsx::Messages:device_settings.timeOffset
688  if (!verify(data, baseType, 4, FitBaseType::Uint32, "device_settings.timeOffset")) return false;
689  this->timeOffset = static_cast<quint32>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
690  break;
691  case 4: // See Profile.xlsx::Messages:device_settings.timeMode
692  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.timeMode")) return false;
693  this->timeMode = static_cast<TimeMode>(data.at(0));
694  break;
695  case 5: // See Profile.xlsx::Messages:device_settings.timeZoneOffset
696  if (!verify(data, baseType, 1, FitBaseType::Sint8, "device_settings.timeZoneOffset")) return false;
697  this->timeZoneOffset = static_cast<qint8>(data.at(0));
698  break;
699  case 12: // See Profile.xlsx::Messages:device_settings.backlightMode
700  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.backlightMode")) return false;
701  this->backlightMode = static_cast<BacklightMode>(data.at(0));
702  break;
703  case 36: // See Profile.xlsx::Messages:device_settings.activityTrackerEnabled
704  if (!verify(data, baseType, 0, FitBaseType::Byte, "device_settings.activityTrackerEnabled")) return false;
705  this->activityTrackerEnabled = static_cast<bool>(data.at(0));
706  break;
707  case 39: // See Profile.xlsx::Messages:device_settings.clockTime
708  if (!verify(data, baseType, 4, FitBaseType::Uint32, "device_settings.clockTime")) return false;
709  this->clockTime = static_cast<DateTime>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
710  break;
711  case 40: // See Profile.xlsx::Messages:device_settings.pagesEnabled
712  if (!verify(data, baseType, 2, FitBaseType::Uint16, "device_settings.pagesEnabled")) return false;
713  this->pagesEnabled = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
714  break;
715  case 46: // See Profile.xlsx::Messages:device_settings.moveAlertEnabled
716  if (!verify(data, baseType, 0, FitBaseType::Byte, "device_settings.moveAlertEnabled")) return false;
717  this->moveAlertEnabled = static_cast<bool>(data.at(0));
718  break;
719  case 47: // See Profile.xlsx::Messages:device_settings.dateMode
720  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.dateMode")) return false;
721  this->dateMode = static_cast<DateMode>(data.at(0));
722  break;
723  case 55: // See Profile.xlsx::Messages:device_settings.displayOrientation
724  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.displayOrientation")) return false;
725  this->displayOrientation = static_cast<DisplayOrientation>(data.at(0));
726  break;
727  case 56: // See Profile.xlsx::Messages:device_settings.mountingSide
728  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.mountingSide")) return false;
729  this->mountingSide = static_cast<Side>(data.at(0));
730  break;
731  case 57: // See Profile.xlsx::Messages:device_settings.defaultPage
732  if (!verify(data, baseType, 2, FitBaseType::Uint16, "device_settings.defaultPage")) return false;
733  this->defaultPage = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
734  break;
735  case 58: // See Profile.xlsx::Messages:device_settings.autosyncMinSteps
736  if (!verify(data, baseType, 2, FitBaseType::Uint16, "device_settings.autosyncMinSteps")) return false;
737  this->autosyncMinSteps = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
738  break;
739  case 59: // See Profile.xlsx::Messages:device_settings.autosyncMinTime
740  if (!verify(data, baseType, 2, FitBaseType::Uint16, "device_settings.autosyncMinTime")) return false;
741  this->autosyncMinTime = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
742  break;
743  case 80: // See Profile.xlsx::Messages:device_settings.lactateThresholdAutodetectEnabled
744  if (!verify(data, baseType, 0, FitBaseType::Byte, "device_settings.lactateThresholdAutodetectEnabled")) return false;
745  this->lactateThresholdAutodetectEnabled = static_cast<bool>(data.at(0));
746  break;
747  case 86: // See Profile.xlsx::Messages:device_settings.bleAutoUploadEnabled
748  if (!verify(data, baseType, 0, FitBaseType::Byte, "device_settings.bleAutoUploadEnabled")) return false;
749  this->bleAutoUploadEnabled = static_cast<bool>(data.at(0));
750  break;
751  case 89: // See Profile.xlsx::Messages:device_settings.autoSyncFrequency
752  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.autoSyncFrequency")) return false;
753  this->autoSyncFrequency = static_cast<AutoSyncFrequency>(data.at(0));
754  break;
755  case 90: // See Profile.xlsx::Messages:device_settings.autoActivityDetect
756  if (!verify(data, baseType, 4, FitBaseType::Uint32, "device_settings.autoActivityDetect")) return false;
757  this->autoActivityDetect = static_cast<AutoActivityDetect>(bigEndian ? qFromBigEndian<quint32>(data) : qFromLittleEndian<quint32>(data));
758  break;
759  case 94: // See Profile.xlsx::Messages:device_settings.numberOfScreens
760  if (!verify(data, baseType, 1, FitBaseType::Uint8, "device_settings.numberOfScreens")) return false;
761  this->numberOfScreens = static_cast<quint8>(data.at(0));
762  break;
763  case 95: // See Profile.xlsx::Messages:device_settings.smartNotificationDisplayOrientation
764  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.smartNotificationDisplayOrientation")) return false;
765  this->smartNotificationDisplayOrientation = static_cast<DisplayOrientation>(data.at(0));
766  break;
767  case 134: // See Profile.xlsx::Messages:device_settings.tapInterface
768  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.tapInterface")) return false;
769  this->tapInterface = static_cast<Switch>(data.at(0));
770  break;
771  case 174: // See Profile.xlsx::Messages:device_settings.tapSensitivity
772  if (!verify(data, baseType, 1, FitBaseType::Enum, "device_settings.tapSensitivity")) return false;
773  this->tapSensitivity = static_cast<TapSensitivity>(data.at(0));
774  break;
775  default:
776  qWarning() << "ignoring unknown device_settings message field number" << fieldId << bigEndian;
777  // Fall through to return true, as its still 'safe' to continue parsing data messages.
778  }
779  return true;
780 }
781 
782 /// \endcond
783 
#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
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.
DateTime clockTime
The DeviceSettingsMessage FIT message's clockTime field.
bool setField(const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
DisplayOrientation smartNotificationDisplayOrientation
The DeviceSettingsMessage FIT message's smartNotificationDisplayOrientation field.
quint32 utcOffset
The DeviceSettingsMessage FIT message's utcOffset field.
quint16 defaultPage
The DeviceSettingsMessage FIT message's defaultPage field.
bool activityTrackerEnabled
The DeviceSettingsMessage FIT message's activityTrackerEnabled field.
bool lactateThresholdAutodetectEnabled
The DeviceSettingsMessage FIT message's lactateThresholdAutodetectEnabled field.
qint8 timeZoneOffset
The DeviceSettingsMessage FIT message's timeZoneOffset field.
quint16 pagesEnabled
The DeviceSettingsMessage FIT message's pagesEnabled field.
DisplayOrientation displayOrientation
The DeviceSettingsMessage FIT message's displayOrientation field.
quint8 activeTimeZone
The DeviceSettingsMessage FIT message's activeTimeZone field.
quint16 autosyncMinSteps
The DeviceSettingsMessage FIT message's autosyncMinSteps field.
quint8 numberOfScreens
The DeviceSettingsMessage FIT message's numberOfScreens field.
AutoSyncFrequency autoSyncFrequency
The DeviceSettingsMessage FIT message's autoSyncFrequency field.
bool bleAutoUploadEnabled
The DeviceSettingsMessage FIT message's bleAutoUploadEnabled field.
Side mountingSide
The DeviceSettingsMessage FIT message's mountingSide field.
TapSensitivity tapSensitivity
The DeviceSettingsMessage FIT message's tapSensitivity field.
DateMode dateMode
The DeviceSettingsMessage FIT message's dateMode field.
quint32 timeOffset
The DeviceSettingsMessage FIT message's timeOffset field.
BacklightMode backlightMode
The DeviceSettingsMessage FIT message's backlightMode field.
Switch tapInterface
The DeviceSettingsMessage FIT message's tapInterface field.
quint16 autosyncMinTime
The DeviceSettingsMessage FIT message's autosyncMinTime field.
bool moveAlertEnabled
The DeviceSettingsMessage FIT message's moveAlertEnabled field.
TimeMode timeMode
The DeviceSettingsMessage FIT message's timeMode field.
AutoActivityDetect autoActivityDetect
The DeviceSettingsMessage FIT message's autoActivityDetect field.
The DeviceSettingsMessage class represents a FIT DeviceSettingsMessage data message.
void setTimeMode(const TimeMode timeMode)
Sets the timeMode field to timeMode.
quint16 autosyncMinTime() const
Returns the DeviceSettingsMessage data message's autosyncMinTime field's current value.
Side mountingSide() const
Returns the DeviceSettingsMessage data message's mountingSide field's current value.
BacklightMode backlightMode() const
Returns the DeviceSettingsMessage data message's backlightMode field's current value.
void setDateMode(const DateMode dateMode)
Sets the dateMode field to dateMode.
void setTimeZoneOffset(const qint8 timeZoneOffset)
Sets the timeZoneOffset field to timeZoneOffset.
DisplayOrientation smartNotificationDisplayOrientation() const
Returns the DeviceSettingsMessage data message's smartNotificationDisplayOrientation field's current ...
bool activityTrackerEnabled() const
Returns the DeviceSettingsMessage data message's activityTrackerEnabled field's current value.
DateMode dateMode() const
Returns the DeviceSettingsMessage data message's dateMode field's current value.
void setAutoSyncFrequency(const AutoSyncFrequency autoSyncFrequency)
Sets the autoSyncFrequency field to autoSyncFrequency.
quint16 pagesEnabled() const
Returns the DeviceSettingsMessage data message's pagesEnabled field's current value.
void setTapInterface(const Switch tapInterface)
Sets the tapInterface field to tapInterface.
DateTime clockTime() const
Returns the DeviceSettingsMessage data message's clockTime field's current value.
void setBacklightMode(const BacklightMode backlightMode)
Sets the backlightMode field to backlightMode.
void setBleAutoUploadEnabled(const bool bleAutoUploadEnabled)
Sets the bleAutoUploadEnabled field to bleAutoUploadEnabled.
void setSmartNotificationDisplayOrientation(const DisplayOrientation smartNotificationDisplayOrientation)
Sets the smartNotificationDisplayOrientation field to smartNotificationDisplayOrientation.
void setAutosyncMinSteps(const quint16 autosyncMinSteps)
Sets the autosyncMinSteps field to autosyncMinSteps.
quint16 defaultPage() const
Returns the DeviceSettingsMessage data message's defaultPage field's current value.
AutoActivityDetect autoActivityDetect() const
Returns the DeviceSettingsMessage data message's autoActivityDetect field's current value.
void setDefaultPage(const quint16 defaultPage)
Sets the defaultPage field to defaultPage.
bool moveAlertEnabled() const
Returns the DeviceSettingsMessage data message's moveAlertEnabled field's current value.
DeviceSettingsMessage()
Constructs a DeviceSettingsMessage object.
void setUtcOffset(const quint32 utcOffset)
Sets the utcOffset field to utcOffset.
qint8 timeZoneOffset() const
Returns the DeviceSettingsMessage data message's timeZoneOffset field's current value.
quint16 autosyncMinSteps() const
Returns the DeviceSettingsMessage data message's autosyncMinSteps field's current value.
TimeMode timeMode() const
Returns the DeviceSettingsMessage data message's timeMode field's current value.
void setActiveTimeZone(const quint8 activeTimeZone)
Sets the activeTimeZone field to activeTimeZone.
AutoSyncFrequency autoSyncFrequency() const
Returns the DeviceSettingsMessage data message's autoSyncFrequency field's current value.
quint8 numberOfScreens() const
Returns the DeviceSettingsMessage data message's numberOfScreens field's current value.
void setMoveAlertEnabled(const bool moveAlertEnabled)
Sets the moveAlertEnabled field to moveAlertEnabled.
TapSensitivity tapSensitivity() const
Returns the DeviceSettingsMessage data message's tapSensitivity field's current value.
bool lactateThresholdAutodetectEnabled() const
Returns the DeviceSettingsMessage data message's lactateThresholdAutodetectEnabled field's current va...
void setClockTime(const DateTime clockTime)
Sets the clockTime field to clockTime.
void setNumberOfScreens(const quint8 numberOfScreens)
Sets the numberOfScreens field to numberOfScreens.
quint8 activeTimeZone() const
Returns the DeviceSettingsMessage data message's activeTimeZone field's current value.
void setAutosyncMinTime(const quint16 autosyncMinTime)
Sets the autosyncMinTime field to autosyncMinTime.
void setTapSensitivity(const TapSensitivity tapSensitivity)
Sets the tapSensitivity field to tapSensitivity.
void setPagesEnabled(const quint16 pagesEnabled)
Sets the pagesEnabled field to pagesEnabled.
Switch tapInterface() const
Returns the DeviceSettingsMessage data message's tapInterface field's current value.
DisplayOrientation displayOrientation() const
Returns the DeviceSettingsMessage data message's displayOrientation field's current value.
void setDisplayOrientation(const DisplayOrientation displayOrientation)
Sets the displayOrientation field to displayOrientation.
void setTimeOffset(const quint32 timeOffset)
Sets the timeOffset field to timeOffset.
quint32 utcOffset() const
Returns the DeviceSettingsMessage data message's utcOffset field's current value.
bool bleAutoUploadEnabled() const
Returns the DeviceSettingsMessage data message's bleAutoUploadEnabled field's current value.
void setAutoActivityDetect(const AutoActivityDetect autoActivityDetect)
Sets the autoActivityDetect field to autoActivityDetect.
quint32 timeOffset() const
Returns the DeviceSettingsMessage data message's timeOffset field's current value.
void setActivityTrackerEnabled(const bool activityTrackerEnabled)
Sets the activityTrackerEnabled field to activityTrackerEnabled.
void setLactateThresholdAutodetectEnabled(const bool lactateThresholdAutodetectEnabled)
Sets the lactateThresholdAutodetectEnabled field to lactateThresholdAutodetectEnabled.
void setMountingSide(const Side mountingSide)
Sets the mountingSide field to mountingSide.
Declares the DeviceSettingsMessage class.
Declares the DeviceSettingsMessagePrivate class.
AutoActivityDetect
Garmin FIT AutoActivityDetect type.
Definition: types.h:3349
TimeMode
Garmin FIT TimeMode type.
Definition: types.h:1069
DisplayOrientation
Garmin FIT DisplayOrientation type.
Definition: types.h:2818
AutoSyncFrequency
Garmin FIT AutoSyncFrequency type.
Definition: types.h:3061
FitBaseType
Garmin FIT FitBaseType type.
Definition: types.h:3388
DateMode
Garmin FIT DateMode type.
Definition: types.h:1106
Side
Garmin FIT Side type.
Definition: types.h:2349
TapSensitivity
Garmin FIT TapSensitivity type.
Definition: types.h:5292
Switch
Garmin FIT Switch type.
Definition: types.h:670
BacklightMode
Garmin FIT BacklightMode type.
Definition: types.h:1087
DateTime
Seconds since UTC 00:00 Dec 31 1989.
Definition: types.h:237