Blame view

cloud/zkAttendance/src/main/java/com/sincere/att/mqtt/MqtUtils.java 596 Bytes
59207196   徐泉   中控指纹机,考勤看板代码提交
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
package com.sincere.att.mqtt;

public class MqtUtils {

    private static MqtUtils mqtUtils;

    private MqttManager mqttManager = null;

    public static MqtUtils getInstance() {
        if (null == mqtUtils) {
            synchronized (MqtUtils.class) {
                if (null == mqtUtils) mqtUtils = new MqtUtils();
            }
        }
        return mqtUtils;
    }

    public MqtUtils() {
        mqttManager = new MqttManager();
        mqttManager.init();
    }

    public void sendMsg(String deviceId, String content) {
        mqttManager.sendMq(deviceId, content);
    }


}