Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ademco_hb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
ademco_hb
Commits
7c2894e6
Commit
7c2894e6
authored
Jun 07, 2023
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
766c7b3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
nodejs-demo.js
swig/nodejs-demo.js
+4
-3
No files found.
swig/nodejs-demo.js
View file @
7c2894e6
const
assert
=
require
(
'assert'
);
// windows:
const
libademco
=
require
(
'./build/Release/libademco_js'
);
const
{
send
}
=
require
(
'process'
);
// linux:
// const libademco = require('./build/Release/ademco_js');
...
...
@@ -55,6 +54,8 @@ class AlarmHost {
constructor
(
socket
)
{
this
.
socket
=
socket
;
this
.
address
=
socket
.
address
().
address
;
this
.
port
=
socket
.
address
().
port
;
this
.
buf
=
null
;
this
.
inpkt
=
new
libademco
.
AdemcoPacket
();
this
.
outpkt
=
new
libademco
.
AdemcoPacket
();
...
...
@@ -83,7 +84,7 @@ class AlarmHost {
});
socket
.
on
(
'close'
,
(
error
)
=>
{
console
.
log
(
this
.
tag
()
+
error
);
console
.
log
(
this
.
tag
()
+
' disconnected, hadError='
+
error
);
});
console
.
log
(
this
.
tag
()
+
' connectd'
);
...
...
@@ -111,7 +112,7 @@ class AlarmHost {
}
tag
()
{
var
str
=
this
.
socket
.
address
().
address
+
':'
+
this
.
socket
.
address
()
.
port
;
var
str
=
this
.
address
+
':'
+
this
.
port
;
if
(
this
.
acct
)
{
str
+=
' acct='
+
this
.
acct
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment