This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Negotiating connectivity with iPhone SE while app is in background mode

The problem is not being able to connect to the device from an iPhone SE while the app is in background mode.  We have an iOS app written in swift, which uploads data from a Nordic nrf52840 device.  I wrote the BLE module, which is integrated into other software and uses a version of embOS from Segger.  The device does not maintain a connection because of power envelope requirements but instead advertises periodically.  When the advertisement occurs, iOS passes the connection to the iOS app, and all available log data is uploaded to iOS before the device terminates the connection.  This scheme has been implemented and is working on iPhone8 and iPhone11 models.  The iPhone SE also works while the app is in foreground mode; when the app is in background mode, we see different behavior.

 

This is a description of the issue on file with Apple:             

  1. Pair the CGM device with iPhone SE and collect initial capture.
  2. Allow the iOS app to be placed into the background or suspended mode.
  3. Attempted connections fail on an iPhone SE.  This behavior does not occur on an iPhone 8 or iPhone 11, where several phones have been able to continuously log data to AWS over an extended time of more than 60 days while the app is suspended and the phone is locked.
  4. The attached Wireshark capture file provides the following details:
    1. A correctly negotiated connection while the application is in foreground mode on the iPhone SE.
  • Search for frame 547 and frame 1860 in the attached SE_BadCapture.txt file, and you will find a request for MTU size of 256.
  • Several lines later, central responds with MTU size of 185.
  • The peripheral accepts that, along with other negotiated parameters, and has a successful exchange.
    1. An incorrectly negotiated connection while the iPhone SE has been allowed to go into locked mode on battery power.
  • Search for Frame 2332 in the attached SE_BadCapture.txt file, and you will find a request for MTU size of 256.
  • Several lines later at Frame 2383 central responds with MTU size of 527.
  • The Nordic BLE stack again requests MTU size of 256, after which the connection is terminated.

In the above text the bullets are intended to be indented under 4a and 4b but the wiki does not support that. so they show up as bullets under 4a and 1a

 SE_BadCapture.txt

Parents Reply Children
Related