rhummelmose / BluetoothKit

Easily communicate between iOS/OSX devices using BLE
Other
2.27k stars 267 forks source link

Didn't respond to ATT #126

Open yueyuzhao opened 11 months ago

yueyuzhao commented 11 months ago

According to the CoreBluetooth document,

peripheralManager(_:didReceiveRead:)

When you receive this callback, call the respond(to:withResult:) method of the CBPeripheralManager class exactly once to respond to the read request.

source: https://developer.apple.com/documentation/corebluetooth/cbperipheralmanagerdelegate/1393257-peripheralmanager#discussion

peripheralManager(_:didReceiveWrite:)

In the same way that you respond to a read request, each time you receive this callback, call the respond(to:withResult:) method of the CBPeripheralManager class exactly once. If the requests parameter contains multiple requests, treat them as you would a single request—if you can’t fulfill an individual request, you shouldn’t fulfill any of them. Instead, call the respond(to:withResult:) method immediately, and provide a result that indicates the cause of the failure.

source: https://developer.apple.com/documentation/corebluetooth/cbperipheralmanagerdelegate/1393315-peripheralmanager#discussion