-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
34 lines (31 loc) · 845 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const bacnet = require("bacstack");
const client = new bacnet();
client.readProperty(
"192.168.1.147",
{ type: 5, instance: 0 },
85,
(err, value) => {
console.log("value: ", value);
}
);
// const values = [
// {objectId: {type: 5, instance: 0}, values: [
// {property: {id: 85, index: 4294967295}, value: [{type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED, value: 0}], priority: 8},
// ]},
// ];
// client.writePropertyMultiple('192.168.1.147', values, (err, value) => {
// if (err) {
// console.error(err);
// }
// console.log('value: ', value);
// });
client.writeProperty(
"192.168.1.147",
{ type: 5, instance: 0 },
85,
[{ type: bacnet.enum.ApplicationTags.BACNET_APPLICATION_TAG_NULL, value: 0 }],
{ priority: 8 },
(err, value) => {
console.log("value: ", value);
}
);