iPhone and Samsung connection issues

We are experiencing connection issues for specific Android & iPhone but not for others (i.e. Samsung Galaxy S9).

Phones with issues

Android Details

  • Samsung Galaxy A72
  • Android OS Version 12
  • nRF Connect App Version 4.26.0 (Latest)

 

iOS Details:

  • iPhone 8
  • iOS 16.0.2
  • nRF Connect App Version 2.5.3 (Latest)\

Would this be a compatibility issue?

Parents
  • Hello Keith,

    What would be the potential root causes for why some phones have a connection issue and other's do not?  I am working on  Fishbone diagram to help root cause the issue.  

  • ccrider said:
    What would be the potential root causes for why some phones have a connection issue and other's do not?

    I have seen in the past some phones may not "like" that there are BLE procedures starting on very first connection event, this seems to trigger them to enter a bad state. It may also be some new features that is supported by the peripheral and not supported by the phone, in this case the phone should ignore them, yet some old phones may enter a bad state. It can also be some issue with a specific android/ios release or chipset from time to time. It can also be a peripheral that have some strict requirement to specific features or parameters, and if the phone don't apply to these, it may disconnect based on it. So overall, it can be quite a lot of things, though I see less and less of these issues.

    Kenneth

  • I just received word the reporting team that patch that I sent yesterday fixes the problem when it wasn't meant to it did by happenstance.  The code below is where a change was made:

    uint32_t ble_Combo_value_update(ble_cus_data_t *p_cus, uint8_t combo_data[COMBO_CHAR_DATA_SIZE])
    {
        //NRF_LOG_INFO("In ble_Combo_value_update"); 
        if (p_cus == NULL)
        {
            return NRF_ERROR_NULL;
        }
    
        uint32_t err_code = NRF_SUCCESS;
        ble_gatts_value_t gatts_value;
    
        // Initialize value struct.
        memset(&gatts_value, 0, sizeof(gatts_value));
    
        gatts_value.len     = COMBO_CHAR_DATA_SIZE;
        gatts_value.offset  = 0;
        gatts_value.p_value = combo_data;
    
    
        // Update database.
        err_code = sd_ble_gatts_value_set(p_cus->conn_handle,
                                          p_cus->Combo_value_handles.value_handle,
                                          &gatts_value);
        if (err_code != NRF_SUCCESS)
        {
            return err_code;// Code fails here because of line above CBC 08/24/2022 
        }
    
        // Send value if connected and notifying.
        if ((p_cus->conn_handle != BLE_CONN_HANDLE_INVALID)) 
        {
            ble_gatts_hvx_params_t hvx_params;
    
            memset(&hvx_params, 0, sizeof(hvx_params));
    
            hvx_params.handle = p_cus->Combo_value_handles.value_handle;
            hvx_params.type   = BLE_GATT_HVX_NOTIFICATION;
            hvx_params.offset = gatts_value.offset;
            hvx_params.p_len  = &gatts_value.len;
            hvx_params.p_data = gatts_value.p_value;
    
            err_code = sd_ble_gatts_hvx(p_cus->conn_handle, &hvx_params);
            if (err_code != NRF_SUCCESS &&
            err_code != BLE_ERROR_INVALID_CONN_HANDLE &&
            err_code != NRF_ERROR_INVALID_STATE &&
            err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING &&
            err_code != BLE_GATTS_EVT_SYS_ATTR_MISSING &&
            /*I'm not entirely sure if ignoring this error could have detrimental effects or not*/
            err_code != NRF_ERROR_RESOURCES)
            {
              APP_ERROR_CHECK(err_code);
            }
        }
        else
        {
            err_code = NRF_ERROR_INVALID_STATE;
        }
    
    
        return err_code;
    }

  • Line 15 (gatts_value.len     = COMBO_CHAR_DATA_SIZE;) was gatts_value.len     = sizeof(COMBO_CHAR_DATA_SIZE.len);

    The size was coming back 4 instead of the actual value of COMBO_CHAR_DATA_SIZE or 18.  But we would receive 18 characters with only 4 updating.

Reply Children
No Data
Related