Skip to content

Commit 0ced8d3

Browse files
authored
Merge pull request #31 from olliiiver/develop
Adding smlOBISHertz and smlOBISDegree
2 parents 611cef2 + f256f69 commit 0ced8d3

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
],
1616
"license": "LGPL-2.1-only",
17-
"version": "0.27",
17+
"version": "0.28",
1818
"frameworks": "*",
1919
"platforms": "*"
2020
}

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SML-Parser
2-
version=0.27
2+
version=0.28
33
author=Olliiiver
44
maintainer=Olliiiver
55
sentence=C++ library to parse Smart Message Language (SML) data from smart meters.

src/sml.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,19 @@ void smlOBISAmpere(double &a)
403403
a = val;
404404
smlPow(a, sc);
405405
}
406+
407+
void smlOBISHertz(double &h)
408+
{
409+
long long int val;
410+
smlOBISByUnit(val, sc, SML_HERTZ);
411+
h = val;
412+
smlPow(h, sc);
413+
}
414+
415+
void smlOBISDegree(double &d)
416+
{
417+
long long int val;
418+
smlOBISByUnit(val, sc, SML_DEGREE);
419+
d = val;
420+
smlPow(d, sc);
421+
}

src/sml.h

+3
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,8 @@ void smlOBISWh(double &wh);
102102
void smlOBISW(double &w);
103103
void smlOBISVolt(double &v);
104104
void smlOBISAmpere(double &a);
105+
void smlOBISHertz(double &h);
106+
void smlOBISDegree(double &d);
107+
105108

106109
#endif

0 commit comments

Comments
 (0)