1

I am currently developing a WPF project. I am trying to receive data from an OMRON device. The device will initiate the connection, and send the application some data. The device support two profiles, Continua (HealthDeviceSource) and SDP. I'm hoping to only use Continua.

Here's what I've tried.

bool connected = false;

while (!connected)
{
    //Works, only proceed when true.
    connected = new BluetoothDeviceInfo(new BluetoothAddress(byt)).Connected; 
}

var listener = new BluetoothListener(BluetoothService.HealthDeviceSource);
listener.Start();
try
{
    bool booll = false;
    while (!booll)
    {
        booll = listener.Pending(); //Always false, why is that so?
    }
    //If I do this instead, it just stucks here.
    //var client = listener.AcceptBluetoothClient();
    MessageBox("test");
}
catch (Exception err) { MessageBox(err.Message); }

Any help?

Jieqin
  • 588
  • 5
  • 21

0 Answers0