Bluetooth-Library icon indicating copy to clipboard operation
Bluetooth-Library copied to clipboard

Reader read() not called after send bytes

Open tomeroto opened this issue 6 months ago • 0 comments

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.

tomeroto avatar May 05 '25 23:05 tomeroto