npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@adeunis/codecs

v1.7.1

Published

adeunis codecs source

Downloads

1,269

Readme

Adeunis codecs

JavaScript/Node.js library of Adeunis codecs to decode/encode Adeunis products data frames.

Install

npm i @adeunis/codecs
npm i --save-dev @types/node

Basic usage

const codec = require('@adeunis/codecs');

// All product types are defined in DecoderProducts enum (src/shared/product.enum.ts)
const productType = 'analog';
const payloadValue = '42500110000002100000';
let payloadResult;

console.log(`Decoding ${productType} frame => ${payloadValue}`);

const decoder = new codec.Decoder();

// Configure the decoder for the appropriate device 
decoder.setDeviceType(productType);

// Decode the given payload
let parserResult = decoder.decode(payloadValue);

// Incompatible frame and product
if (parserResult.error) {
    payloadResult = 'decoding issue';
} else {
    // Display result
    payloadResult = JSON.stringify(parserResult, null, 2);
}

console.log(payloadResult);

CLI

Executables for Windows, Linux and MacOS can be built from the sources using the following commands at the root folder:

  • npm run start

And one of :

  • npm run pack:exe
  • npm run pack:linux
  • npm run pack:mac

Usage with node: node bin/codec.js <command> [<args> ...] [-- <options>] Usage with executable: codec <command> [<args> ...] [-- <options>]

Available commands:

  • decode: Decode frame
  • encode: Encode frame
  • help: Show help

Available options:

  • -v, --version: Print version
  • ...: Command specific options

Decoder

Usage: codec decode <frame1> [<frame2> ...] [--deviceType <device_type>] [--network lora868|sigfox] [--csv] [--json]

Encoder

Usage: codec encode <device_type> <frame_code> [--network lora868|sigfox] [-- <encode_options>]

Demonstration (HTML pages)

Basic demo pages are available in generic\src\demo\ directory

You can also visit the demonstration web page

Product / Codec type association table

Product | Reference | APP FW version | Min codecs lib | Codec type to select -------------------------|-----------------------------------------|----------------|----------------|------------------- Analog / Analog PWR | 8180BA, 8181BA, ARF8201AA, ARF8200AA | 1.3.x | 1.3.0 | analog Analog2 / Analog2 PWR | 8180BA, 8181BA, ARF8201AA, ARF8200AA | 2.1.x | 1.7.1 | analog2 Breath | 8377AA, 8377CA | 2.4.x | 1.6.0 | breath Comfort | 8275AA, 8275CA | < 2.1.0 | 0.4.2 | comfort Comfort2 | 8275AA, 8275CA | >= 2.1.x | 1.4.0 | comfort2 Comfort CO2 | 8373AA, 8373CA | 2.2.x | 1.5.0 | comfortCo2 Comfort Serenity | 8373[A/B/C/D/I/J/K/L]R | 1.1.x | 1.7.1 | comfortSerenity Dry Contacts | 8170BA, 8171BA | 1.3.x | 0.4.2 | dc or drycontacts (since lib 1.4.0) Dry Contacts 2 | 8170BA, 8171BA | 2.1.x | 1.4.0 | drycontacts2 DeltaP | 8283AA, 8283CA | 1.5.x or 2.0.x | 1.0.0 | deltap Modbus | 8240AA, 8240BA, 8240CA | 2.x.x | 1.7.1 | modbus Motion | 8276AA, 8276CA | 1.5.x | 1.0.0 | motion Motion 2 | 8276AA, 8276CA | 2.0.x | 1.2.0 | motion Pulse / Pulse ATEX | 8230AA, 8230CA, 8230GA, 8230HA | 1.2.x | 0.4.2 | pulse Pulse 3 / Pulse 3 ATEX | 8230AA, 8230CA, 8230GA, 8230HA | 2.0.x | 1.1.0 | pulse3 Pulse 4 / Pulse 4 ATEX | 8230AA, 8230CA, 8230GA, 8230HA | 2.1.x | 1.4.0 | pulse4 Pulse 4 NB-IoT | 8335AA | 2.0.x | 0.4.2 | pulse4nbiot Repeater Sigfox | 8168AA | 2.x.x | 0.4.2 | repeater Temp / Temp 2S | 8180BA, 8181BA, 8180BA2, 8181BA2 | 1.3.x | 0.4.2 | temp Temp 3 / Temp 2S 3 | 8180BA, 8181BA 8180BA2, 8181BA2 | 2.0.x | 1.1.0 | temp3 Temp 4 / Temp 2S 4 | 8180BA, 8181BA, 8180BA2, 8181BA2 | 2.1.x | 1.4.0 | temp4 Temp 4 / Temp 2S 4 IP68 | 8180BCA, 8181BCA, 8180BCB, 8181BCB | 2.1.x | 1.4.0 | temp4 TIC CBE/LINKY MONO | 8250AA | 1.4.x | 1.3.0 | ticCbeLinkyMono TIC CBE/LINKY TRI | 8250AA | 1.4.x | 1.3.0 | ticCbeLinkyTri TIC PME-PMI | 8250AA | 1.4.x | 1.4.0 | ticPmePmi

Please note that :

  • RTU firmware version has no impact on the codec type to select
  • Bundles use the same type than the standard product