0

I am getting unexpected behavior. I am making a simple wrapper on Corebluetooth and made 2 apps: one acts as client and other as server.

On the server end, whenever I am updating characteristic value through [updateValue: forCharacteristic: onSubscribedCentral] I am getting response as 0. According to Apple documentation, It will return YES if the update could be sent, or NO if the underlying transmit queue is full.I googled for this error and found that this can be handled by sending the data again in peripheralManagerIsReadyToUpdateSubscribers: method. This is working fine.

Issue comes in client end.

After connecting to device, and reading values successfully, my peripheral gets disconnected with error : The specified device has disconnected from us. This happens in spite of the fact my server is continuously sending values. My problem is somewhat similar to Peripheral transmit queue issue but in my case sometime peripheral remain connected and value is updated on client side. But most of time peripheral disconnects.

I have googled a lot for the solution even tried few advices given at: CoreBluetooth repeatedly disconnecting. But of no use.

Community
  • 1
  • 1
DRK
  • 191
  • 9
  • How much data are you sending and how often? Are you sending data in a loop? If so, you may be unintentionally killing the peripheral. Based on connection interval configured on the peripheral device you may only be allowed to send so many per interval time frame. – Zach Dennis May 21 '14 at 16:03
  • I am sending 13 bytes and as far as frequency is concerned, in one case I am sending data very frequently but in other case I am sending data at regular case ie after 30s. As mentioned earlier, sometime it works perfectly in both case, but most of time peripheral gets disconnects – DRK May 23 '14 at 16:46

0 Answers0