-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathfields.cpp
266 lines (208 loc) · 9.86 KB
/
fields.cpp
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/**
* Arduino DSMR parser.
*
* This software is licensed under the MIT License.
*
* Copyright (c) 2015 Matthijs Kooijman <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Field parsing functions
*/
#include "fields.h"
using namespace dsmr;
using namespace dsmr::fields;
// Since C++11 it is possible to define the initial values for static
// const members in the class declaration, but if their address is
// taken, they still need a normal definition somewhere (to allocate
// storage).
constexpr char units::none[];
constexpr char units::kWh[];
constexpr char units::Wh[];
constexpr char units::kW[];
constexpr char units::W[];
constexpr char units::V[];
constexpr char units::mV[];
constexpr char units::A[];
constexpr char units::mA[];
constexpr char units::m3[];
constexpr char units::dm3[];
constexpr char units::GJ[];
constexpr char units::MJ[];
constexpr ObisId identification::id;
constexpr char identification::name_progmem[];
constexpr const __FlashStringHelper *identification::name;
constexpr ObisId p1_version::id;
constexpr char p1_version::name_progmem[];
constexpr const __FlashStringHelper *p1_version::name;
constexpr ObisId timestamp::id;
constexpr char timestamp::name_progmem[];
constexpr const __FlashStringHelper *timestamp::name;
constexpr ObisId equipment_id::id;
constexpr char equipment_id::name_progmem[];
constexpr const __FlashStringHelper *equipment_id::name;
constexpr ObisId energy_delivered_tariff1::id;
constexpr char energy_delivered_tariff1::name_progmem[];
constexpr const __FlashStringHelper *energy_delivered_tariff1::name;
constexpr ObisId energy_delivered_tariff2::id;
constexpr char energy_delivered_tariff2::name_progmem[];
constexpr const __FlashStringHelper *energy_delivered_tariff2::name;
constexpr ObisId energy_returned_tariff1::id;
constexpr char energy_returned_tariff1::name_progmem[];
constexpr const __FlashStringHelper *energy_returned_tariff1::name;
constexpr ObisId energy_returned_tariff2::id;
constexpr char energy_returned_tariff2::name_progmem[];
constexpr const __FlashStringHelper *energy_returned_tariff2::name;
constexpr ObisId electricity_tariff::id;
constexpr char electricity_tariff::name_progmem[];
constexpr const __FlashStringHelper *electricity_tariff::name;
constexpr ObisId power_delivered::id;
constexpr char power_delivered::name_progmem[];
constexpr const __FlashStringHelper *power_delivered::name;
constexpr ObisId power_returned::id;
constexpr char power_returned::name_progmem[];
constexpr const __FlashStringHelper *power_returned::name;
constexpr ObisId electricity_threshold::id;
constexpr char electricity_threshold::name_progmem[];
constexpr const __FlashStringHelper *electricity_threshold::name;
constexpr ObisId electricity_switch_position::id;
constexpr char electricity_switch_position::name_progmem[];
constexpr const __FlashStringHelper *electricity_switch_position::name;
constexpr ObisId electricity_failures::id;
constexpr char electricity_failures::name_progmem[];
constexpr const __FlashStringHelper *electricity_failures::name;
constexpr ObisId electricity_long_failures::id;
constexpr char electricity_long_failures::name_progmem[];
constexpr const __FlashStringHelper *electricity_long_failures::name;
constexpr ObisId electricity_failure_log::id;
constexpr char electricity_failure_log::name_progmem[];
constexpr const __FlashStringHelper *electricity_failure_log::name;
constexpr ObisId electricity_sags_l1::id;
constexpr char electricity_sags_l1::name_progmem[];
constexpr const __FlashStringHelper *electricity_sags_l1::name;
constexpr ObisId electricity_sags_l2::id;
constexpr char electricity_sags_l2::name_progmem[];
constexpr const __FlashStringHelper *electricity_sags_l2::name;
constexpr ObisId electricity_sags_l3::id;
constexpr char electricity_sags_l3::name_progmem[];
constexpr const __FlashStringHelper *electricity_sags_l3::name;
constexpr ObisId electricity_swells_l1::id;
constexpr char electricity_swells_l1::name_progmem[];
constexpr const __FlashStringHelper *electricity_swells_l1::name;
constexpr ObisId electricity_swells_l2::id;
constexpr char electricity_swells_l2::name_progmem[];
constexpr const __FlashStringHelper *electricity_swells_l2::name;
constexpr ObisId electricity_swells_l3::id;
constexpr char electricity_swells_l3::name_progmem[];
constexpr const __FlashStringHelper *electricity_swells_l3::name;
constexpr ObisId message_short::id;
constexpr char message_short::name_progmem[];
constexpr const __FlashStringHelper *message_short::name;
constexpr ObisId message_long::id;
constexpr char message_long::name_progmem[];
constexpr const __FlashStringHelper *message_long::name;
constexpr ObisId voltage_l1::id;
constexpr char voltage_l1::name_progmem[];
constexpr const __FlashStringHelper *voltage_l1::name;
constexpr ObisId voltage_l2::id;
constexpr char voltage_l2::name_progmem[];
constexpr const __FlashStringHelper *voltage_l2::name;
constexpr ObisId voltage_l3::id;
constexpr char voltage_l3::name_progmem[];
constexpr const __FlashStringHelper *voltage_l3::name;
constexpr ObisId current_l1::id;
constexpr char current_l1::name_progmem[];
constexpr const __FlashStringHelper *current_l1::name;
constexpr ObisId current_l2::id;
constexpr char current_l2::name_progmem[];
constexpr const __FlashStringHelper *current_l2::name;
constexpr ObisId current_l3::id;
constexpr char current_l3::name_progmem[];
constexpr const __FlashStringHelper *current_l3::name;
constexpr ObisId power_delivered_l1::id;
constexpr char power_delivered_l1::name_progmem[];
constexpr const __FlashStringHelper *power_delivered_l1::name;
constexpr ObisId power_delivered_l2::id;
constexpr char power_delivered_l2::name_progmem[];
constexpr const __FlashStringHelper *power_delivered_l2::name;
constexpr ObisId power_delivered_l3::id;
constexpr char power_delivered_l3::name_progmem[];
constexpr const __FlashStringHelper *power_delivered_l3::name;
constexpr ObisId power_returned_l1::id;
constexpr char power_returned_l1::name_progmem[];
constexpr const __FlashStringHelper *power_returned_l1::name;
constexpr ObisId power_returned_l2::id;
constexpr char power_returned_l2::name_progmem[];
constexpr const __FlashStringHelper *power_returned_l2::name;
constexpr ObisId power_returned_l3::id;
constexpr char power_returned_l3::name_progmem[];
constexpr const __FlashStringHelper *power_returned_l3::name;
constexpr ObisId gas_device_type::id;
constexpr char gas_device_type::name_progmem[];
constexpr const __FlashStringHelper *gas_device_type::name;
constexpr ObisId gas_equipment_id::id;
constexpr char gas_equipment_id::name_progmem[];
constexpr const __FlashStringHelper *gas_equipment_id::name;
constexpr ObisId gas_valve_position::id;
constexpr char gas_valve_position::name_progmem[];
constexpr const __FlashStringHelper *gas_valve_position::name;
constexpr ObisId gas_delivered::id;
constexpr char gas_delivered::name_progmem[];
constexpr const __FlashStringHelper *gas_delivered::name;
constexpr ObisId gas_delivered_non_temp_converted::id;
constexpr char gas_delivered_non_temp_converted::name_progmem[];
constexpr const __FlashStringHelper *gas_delivered_non_temp_converted::name;
constexpr ObisId thermal_device_type::id;
constexpr char thermal_device_type::name_progmem[];
constexpr const __FlashStringHelper *thermal_device_type::name;
constexpr ObisId thermal_equipment_id::id;
constexpr char thermal_equipment_id::name_progmem[];
constexpr const __FlashStringHelper *thermal_equipment_id::name;
constexpr ObisId thermal_valve_position::id;
constexpr char thermal_valve_position::name_progmem[];
constexpr const __FlashStringHelper *thermal_valve_position::name;
constexpr ObisId thermal_delivered::id;
constexpr char thermal_delivered::name_progmem[];
constexpr const __FlashStringHelper *thermal_delivered::name;
constexpr ObisId water_device_type::id;
constexpr char water_device_type::name_progmem[];
constexpr const __FlashStringHelper *water_device_type::name;
constexpr ObisId water_equipment_id::id;
constexpr char water_equipment_id::name_progmem[];
constexpr const __FlashStringHelper *water_equipment_id::name;
constexpr ObisId water_valve_position::id;
constexpr char water_valve_position::name_progmem[];
constexpr const __FlashStringHelper *water_valve_position::name;
constexpr ObisId water_delivered::id;
constexpr char water_delivered::name_progmem[];
constexpr const __FlashStringHelper *water_delivered::name;
constexpr ObisId slave_device_type::id;
constexpr char slave_device_type::name_progmem[];
constexpr const __FlashStringHelper *slave_device_type::name;
constexpr ObisId slave_equipment_id::id;
constexpr char slave_equipment_id::name_progmem[];
constexpr const __FlashStringHelper *slave_equipment_id::name;
constexpr ObisId slave_valve_position::id;
constexpr char slave_valve_position::name_progmem[];
constexpr const __FlashStringHelper *slave_valve_position::name;
constexpr ObisId slave_delivered::id;
constexpr char slave_delivered::name_progmem[];
constexpr const __FlashStringHelper *slave_delivered::name;