| | |
| | | public void run() { |
| | | if (bean.getCount() < 3) { |
| | | HDLLog.I("没有收到新设备,发送第 " + (bean.getCount() + 1) + " 次搜索命令"); |
| | | secondTimeSearch(random1, random2, HDLDeviceManager.realDevicesDataList); |
| | | secondTimeSearch(random1, random2, (bean.getCount() + 1), HDLDeviceManager.realDevicesDataList); |
| | | } else { |
| | | if (searchTimer != null) { |
| | | searchTimer.cancel(); |
| | |
| | | |
| | | } |
| | | } |
| | | }, 500, 500); |
| | | }, 800, 800); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param arg2 随机数2 |
| | | * @param devicesDataList 所有设备信息集 |
| | | */ |
| | | public static void secondTimeSearch(byte arg1, byte arg2, List<DevicesData> devicesDataList) { |
| | | public static void secondTimeSearch(byte arg1, byte arg2, int countSend, List<DevicesData> devicesDataList) { |
| | | if (devicesDataList == null || devicesDataList.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | sendData += (bytes[i] & 0xff) + ","; |
| | | } |
| | | } |
| | | HDLLog.I("第二次发送的搜索数据:" + sendData); |
| | | HDLLog.I("第" + countSend + "次发送的搜索数据:" + sendData); |
| | | HDLCommand.cusSendCommand(Configuration.DEVICES_SEARCH_COMMAND, 255, 255, bytes); |
| | | } |
| | | } |