-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathPropertyContainer.h
113 lines (92 loc) · 4.26 KB
/
PropertyContainer.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
This file is part of ArduinoIoTCloud.
Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
This software is released under the GNU General Public License version 3,
which covers the main part of arduino-cli.
The terms of this license can be found at:
https://www.gnu.org/licenses/gpl-3.0.en.html
You can be released from the requirements of the above licenses by purchasing
a commercial license. Buying such a license is mandatory if you want to modify or
otherwise use the software for commercial activities involving the Arduino
software without disclosing the source code of your own applications. To purchase
a commercial license, send an email to [email protected].
*/
#ifndef ARDUINO_PROPERTY_CONTAINER_H_
#define ARDUINO_PROPERTY_CONTAINER_H_
/******************************************************************************
INCLUDE
******************************************************************************/
#include "Property.h"
#undef max
#undef min
#include <list>
#include "types/CloudBool.h"
#include "types/CloudFloat.h"
#include "types/CloudInt.h"
#include "types/CloudString.h"
#include "types/CloudLocation.h"
#include "types/CloudColor.h"
#include "types/CloudWrapperBase.h"
#include "types/automation/CloudColoredLight.h"
#include "types/automation/CloudContactSensor.h"
#include "types/automation/CloudDimmedLight.h"
#include "types/automation/CloudLight.h"
#include "types/automation/CloudMotionSensor.h"
#include "types/automation/CloudSmartPlug.h"
#include "types/automation/CloudSwitch.h"
#include "types/automation/CloudTemperatureSensor.h"
#include "types/automation/CloudTelevision.h"
/******************************************************************************
DECLARATION OF getTime
******************************************************************************/
extern "C" unsigned long getTime();
/******************************************************************************
TYPEDEF
******************************************************************************/
typedef std::list<Property *> PropertyContainer;
typedef CloudFloat CloudEnergy;
typedef CloudFloat CloudForce;
typedef CloudFloat CloudTemperature;
typedef CloudFloat CloudPower;
typedef CloudFloat CloudElectricCurrent;
typedef CloudFloat CloudElectricPotention;
typedef CloudFloat CloudElectricResistance;
typedef CloudFloat CloudCapacitance;
typedef CloudFloat CloudTime;
typedef CloudFloat CloudFrequency;
typedef CloudFloat CloudDataRate;
typedef CloudFloat CloudHeartRate;
typedef CloudInt CloudCounter;
typedef CloudFloat CloudAcceleration;
typedef CloudFloat CloudArea;
typedef CloudFloat CloudLenght;
typedef CloudFloat CloudVelocity;
typedef CloudFloat CloudMass;
typedef CloudFloat CloudVolume;
typedef CloudFloat CloudFlowRate;
typedef CloudFloat CloudAngle;
typedef CloudFloat CloudIlluminance;
typedef CloudFloat CloudLuminousFlux;
typedef CloudFloat CloudLuminance;
typedef CloudFloat CloudLuminousIntensity;
typedef CloudFloat CloudLogarithmicQuantity;
typedef CloudFloat CloudPressure;
typedef CloudInt CloudInformationContent;
typedef CloudFloat CloudPercentage;
typedef CloudFloat CloudRelativeHumidity;
/******************************************************************************
FUNCTION DECLARATION
******************************************************************************/
Property & addPropertyToContainer(PropertyContainer & prop_cont,
Property & property,
String const & name,
Permission const permission,
int propertyIdentifier = -1,
GetTimeCallbackFunc func = getTime);
Property * getProperty(PropertyContainer & prop_cont, String const & name);
Property * getProperty(PropertyContainer & prop_cont, int const identifier);
void updateTimestampOnLocallyChangedProperties(PropertyContainer & prop_cont);
void requestUpdateForAllProperties(PropertyContainer & prop_cont);
void updateProperty(PropertyContainer & prop_cont, String propertyName, unsigned long cloudChangeEventTime, bool const is_sync_message, std::list<CborMapData> * map_data_list);
String getPropertyNameByIdentifier(PropertyContainer & prop_cont, int propertyIdentifier);
#endif /* ARDUINO_PROPERTY_CONTAINER_H_ */