1.7.1 • Published 1 year ago

@adeunis/codecs v1.7.1

Weekly downloads
99
License
MIT
Repository
-
Last release
1 year ago

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

ProductReferenceAPP FW versionMin codecs libCodec type to select
Analog / Analog PWR8180BA, 8181BA, ARF8201AA, ARF8200AA1.3.x1.3.0analog
Analog2 / Analog2 PWR8180BA, 8181BA, ARF8201AA, ARF8200AA2.1.x1.7.1analog2
Breath8377AA, 8377CA2.4.x1.6.0breath
Comfort8275AA, 8275CA< 2.1.00.4.2comfort
Comfort28275AA, 8275CA>= 2.1.x1.4.0comfort2
Comfort CO28373AA, 8373CA2.2.x1.5.0comfortCo2
Comfort Serenity8373A/B/C/D/I/J/K/LR1.1.x1.7.1comfortSerenity
Dry Contacts8170BA, 8171BA1.3.x0.4.2dc or drycontacts (since lib 1.4.0)
Dry Contacts 28170BA, 8171BA2.1.x1.4.0drycontacts2
DeltaP8283AA, 8283CA1.5.x or 2.0.x1.0.0deltap
Modbus8240AA, 8240BA, 8240CA2.x.x1.7.1modbus
Motion8276AA, 8276CA1.5.x1.0.0motion
Motion 28276AA, 8276CA2.0.x1.2.0motion
Pulse / Pulse ATEX8230AA, 8230CA, 8230GA, 8230HA1.2.x0.4.2pulse
Pulse 3 / Pulse 3 ATEX8230AA, 8230CA, 8230GA, 8230HA2.0.x1.1.0pulse3
Pulse 4 / Pulse 4 ATEX8230AA, 8230CA, 8230GA, 8230HA2.1.x1.4.0pulse4
Pulse 4 NB-IoT8335AA2.0.x0.4.2pulse4nbiot
Repeater Sigfox8168AA2.x.x0.4.2repeater
Temp / Temp 2S8180BA, 8181BA, 8180BA2, 8181BA21.3.x0.4.2temp
Temp 3 / Temp 2S 38180BA, 8181BA 8180BA2, 8181BA22.0.x1.1.0temp3
Temp 4 / Temp 2S 48180BA, 8181BA, 8180BA2, 8181BA22.1.x1.4.0temp4
Temp 4 / Temp 2S 4 IP688180BCA, 8181BCA, 8180BCB, 8181BCB2.1.x1.4.0temp4
TIC CBE/LINKY MONO8250AA1.4.x1.3.0ticCbeLinkyMono
TIC CBE/LINKY TRI8250AA1.4.x1.3.0ticCbeLinkyTri
TIC PME-PMI8250AA1.4.x1.4.0ticPmePmi

Please note that :

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

1 year ago

1.7.0

1 year ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1-0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago