title: L2CAP Channel data transfer
body: <p>I am working on developing BLE app using connection oriented channel . I am using nordic semiconductor nrf52 as a peripheral device and iPhone 6 as central manager. </p>
  
  <p>I have used predefined PSM value provided by Bluetooth SIG that is 0x0025.
  I am ble to connect to peripheral and open L2CAP channel successfully. </p>
  
  <p>I am getting below error :</p>
  
  <p>**[CoreBluetooth] WARNING: Unknown error: 436</p>
  
  <p>2018-06-08 10:03:17.532709-0400 BluetoothTest[407:62057] [CoreBluetooth] **No known channel matching peer  with psm 37****</p>
  
  <p>Could please let me know how to proceed and what is meaning of error code 436</p>
  
  <p>Below is my code :</p>
  
  <pre><code>   func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
          //handling callback when a peripheral is discover
          print("Central Manager PowerOn State Check:\(central.state.rawValue)")
          if (peripheral.name?.contains("Nordic_OTSX") == true)
         {
              print(peripheral.name ??  "no name")
              print("advertisement Data : \(advertisementData) ")
              central.connect(peripheral, options: nil )
              myPeripheral = peripheral
         }
      }
  
  
      func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral)
      {
          print("didConnect\(myPeripheral.debugDescription)")
          myPeripheral.delegate = self
          myPeripheral.discoverServices(nil)
      }
      //if error while making connection
      func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?)
      {
          print("error:\(error.debugDescription)")
      }
  
      //after opening L2CAP Channel
     func peripheral(_ peripheral: CBPeripheral, didOpen channel: CBL2CAPChannel?, error: Error?)
      {
          print("didOpen")
          print(error.customMirror)
          print(channel!.outputStream.debugDescription)
          print(channel!.inputStream.debugDescription)
          print(channel?.outputStream.hasSpaceAvailable)
      }
  
  
      func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?)
      {
          print("*******************************************************")
  
          if ((error) != nil) {
              print("Error discovering services: \(error!.localizedDescription)")
              return
          }
  
          guard let services = peripheral.services else {
              return
          }
          //We need to discover the all characteristic
          for service in services {
  
              peripheral.discoverCharacteristics(nil, for: service)
              // bleService = service
          }
          print("Discovered Services: \(services)")
      }
  
  
      func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?)
      {
          print("*******************************************************")
          if let charcterstics = service.characteristics
          {
              print("characteristics :")
              for char in charcterstics
              {
                 /* if char.uuid == buttonCharacteristicUUID
                  {
                      buttonCharacteristic = char
                      enableButtonNotifications(buttonCharacteristic!)
                      readButtonValue()
                  }*/
                  print(char.uuid.uuidString)
              }
          }
           peripheral.openL2CAPChannel(0x0025)
      }
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  }
  </code></pre>