Adeunis Codecs library

JavaScript/Node.js library of Adeunis codecs v1.7.1

Library able of decoding all the frames coming from our products.

Supported products
AnalogBreathComfortComfort CO2
Comfort SERENITYDelta PDry ContactsMotion
ModbusPulsePulse 4 NB-IoTRepeater
TempTIC CBE LinkyTIC PME-PMI
You can find all the details of each product (reference, app version, compatibility) here .

Getting started

Create a new directory, go into it, and execute

          npm init  (accept all default choices)
          npm i @adeunis/codecs
          npm i --save-dev @types/node
        

Create a file named demo.ts, and past the code below

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

          // Products 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
          const parserResult = decoder.decode(payloadValue);

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

          // Display result
          console.log(payloadResult);
        

Compile demo.ts

          npx tsc demo.ts
        

Execute demo.js

          node demo.js