Bluetooth-Library
Bluetooth-Library copied to clipboard
Reader read() not called after send bytes
I put reader class from example like below:
public class BluetoothLineReader extends SocketReader {
private BufferedReader reader;
public BluetoothLineReader(InputStream inputStream) {
super(inputStream);
reader = new BufferedReader(new InputStreamReader(inputStream));
}
@Override
public byte[] read() throws IOException {
return reader.readLine().getBytes();
}
}
when I call the function for write the byte like below:
bluetooth.send(bytes);
sometimes the reader never called this return function:
@Override
public byte[] read() throws IOException {
return reader.readLine().getBytes();
}
I dont found any error, just no response because that function never called after send bytes.