Git Product home page Git Product logo

ex_senml's Introduction

ExSenml

Toolset to Normalize SenML and other conversion promises

SenML is an open ietf standard that defines a format for representing simple sensor measurements and device parameters in Sensor Measurement Lists (SenML) You can find the spec: https://tools.ietf.org/html/rfc8428 Becoming more and more used within the IoT Domain, as common used standard for Constrained Application Protocol (CoAP) LwM2M 1.0 (https://tools.ietf.org/html/draft-ietf-core-senml) and LwM2M 1.0 uses the actual RFC.

Also adding support for https://tools.ietf.org/html/draft-keranen-core-senml-data-ct-01

Features

* (Basic) Normalized format for SenML Records (chapter 4.6 Resolve Records), A SenML Record is referred to as "resolved" if it does not contain
  any base value.
* (TODO) Support Conversion between diferent representations defined in JavaScript Object Notation (JSON), 
  Concise Binary Object Representation (CBOR), eXtensible Markup Language (XML), and Efficient XML Interchange (EXI), 
  which share the common SenML data model. 

Example

iex(1)> senml_payload_rsv_rec_1 = [%{u: "lon", v: 24.30621},%{u: "lat", v: 60.07965}]
[%{u: "lon", v: 24.30621}, %{u: "lat", v: 60.07965}]
iex(2)> ExSenml.validate_and_resolve(senml_payload_rsv_rec_1,"1234")
{:ok,
[
  %{n: "1234", t: 1559984152, u: "lat", v: 60.07965},
  %{n: "1234", t: 1559984152, u: "lon", v: 24.30621}
]}

TODO

  • Basic record normalization
  • Validate "n" fields caracters
  • Convert Beetween formats
  • Improve Documentation https://hexdocs.pm/ex_senml.
  • Make the world adopt SenML

Installation

If available in Hex, the package can be installed by adding ex_senml to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_senml, "~> 0.0.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_senml.

ex_senml's People

Contributors

sblabreu avatar

Stargazers

Marcin Bielak avatar

Watchers

James Cloos avatar

ex_senml's Issues

Bad char in name field(s)

From: https://tools.ietf.org/html/rfc8428#section-4.5.1

The concatenated name MUST consist only of characters out of the set "A" to "Z", "a" to "z", and "0" to "9", as well as "-", ":", ".", "/", and "_"; furthermore, it MUST start with a character out of the set "A" to "Z", "a" to "z", or "0" to "9".

Issue: Module should perform "name" validation as per RFC.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.