New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dobaos.js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dobaos.js

NodeJS library providing dobaos client functionality.

latest
Source
npmnpm
Version
0.4.24
Version published
Maintainers
1
Created
Source

dobaos.js

NodeJS library providing dobaos client functionality.

Usage

const Dobaos = require("./index.js");

/*** 
Default params may be overwritten
    dob = Dobaos({
      redis: null, // provide redis url as a string
      req_channel: "dobaos_req",
      bcast_channel: "dobaos_cast",
      service_channel: "dobaos_service",
      res_prefix: "dobaos_res",
      req_timeout: 500
    });
***/
const dob = Dobaos();

const processDobaosValue = payload => {
  if (Array.isArray(payload)) {
    return payload.forEach(processDobaosValue);
  }

  let { id, raw, value } = payload;
  console.log("broadcasted: ", id, raw, value);
};

dob.on("datapoint value", processDobaosValue);

dob.on("ready", async _ => {
  console.log("dobaos client is ready");

  // service reqs
  console.log(await dob.reset());
  console.log(await dob.getVersion());
  // baos reqs
  console.log(await dob.getServerItems());
  console.log(await dob.getDescription([1, 2, 3]));
  console.log(await dob.getValue([1, 2, 3]));

  // set value and send to bus
  console.log(await dob.setValue({ id: 3, value: true }));
  console.log(await dob.setValue([{ id: 10, value: 1 }, { id: 11, value: 0 }]));
  console.log(await dob.setValue([{ id: 10, value: 0 }, { id: 11, value: 0 }]));
  // set value without sending to bus:
  console.log(await dob.putValue([{ id: 10, value: 0 }, { id: 11, value: 0 }]));

  console.log(await dob.readValue([1, 2, 5, 6, 7, 8, 9]));
  console.log(await dob.readValue(1));
  console.log(await dob.getProgrammingMode());
  console.log(await dob.setProgrammingMode(1));
  console.log(await dob.getProgrammingMode());
  console.log(await dob.setProgrammingMode(0));
});

dob.init();

Methods

* getServerItems();
* getDescription(null/number/[number, number...]);
* getValue(null/number/[number, number...]);
* readValue(null/number/[number, number...]);
* setValue({id: number, value: <depends on dpt> }/[{id:..}, {id: ..}...]);
* getProgrammingMode();
* setProgrammingMode(0/1/false/true);
* getVersion();
* reset();

Keywords

knx

FAQs

Package last updated on 07 Jan 2021

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