Windows 8.1 (64bit) drops RX Netstream

Topics: Bluetooth - Microsoft
Apr 19, 2016 at 4:41 AM
This is a WPF application.

I have a BluetoothClient connected to a device..
I use cli.GetStream() to get access to the NetworkStream.

I use Async BeginRead and BeginWrite to read and write to the BT stream with blocking.
Everything works great on Windows 10, but on the Windows 8.1 laptop the Read stream stops working (or blocks forever) while the send stream works fine. (I confirmed this using a serial head adapter to the BT device to see what is coming across the BT buffer on the device).

What would cause the Read stream to stop receiving data on Windows 8.1?
Any ideas?

Notes:
  • Lenovo laptop
  • Broadcomm internal BT radio
  • drivers updated to latest (2014)
  • Microsoft stack
    private byte[] ReadStream(int len) {
      byte[] buf = new byte[len];
      int bytesRead = 0;
      ManualResetEvent evt = new ManualResetEvent(false);
      AsyncCallback callback = null;
      NetworkStream stream = m_btClient.GetStream();

      callback = ar => {
        int read = 0;
        try {
          read = m_Stream.EndRead(ar);
          Debug.WriteLine("RX read: " + read);
          bytesRead += read;
        } catch {
          bytesRead = -1;
          evt.Set();
          return;
        }
        if (read == 0) { // Con closed
          bytesRead = -1;
          return;
        }
        if (bytesRead == buf.Length) {
          evt.Set();
          return;
        }
        m_Stream.BeginRead(buf, bytesRead, buf.Length - bytesRead, callback, this);
      };

      IAsyncResult ret = m_Stream.BeginRead(buf, bytesRead, buf.Length - bytesRead, callback, this);
      evt.WaitOne();
      Debug.WriteLine("bytesRead: " + bytesRead);
      return (bytesRead == -1) ? null : buf;
    }
Apr 20, 2016 at 12:02 AM
Solved. Lenovo uses crap radios :\
Marked as answer by corby10 on 4/19/2016 at 5:02 PM