Re: Any iOS API and/or callbacks that would allow an app to determine timing?
Re: Any iOS API and/or callbacks that would allow an app to determine timing?
- Subject: Re: Any iOS API and/or callbacks that would allow an app to determine timing?
- From: Tyler Freeman <email@hidden>
- Date: Mon, 08 Feb 2016 21:25:54 -0800
This cannot be done within an iOS app, as far as I know, but
you can do it with your Bluetooth device's firmware, if you have
control of that.
What you're looking for is the command to send a "connection
interval request". Your BLE peripheral will send this request to the
iOS central device, and—depending on if you send the right
parameters—the iOS device **might** respect your request and
connect at a faster interval. See the Apple Bluetooth Design
Guidelines for the limits you are allowed to request (and iOS is
very, very strict! It will punish you with an even slower connection
interval if you request out of the limits).
I'm not sure what BLE chipset you're using, but here's how I did it
on the Broadcom BCM20736:
https://github.com/DrumPants/DrumPants-Bluetooth-LE-Firmware/blob/master/hello_sensor.c#L697
There's a corresponding function in the DrumPants iOS app that
actually *tells* the BLE peripheral device the correct connection
parameters that it should request, and then the peripheral turns
right around and asks the iOS central device for those exact
parameters.
This is because iOS 7/8/9 and Android all have different optimal
combinations of connection interval parameters, so I left it up to
the central app to tell the BLE peripheral what works best for the
operating system version. It's really silly, but it's the only way I
could get the fastest connection interval across all platforms.
Good luck!
Tyler
On 2/8/16 8:48 PM, Christian
Ridderström wrote:
Hi,
I'm investigating/thinking of how I could synchronize
events in time between an iOS app and an external device
over BLE.
Does the iOS API have any callbacks or similar that the
iOS invoke at certain points in time based on the timing
of the BLE comunication? For example (being wishful
here), in connection with each connection event?
Is it possible to make the iOS somewhere log the "iOS time"
(e.g. mach-time) of connection events?
Best regards,
Christian
--
Christian Ridderström,
+46-70 687 39 44
_______________________________________________
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
--
Tyler Freeman
CTO
Tappur: Context-Aware Wearable Controller Platform
http://tappur.co
|
_______________________________________________
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