|  |  | 
 |  |  |             callBack.onError(HDLLinkException.getErrorWithCode(HDLLinkCode.HDL_GATEWAY_NOT_EXIST)); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         String topicSend = topic.replace("%s", gatewayBean.getOid()); | 
 |  |  |         String topicSend = topic.replace("%s", gatewayBean.getDevice_mac()); | 
 |  |  |         //组装需要发送的数据 | 
 |  |  |         String sendStr = createSendData(jObject); | 
 |  |  | //        LogUtils.i("sendDataToLinkGateway->" + sendPath + "->本地发送\r\n" + topicSend + "\r\n" + sendStr); | 
 |  |  | //        LogUtils.i("本地发送mac---->"+mac); | 
 |  |  |         LinkRequest message = new LinkRequest(topicSend, sendStr, gatewayBean.isLocalEncrypt()); | 
 |  |  |         message.setCloudTopic(topic.replace("%s", gatewayBean.getGatewayId())); | 
 |  |  |         new HDLConnectHelper(gatewayBean.getIp_address(), message, new HDLConnectHelper.HdlSocketListener() { | 
 |  |  |             @Override | 
 |  |  |             public void onSucceed(Object msg) { | 
 |  |  |  | 
 |  |  |                 if (callBack == null) return; | 
 |  |  |                 try { | 
 |  |  |                     JSONObject jsonObject = new JSONObject(new Gson().toJson(msg)); | 
 |  |  |                     if (jsonObject.has("data")) { | 
 |  |  |                         callBack.onSuccess(jsonObject.getString("data")); | 
 |  |  |                     } | 
 |  |  | //                    LogUtils.i("本地发送mac接收数据---->"+jsonObject.getString("data")); | 
 |  |  |                 } catch (Exception e) { | 
 |  |  |                     callBack.onSuccess(e.getMessage()); | 
 |  |  |                 } |