For ADAM relay control library
- ADAM 6060
2023.8.1
- nodejs >= 18
- yarn
$ npm install loop-adam-6000
$ yarn add loop-adam-6000
- host: target host
- port: target port
- username: http auth username
- password: http auth password
- timeout: miliseconds
import { AdamOptions, useApi } from 'loop-adam-6000'
const options: AdamOptions = {
host: 'localhost',
port: 4000,
username: 'admin',
password: '12345678',
timeout: 3000, // miliseconds
}
const { getData, setData } = useApi()
const rs = await getData(options)
console.log(rs) // [true, false, false, true, false, false, false, true]
const rs = await setData(options, [
true,
true,
false,
true,
false,
false,
false,
true,
])
console.log(rs) // OK