-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidgetGPS.h
executable file
·65 lines (48 loc) · 1.12 KB
/
WidgetGPS.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @file WidgetGPS.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Oct 2016
* @brief
*
*/
#ifndef WidgetGPS_h
#define WidgetGPS_h
#ifndef BLYNK_NO_FLOAT
#include "BlynkWidgetBase.h"
class GpsParam
{
public:
GpsParam(const BlynkParam& param)
: mLat (0)
, mLon (0)
, mAlt (0)
, mSpeed (0)
{
BlynkParam::iterator it = param.begin();
if (it >= param.end())
return;
mLat = it.asDouble();
if (++it >= param.end())
return;
mLon = it.asDouble();
if (++it >= param.end())
return;
mAlt = it.asDouble();
if (++it >= param.end())
return;
mSpeed = it.asDouble();
}
double getLat() const { return mLat; }
double getLon() const { return mLon; }
double getAltitude() const { return mAlt; }
double getSpeed() const { return mSpeed; }
private:
double mLat;
double mLon;
double mAlt;
double mSpeed;
};
#endif
#endif