title: Receive the response sent by bluetooth control point
body: <p>I am having trouble with the control point and write procedure in swift. I know which characteristic the control point is, 0x2AD9 (fitness machine) in my case. The documentation states:
  When any of the procedures described in Sections 4.16.2.2 to 4.16.2.17 have been executed by the Server or if the procedure generated an error as defined below in this section, the Server shall indicate the Fitness Machine Control Point characteristic to the Client.</p>
  <p>The response from the control point should include a response code (0x80) the request op code (0x00 for request control) and a result code (0x01 for success)</p>
  <p>I am calling the write code after I connect to the peripheral and discover the characteristic. I have set notify to true for the control point characteristic. My write code is</p>
  <pre><code>private func sendInitialCommand() {
      let data: [UInt8] = [0x00]
      let cmd = Data(data)
      peripheral.writeValue(cmd, for: fitnessMachineCharacteristic!, type: .withResponse)
      print(&quot;command sent&quot;)
  }
  </code></pre>
  <p>I am then calling</p>
  <pre><code>func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) {
  peripheral.readValue(for: fitnessMachineCharacteristic)
  
  
  print(&quot;write success \(String(describing: characteristic.properties))&quot;)
  }
  </code></pre>
  <p>the print statement reads</p>
  <p>write success <code>CBCharacteristicProperties(rawValue: 40)</code></p>
  <p>Is the response in the raw value? And if so how do I convert that into usable data. The documentation says the response is Uint8 but trying to do that shows an error:</p>
  <p>Argument type 'CBCharacteristicProperties' does not conform to expected type 'Sequence'</p>
  <p>Here is my problem. I cannot find where the response is. I am calling .withResponse so it should show up in the didWriteValueFor, but I do not know where to look past that. The value for control point only contains .write, not .read or .notify. My console reads that the value for the control point is nil even after I write to it so I cannot pull the bytes out of that.</p>
  <p>I do not want to move on to the next operation with out confirming that access has been granted.</p>