@ncodefactory/gsprovider

3.1.1 • Public • Published

gsprovider

Golem stations communication provider

installation:

npm:

npm install @ncodefactory/gsprovider --save

yarn:

yarn add @ncodefactory/gsprovider

usage:

gsstate - read state from golem station

import { gsstatus } from "@ncodefactory/gsprovider";

const stateReader = gsstate(
  "golem_station_host",
  golem_station_pot,
  connection_milliseconds_timeout
);
const stateReader = gsstate("golem_station_host", golem_station_pot); // timeout is default 3000 milliseconds
const state = await stateReader(gole_station_sv_no);

gscmd - write command to golem station

import { gsstatus } from "@ncodefactory/gsprovider";

const cmdWriter = gscmd(
  "golem_station_host",
  golem_station_pot,
  connection_milliseconds_timeout
);
const cmdWriter = gscmd("golem_station_host", golem_station_pot); // timeout is default 3000 milliseconds
const command = {
  command: 1,
  sr: "bs-v5",
  sv: 1,
  nrstatus: 0,
  id_operatora: 1,
  operator_txt: "bsolarski"
};

const cmdOk = await cmdWriter(command);

Readme

Keywords

none

Package Sidebar

Install

npm i @ncodefactory/gsprovider

Weekly Downloads

1

Version

3.1.1

License

MIT

Unpacked Size

15 kB

Total Files

9

Last publish

Collaborators

  • bsolarski