Skip to content

Commit

Permalink
Merge pull request #14 from shahimclt/state_change_fix
Browse files Browse the repository at this point in the history
fix previous commit breaking bluetooth state change observer
  • Loading branch information
whilu authored Feb 13, 2017
2 parents 976aafb + b6c82f4 commit 89331f9
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 89331f9

Please sign in to comment.