BLE iOS app - discrepancy while sampling at high rate - ios

I'm using a nordic nrf51822 device and trying to communicate to it via an iOS app with BLE.
When the device sampling rate is set high - I'm able to read data at that frequency for about 5 to 7 seconds. After that time period, it samples at that frequency but doesn't update as often.
I tested the device with my app as well as the nordic tool-box HRM iOS app. It acts the same way in both the applications.
So my question is: Does this have to do anything with the CB framework or iOS environment?
or Does it have to do something with the sensor/device?
or Does connection interval in iOS BLE change by any chance?

Related

Bluetooth device not visible on iOS but visible on MacOS

I'm trying to discover a bluetooth device from an iOS app I developed. The device is an industrial sensor which send a measure every x ms.
I dont understand why I can see and connect to the device from my MacBook but not from my iPhone. The device is not visible in iPhone bluetooth settings. I dont find it through CoreBluetooth too (by using 'scanForPeripheral' method). Is there particular specifications on iOS?
I'm allowed to setup every data I want on the BT device (profil, CoD, UUID, etc.)
The iOS app is basic and simple. I'm using CoreBluetooth framework.

How to increase Bluetooth communication speed in swift?

I have an iOS application which communicates with an BLE device that requires the lowest latency.
The manufacturer of the BLE device specifies that connection interval supported by the device as follows.
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) /**< Minimum acceptable connection interval, Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS) /**< Maximum acceptable connection interval, Connection interval uses 1.25 ms units. */
Manufacture of BLE device ask to usa a minimum connection interval of 11.5ms in the iOS code.
This is the first time I hear about changing connection interval. But after some research, it seems that the device that initiate the connection can request for a better interval.
(https://devzone.nordicsemi.com/f/nordic-q-a/6500/not-clear-about-minimum-and-maximum-connection-interval)
However I can't find a way for my iOS Bluetooth manager to ask for a better latency. Is this even possible in iOS?
EDIT: I forgot to mention that the device is a BLE Midi device. I don't know if that can help for improving the latency.
Sincerely,
Jery
Apple only offers Bluetooth LE to developers, which is much slower than standard Bluetooth.
With that said, you can access the faster Bluetooth in iOS by joining the MFi program and writing Apple a check for the ability to do so.
This section from the MFi FAQ gives some clarification on the issue from Apple:
I want to develop an accessory that communicates with an Apple device
using only Bluetooth Low Energy. Do I need to join the MFi Program?
No. Accessories which connect to an Apple device using only Bluetooth
Low Energy/BLE/Bluetooth 4.0 or standard Bluetooth profiles supported
by iOS are not part of the MFi Program.
So in other words, to use Bluetooth EDR, you must join MFi.

How often does iOS monitor for iBeacons?

I have an iBeacon device I'm working on and am wondering how often iOS monitors/checks/scans for iBeacons when asked to do so via a CoreLocation app? I'm wondering so I know how long to broadcast for my iBeacon is designed to not always be on.
I'm surprised I haven't been able to find this on the web (and of course Apple won't tell us)
Edit: I mean when the app itself is not running because the phone has been restart or the app is shut down.
There is no Apple documentation for this, but the following is what I have learned from lots of testing on iOS 7 and iOS 8 devices:
If the app gets one of the limited (30) bluetooth hardware detection slots, the Bluetooth chip will always be scanning for the beacon pattern. In theory one packet could trigger the detection, but in practice you may need several seconds of transmission to guarantee detection.
If the app does not get a hardware acceleration slot, the OS will perform a full scan every 15 minutes.
If you want to target phones that have hardware detection slots, the beacon could transmit for 5 seconds at any time appropriate for the use case. If you want to target apps without hardware acceleration slots, the beacon must transmit for 15 minutes to guarantee detection.

how can iOS app set the Core Bluetooth advertisement rate?

My iOS app running iPad is advertising too often, and subsequently seems to be spamming my embedded Bluetooth LE device, which is reading data out of ad from iPad.
How can I slow down iPad rate of advertising?
Advertisement rate is not settable in Core Bluetooth. There is no public API that enables you to do it.
While your application is in the foreground, the advertisement will be fast, and in the background it will be limited, most importantly rate throttled down, advertised services removed and local name not used.

iOS Bluetooth Accessory maximum speed?

I'm developing an external device, this device has a large amount of data to be sent via Bluetooth to the iphone / ipad, but sends a very slow speed is only about 60kbps.
The device sends data to the PC speed is 256kbps, I think not because of device problems.
Who knows the iOS Bluetooth maximum speed is?
Information:
Use external accessory framework,
Bluetooth 2.0 + EDR
Thanks,
I know this is a bit late, but based on all the work I've been doing, the iDevice's are generally slower than PC/Android over Bluetooth. This is due to internal restrictions of the device, but also depending on how you're doing your data transfer (packet sizes, frequencies, latencies, packet overhead, buffer sizes, etc...), that could slow you down as well.
Another issue is that depending on the BT module you're using, I've seen HUGE variations (factor of 10) in how much data they can pass to iOS devices (even though they can all push to Androids at 300kbps).
When communicating with an iOS device, there is some additional overhead during packet handling and the protocols used, and if the BT firmware developer doesn't handle this correctly, you'll see performance implications. These numbers also change device to device and iOS version to iOS version.
To give you some concrete numbers, with one of my BT modules, here were my results (the highest I've seen so far):
iPad Mini running iOS 7.0.4 - 18,500-20,500 bytes/s
iPhone 5S running iOS 7.0.4 - 14,000-15,000 bytes/s
iPod Touch running iOS 7.0.4 - 16,000-17 000 bytes/s
iPod Touch running iOS 6.1.3 - 19,000-20,000 bytes/s
The last test there shows you that the iOS version itself can also have a large impact. Note, these were all done with the same BT module, 3-4 runs per test.
Edit: I added a bit more context here: http://www.sureshjoshi.com/embedded/bluetooth-classic-apple-french/

Resources