opened
claudia9
username_0
Once I am calling the function: _DiscoverServices();_ My app, automatically breaks giving a _Null Pointer Exception_.
I've made sure that the variable _device_ is not null.

My problem is that I cannot debug through the code of the function, so I don't know what is the object that returns null.

I can connect to the device and disconnect, but I cannot find its services.
My device is an HC-05 Bluetooth device and I am working with Windows 10 and Android API 23.

This is my code:

```
using BluetoothLE.Core;
using BluetoothLE.Core.Events;
using Xamarin.Forms;

{...}
    public partial class DeviceTerminal : ContentPage
    {
        IDevice device;
        IAdapter adapter;
        public ObservableCollection<Grouping<IService, ICharacteristic>> DiscoveredServices { get; private set; }

        public DeviceTerminal(IAdapter adap, IDevice dev)
        {
            this.device = dev;
            this.adapter = adap;

            Debug.WriteLine("State of the device: " + (string)device.Name + " is: " + device.State.ToString());
            InitializeComponent();

            device.ServiceDiscovered += ServiceDiscovered;

// --------- It crashes here -------------
            **device.DiscoverServices();**

            //Device disconnects for X reason
            adapter.DeviceDisconnected += DeviceDisconnected;

        }
```
DiscoverServices() giving null pointer
issue
created
vbisbest
username_1
I have a similar issue, I am not getting any services and I know that 2 are running.  Did you fix your issue?
comment