Skip to content

Commit

Permalink
fix previous commit breaking bluetooth state change observer
Browse files Browse the repository at this point in the history
  • Loading branch information
shahimclt committed Feb 7, 2017
1 parent 976aafb commit b6c82f4
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b6c82f4

Please sign in to comment.