明树Git Lab

Commit 5401561e authored by zfp1's avatar zfp1

update

parent 2ccba9db
......@@ -9,11 +9,14 @@ const server = net.createServer((socket) => {
socket.on('data', (data) => {
const gbkString = iconv.decode(data, 'gbk');
console.log(`收到消息:${gbkString}`);
if (gbkString.includes('LetaleLetale123')) {
if (gbkString.includes('MQTT')) {
//登录
console.log("登录, “=========================")
socket.write(Buffer.from([0x20, 0x02, 0x00, 0x00]))
}
if (gbkString.includes('C0')) {
console.log("ping “=========================")
socket.write(Buffer.from([0xD0, 0x00]));
}
});
......
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