šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

eep-transcoder

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eep-transcoder

and Enocean Equipment Profile (EEP) encoder and decoder that can transform between binary and json representation.

0.1.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

eep-transcoder

a module for encoding and decoding Enocean Equipment Profile (EEP) Telegrams. This is a work in progress. For now only RORG a5,d5 and f6 (no VLD) is supported...

The API will most likely still change a lot

installing

npm i -S eep-transcoder

usage

you can use this module in both node.js and in the browser.

node.js

var EnoceanTelegram = require("eep_transcoder")

browser

<script src="eep_transcoder.min.js"></script>

Examples

encoding

the encode function expects two parameters. one json representation of the telegram to be encoded, and the eep according to which it should be encoded.

var tel ={
  decoded:{
    TMP:{value:20}
  },
  _senderId: "aabbccdd"
}
var enc = EnocenTelegram.encode(tel,"a5-02-03")
console.log(enc.encoded)

the telegram will be filled with usefull defaults. So you only need to provide the data you want to change. this will most probably be the senderId and the data part which for json is stored in the decoded field.

find out what fields can be used for which telgram in the documentation

decoding

var tel = "55000a0701eba5ff0385080006be370001ffffffff4400c5"
var dec = EnoceanTelegram.decode(tel,"a5-02-03")
console.log(dec.decoded)

teach in Telegrams

you can also create teach in telegrams. to do so you need the eep you want to encod by and a senderId which should be derived from enocean.base

var id=(parseInt(en.base,16)+22).toString(16)
var ti = EnoceanTelegram.teach_in(id,"a5-02-14")
console.log(ti)

FAQs

Package last updated on 07 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts