Last active
November 3, 2016 22:33
-
-
Save akexorcist/475fca29999b4a9f14f4b2629dc86074 to your computer and use it in GitHub Desktop.
BluetoothSPP HotFix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BluetoothService.java | |
// Line 358 | |
while(mmInStream.available() > 0) { | |
int data = mmInStream.read(); | |
arr_byte.add(data); | |
if(mmInStream.available() == 0) { | |
buffer = new byte[arr_byte.size()]; | |
for (int i = 0; i < arr_byte.size(); i++) { | |
buffer[i] = arr_byte.get(i).byteValue(); | |
} | |
// Send the obtained bytes to the UI Activity | |
mHandler.obtainMessage(BluetoothState.MESSAGE_READ | |
, buffer.length, -1, buffer).sendToTarget(); | |
arr_byte = new ArrayList<Integer>(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BluetoothService.java | |
// Line 358 | |
int data = mmInStream.read(); | |
if(data == 0x0A) { | |
} else if(data == 0x0D) { | |
buffer = new byte[arr_byte.size()]; | |
for(int i = 0 ; i < arr_byte.size() ; i++) { | |
buffer[i] = arr_byte.get(i).byteValue(); | |
} | |
// Send the obtained bytes to the UI Activity | |
mHandler.obtainMessage(BluetoothState.MESSAGE_READ | |
, buffer.length, -1, buffer).sendToTarget(); | |
arr_byte = new ArrayList<Integer>(); | |
} else { | |
arr_byte.add(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment