Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jenkins
Overview
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
felix
jenkins
Commits
d5a67639
Commit
d5a67639
authored
Nov 21, 2017
by
felix
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
3e2190c6
' into HEAD
parents
cd8b6d3f
3e2190c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
src/index.js
+11
-5
src/publish.js
+13
-0
test/test.js
+1
-1
No files found.
src/index.js
View file @
d5a67639
...
...
@@ -8,10 +8,16 @@ let client = mqtt.connect({
client
.
on
(
'connect'
,
function
()
{
console
.
log
(
"connect"
);
client
.
subscribe
(
'
TDL
/#'
);
client
.
subscribe
(
'
GW/000000000006
/#'
);
});
client
.
on
(
'message'
,
function
(
topic
,
message
)
{
console
.
log
(
topic
);
console
.
log
(
message
.
toString
())
});
\ No newline at end of file
console
.
log
(
time
()
+
":"
+
topic
);
console
.
log
(
time
()
+
"buffer:"
+
message
)
console
.
log
(
time
()
+
":"
+
message
.
toString
())
});
function
time
(){
let
t
=
new
Date
();
return
t
+
" "
+
t
.
getTime
();
}
\ No newline at end of file
src/publish.js
0 → 100644
View file @
d5a67639
const
mqtt
=
require
(
'mqtt'
)
let
client
=
mqtt
.
connect
({
host
:
'120.27.235.39'
,
port
:
1883
,
username
:
'ugen'
,
password
:
'ugen'
});
client
.
on
(
'connect'
,
function
()
{
console
.
log
(
"connect"
);
client
.
publish
(
'GW/000000000006/Config'
,
JSON
.
stringify
({
"action"
:
"config"
,
"devList"
:[
"CC78AB004072"
]}));
});
\ No newline at end of file
test/test.js
View file @
d5a67639
...
...
@@ -10,7 +10,7 @@ describe('test', function () {
});
it
(
"test1"
,(
done
)
=>
{
assert
(
51
===
51
,
"e
"
);
assert
(
51
1
===
511
,
"e1
"
);
done
();
});
...
...
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