diff --git a/lmbluetoothsdk/src/main/java/co/lujun/lmbluetoothsdk/service/BluetoothService.java b/lmbluetoothsdk/src/main/java/co/lujun/lmbluetoothsdk/service/BluetoothService.java index 7badc93..5804512 100755 --- a/lmbluetoothsdk/src/main/java/co/lujun/lmbluetoothsdk/service/BluetoothService.java +++ b/lmbluetoothsdk/src/main/java/co/lujun/lmbluetoothsdk/service/BluetoothService.java @@ -356,13 +356,11 @@ public void run() { int bytes; while (true) { try { - if (mmInStream.available()>0) { - bytes = mmInStream.read(buffer); - if (bytes>0) { - byte[] data = Arrays.copyOf(buffer,bytes); - if (mBluetoothListener != null) { - ((BluetoothListener) mBluetoothListener).onReadData(mmSocket.getRemoteDevice(), data); - } + bytes = mmInStream.read(buffer); + if (bytes > 0) { + byte[] data = Arrays.copyOf(buffer, bytes); + if (mBluetoothListener != null) { + ((BluetoothListener) mBluetoothListener).onReadData(mmSocket.getRemoteDevice(), data); } } } catch (IOException e) {