• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: BLE Write Command while Write Request is pending
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BLE Write Command while Write Request is pending


  • Subject: Re: BLE Write Command while Write Request is pending
  • From: Etan Kissling <email@hidden>
  • Date: Mon, 10 Feb 2014 13:35:37 +0000
  • Thread-topic: BLE Write Command while Write Request is pending

It’s not necessary to respond from inside the CBPeripheralManagerDelegate callback. You can also pass the request through some 
dispatch queues and handle it later, but communication will be stalled. After 10 seconds or so, if no response is sent by the application,
the link is terminated and some arbitrary values that happened to be in memory are shown to the central as error code.

What you could do is to return a success error code to the first write request, and then after the write commands send a final request
with response to gather the response of the GATT server. This is an API change to work around iOS limitations, as your originally
described scenario is currently not possible to implement.

The Bluetooth spec also doesn’t provide any guarantees that your scenario might work, but it also does not prohibit your idea from working.

Etan


On 03.02.2014, at 15:35, András Kövi <email@hidden> wrote:

You use the CBCharacteristicWriteWithResponse flag. It blocks all communication until the server sends some response. This is probably a consequence of the way the API is designed: all requests must be responded inside the appropriate callback on the peripheral manager side. There is no way to defer processing or send response later.

Actually, this is something that may require some adjustment on the API side as there are cases when the response is ignored by the framework which causes disconnection. Also, your use case is clearly not supported currently.

Regards,
Andras


2014-02-03 Walter Stephan <email@hidden>:
Hi all,

The Bluetooth specification says:

Version 4.0, Vol 3, Part F, section 3.3.2:

"It is possible for a server to receive a request and then a command before responding to the original request. The flow control of requests is not affected by the transmission of commands."

We are trying to use this like so:
The iOS app is acting as a GATT client. We first send a Write Request (CBCharacteristicWriteWithResponse) and then send one or several Write Commands (CBCharacteristicWriteWithoutResponse) before the GATT server sends either a Write Response or an Error Response.

What we are seeing is that iOS seems to queue up the Write Commands and it only puts them on the air after it got a response.

Has anyone encountered the same problem? Is there something we can do about it, or does iOS simply not support this?

Best regards,
Stephan Walter
Embedded Software Engineer

Swissphone Wireless AG
Faelmisstrasse 21
Postfach 81
CH-8833 Samstagern
Tel: +41 44 786 77 52
Fax: +41 44 786 77 71
email@hidden
www.swissphone.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >BLE Write Command while Write Request is pending (From: Walter Stephan <email@hidden>)
 >Re: BLE Write Command while Write Request is pending (From: András Kövi <email@hidden>)

  • Prev by Date: Re: iOS 7 requires power cycle to sort out BLE connectivity issues
  • Next by Date: Re: Reconnecting with peripheral
  • Previous by thread: Re: BLE Write Command while Write Request is pending
  • Next by thread: Slowness / Lag in receiving notifications through peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
  • Index(es):
    • Date
    • Thread