Commit 792bbc71 by felix

1

1
parent 89e665c4
...@@ -8,10 +8,16 @@ let client = mqtt.connect({ ...@@ -8,10 +8,16 @@ let client = mqtt.connect({
client.on('connect', function () { client.on('connect', function () {
console.log("connect"); console.log("connect");
client.subscribe('TDL/#'); client.subscribe('GW/000000000006/#');
}); });
client.on('message', function (topic, message) { client.on('message', function (topic, message) {
console.log(topic); console.log(time()+":"+topic);
console.log(message.toString()) console.log(time()+"buffer:"+message)
}); console.log(time()+":"+message.toString())
\ No newline at end of file });
function time(){
let t = new Date();
return t+" "+t.getTime();
}
\ No newline at end of file
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
...@@ -10,7 +10,7 @@ describe('test', function () { ...@@ -10,7 +10,7 @@ describe('test', function () {
}); });
it("test1",(done)=>{ it("test1",(done)=>{
assert(51===51,"e"); assert(511===511,"e");
done(); done();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment