Skip to content

Latest commit

 

History

History
89 lines (70 loc) · 1.34 KB

README.md

File metadata and controls

89 lines (70 loc) · 1.34 KB

rtklib

utility to work with rtklib using node.js

Install

npm i rtklib

Parser

  • parseConfig
const rtklib = require('rtklib');

let json = rtklib.config2JSON(myConfigString);
const fs = require('fs');
const rtklib = require('rtklib');

fs.readFile('test.conf', (err, data) => {
    let json = rtklib.config2JSON(data);
});
  • generateConfig
const rtklib = require('rtklib');
let config = rtklib.JSON2config(json);
  • llh2JSON
const rtklib = require('rtklib');
let llh = rtklib.llh2JSON(myLlhLine);

Telnet

  • constructor
const rtklib = require('rtklib');

let telnet = new rtklib.telnet();
const rtklib = require('rtklib');

let telnet = new rtklib.telnet({
    host: '192.168.0.128',
    port: 3200,
    password: 'password'
});
  • connect
const rtklib = require('rtklib');

let telnet = new rtklib.telnet();
telnet.connect().then(() => {
    console.log('Connected and authenticated!');
}).catch(error => {
    console.log(error);
});
  • exec
const rtklib = require('rtklib');

new rtklib.telnet().connect().then(connection => {
    connection.exec('status').then(response => {
        console.log(response);
    }).catch(error => {
        console.log(error);
    });
}).catch(error => {
    console.log(error);
});
  • disconnect
telnet.disconnect();