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

How to update MTU and PHY on IOS nrf connect app

Excuse me:

                          I'm testing the maximum rate of ble_app_uart。

                        1、Can the nrf connect app on IOS initiate the update of MTU and PHY?How to update MTU and PHY on IOS nrf connect app?

                        2、If not, which API should the slave use to update MTU and PHY?

                         

                     

  • Hi

    This is something you can request from the peripheral side. 

    MTU should already be handled by the GATT module, you just need to update the GAP_DATA_LENGTH and GATT_MAX_MTU_SIZE parameters in sdk_config.h:

    #ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
    #define NRF_SDH_BLE_GAP_DATA_LENGTH 251
    #endif
    
    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. 
    // <i> Maximum number of total concurrent connections using the default configuration.
    
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. 
    // <i> The time set aside for this connection on every connection interval in 1.25 ms units.
    
    #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
    #define NRF_SDH_BLE_GAP_EVENT_LENGTH 6
    #endif
    
    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
    #endif

    A phy change can also be requested from the peripheral side, by using the sd_ble_gap_phy_update(..) function, as shown in the image transfer demo:
    https://github.com/NordicPlayground/nrf52-ble-image-transfer-demo/blob/master/main.c#L830

    You just need to provide a valid connection handle, and the TX and RX PHY that you wan't to use. 

    Best regards
    Torbjørn

  • I do the maximum rate test on the ble_app_uart. On Android NRF connect, the slave can successfully update 244 bytes of MTU, and the maximum rate can reach 100kb / s, but on ios11, the slave can only update 182 bytes of MTU, and the maximum rate can only reach 30KB / s. can the same rate be achieved on IOS?If so, how should I modify ble_app_uart?

  • Hi

    Which iPhone and iOS version are you testing on when achieving 182 bytes of MTU? 

    I believe the older iPhones were limited to this value, so this might be correct. 

    Can you let me know which connection interval you are using?
    For optimal performance on iOS and Android it is recommended to use a 15ms connection interval. 

    Best regards
    Torbjørn

Related