parent
60e6720511
commit
ed156a00f9
|
@ -215,6 +215,9 @@ public class MqttVerticle extends AbstractVerticle implements Handler<MqttEndpoi
|
||||||
endpointMap.remove(deviceName);
|
endpointMap.remove(deviceName);
|
||||||
MQTT_CONNECT_POOL.put(clientId, false);
|
MQTT_CONNECT_POOL.put(clientId, false);
|
||||||
DEVICE_ONLINE.clear();
|
DEVICE_ONLINE.clear();
|
||||||
|
}).pingHandler(msg->{
|
||||||
|
// 心跳 ping
|
||||||
|
ping(productKey,deviceName);
|
||||||
}).subscribeHandler(subscribe -> {
|
}).subscribeHandler(subscribe -> {
|
||||||
List<MqttSubAckReasonCode> reasonCodes = new ArrayList<>();
|
List<MqttSubAckReasonCode> reasonCodes = new ArrayList<>();
|
||||||
for (MqttTopicSubscription s : subscribe.topicSubscriptions()) {
|
for (MqttTopicSubscription s : subscribe.topicSubscriptions()) {
|
||||||
|
@ -418,6 +421,18 @@ public class MqttVerticle extends AbstractVerticle implements Handler<MqttEndpoi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ping(String productKey, String deviceName) {
|
||||||
|
thingService.post(
|
||||||
|
pluginInfo.getPluginId(),
|
||||||
|
fillAction(
|
||||||
|
DevicePing.builder()
|
||||||
|
.productKey(productKey)
|
||||||
|
.deviceName(deviceName)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private void offline(String productKey, String deviceName) {
|
private void offline(String productKey, String deviceName) {
|
||||||
thingService.post(
|
thingService.post(
|
||||||
pluginInfo.getPluginId(),
|
pluginInfo.getPluginId(),
|
||||||
|
|
Loading…
Reference in New Issue