Core Bluetooth does not support scan and connection to bluetooth PAN profile devices in iOS

Looking for a solution to scan and connect to bluetooth PAN profile devices(via NAP role). We have implemented the below code using CoreBluetooth library. With this approach, we are not able to discover PAN devices, however, other Bluetooth devices are discovered.

   public class BluetoothScanner : CBCentralManagerDelegate, ICBPeripheralDelegate
    {
        private CBCentralManager centralManager;
        CBPeripheralManager peripheralManager;
        private List<CBPeripheral> bluetoothDevices = new List<CBPeripheral>();
        private CBPeripheral connectedPeripheral;

 

        public List<CBPeripheral> BluetoothDevices { get => bluetoothDevices; set => bluetoothDevices = value; }

        public BluetoothScanner()
        {
            centralManager = new CBCentralManager(this, null);

        }


        public override void UpdatedState(CBCentralManager central)
        {
            if (central.State == CBCentralManagerState.PoweredOn)
            {
                NSDictionary keyValuePairs = new NSDictionary();
                PeripheralScanningOptions options = new PeripheralScanningOptions();
                options.AllowDuplicatesKey = true;
                central.ScanForPeripherals((CBUUID[])null,options );

            }
            else
            {
                Console.WriteLine("Bluetooth is not available");
            }
        }

        public override void DiscoveredPeripheral(CBCentralManager central, CBPeripheral peripheral, NSDictionary advertisementData, NSNumber RSSI)
        {
           
            if (advertisementData.ContainsKey(CBAdvertisement.DataServiceUUIDsKey) && advertisementData[CBAdvertisement.DataServiceUUIDsKey] is NSArray serviceUuids)
            {
              
                Console.WriteLine("serviceUUID:" + serviceUuids.ToString());
                var _serviceUuid = serviceUuids.ToString();

            
                string serviceUuid = _serviceUuid.Trim().Replace("(", "").Replace(")", "").Replace("\n", "").Replace(" ", "");
                if (serviceUuid.Equals("1116") || serviceUuid.Equals("1115") || serviceUuid.Equals("1124"))
                {
                  
                    Console.WriteLine($"Discovered NAP device: {peripheral.Name} ({peripheral.Identifier})");
                }
            }

          
            if (!BluetoothDevices.Contains(peripheral) && peripheral.Name !=null)
            {
                BluetoothDevices.Add(peripheral);
            }
           
        }

     
    }

Accepted Reply

Updated code snippet.

Replies

Updated code snippet.

Is PAN a GATT service? Note that Core Bluetooth supports only Bluetooth Low Energy (GATT services), or GATT over BDR/EDR.