| | |
| | | */ |
| | | public void onReceiveMessage(String topic, String message) { |
| | | |
| | | // 这里可以处理接收的数据 |
| | | log.info("----------------------------收到订阅内容---------------------------"); |
| | | log.info("-----TOPIC-----{}", topic); |
| | | log.info("-----Message-----{}", message); |
| | | |
| | | try { |
| | | CloudSendData cloudSendData = JSONObject.parseObject(message, CloudSendData.class); |
| | | |
| | |
| | | syncReqData.setAutoReplay(true); |
| | | syncReqData.setDevice(device); |
| | | |
| | | |
| | | BaseResp resp; |
| | | if (GatewayDeviceProtocol.DEVICE_TEST.getCode().equals(device.getSyncProtocol())) { |
| | | resp = gatewayRemoteManager.getGatewayTestService(device.getPushProtocol()).testGrain(syncReqData); |
| | | } else { |
| | | syncReqData.setAutoReplay(false); |
| | | resp = gatewayRemoteManager.getSyncGrainService(device.getSyncProtocol()).syncGrain(syncReqData); |
| | | } |
| | | |