1

I attempted to write the Server code and Client code using inTheHand.Net.Bluetooth to promote communication between android watch and Windows. However, the line "client.DiscoverDevices();" keeps recording the following error. Is it possible for anybody to have a look and give some help? Really appreciate it if anyone can help by any amount.

The error message is:

System.NullReferenceException: 'Object reference not set to an instance of an object.'

Occured at the line:

Bluetooth client = new BluetoothClient();
for each (var item in client.DiscoverDevices()) {
    ......
}

Such a problem will not occur when running PC-PC communication program using 32Feet.net package.

universe123
  • 103
  • 5

1 Answers1

0

Check this link for any permission on android. Do not call "new BluetoothClient()" when the application is loading. when you do this any subsequent call will fail on BluetoothRadio.GetDefault Try to call "new BlueotoothClient()" after application was loaded.

antonio
  • 548
  • 8
  • 16