go get github.com/objenious/senml
This package implements the SenML format (Sensor Measurement Lists, formerly known as Sensor Markup Language), as defined in RFC8428.
This package is used in production on the Objenious LoRaWAN platform, and is maintained.
Warning: a breaking change was introduced in version 1.0.0, with the Record.Version being renamed to Record.BaseVersion.
Encoding to/from JSON and XML is managed by the standard library.
s := senml.Pack{{Name:"foo", Value: senml.Float(32)}}
err := json.NewEncoder(w).Encode(s)
s := senml.Pack{}
err := json.NewDecoder(req.Body).Decode(&s)
- CBOR Representation
- EXI Representation
- Fragment Identification
Contributions are welcome, as long as :
- unit tests & comments are included,
- no external package is added to the top-level package (but allowed in sub-packages).
MIT - See LICENSE