absmach / senml Goto Github PK
View Code? Open in Web Editor NEWRFC 8428 Sensor Measurement Lists (SenML) implementation
License: Apache License 2.0
RFC 8428 Sensor Measurement Lists (SenML) implementation
License: Apache License 2.0
According to the RFC 8428 spec, it seems to be valid to not have a Value in the Base Record of a JSON SenML record. Please see Section 5.1.7, first example. However, the Mainflux SenML transformer requires a Value field to be present in each SenML Record.
Meaning the following SenML is invalid according to Mainflux:
[
{
"bn": "urn:dev:ow:10e2073a01080063:",
"bt": 1648560975
},
{
"n": "temperature",
"u": "Cel",
"v": 18.3
},
{
"n": "humidity",
"u": "%RH",
"v": 42
}
]
But this is valid (first and second Records are merged):
[
{
"bn": "urn:dev:ow:10e2073a01080063:",
"bt": 1648560975,
"n": "temperature",
"u": "Cel",
"v": 18.3
},
{
"n": "humidity",
"u": "%RH",
"v": 42
}
]
You can see in the following Validate
function that an ErrNoValues
is thrown if a Value is not present:
https://github.com/mainflux/senml/blob/78a09af66021636e0974f768118d54a9674ed7ff/senml.go#L230-L232
Can you update the Mainflux SenML Validator to be in line with the RFC 8428 spec?
Hello, as I see the SenML use ' []senml.Record', not use 'senml.Pack', I found the definition of senml.Pack below:
// Pack consists of SenML records array.
type Pack struct {
XMLName *bool json:"_,omitempty" xml:"sensml"
Xmlns string json:"_,omitempty" xml:"xmlns,attr"
Records []Record xml:"senml"
}
Why not use this struct's json-Marshal?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.