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

The iPhone APP "Health" can not display heart-rate sometimes, when connect to the DK with example "ble_app_hrs"

I use the example "ble_app_hrs" in the pca10040 dk, and use iphone system app "health" to display the heart-rate.

I tried this in several iPhones(such as iPhone X, XP, 8P, 7, 6, 6P with different ios version 11.1~12.2). 

Some iPhones can display heart-rate, and others can not.

I add following code to project, and found that some iPhones do not enable the notification when connect by the system bluetooth settings.

BTW, when use app "nrf toolbox", everything works well.

Thanks and look forward to your reply

static void ble_hrs_evt_handler(ble_hrs_t * p_hrs, ble_hrs_evt_t * p_evt)
{
    switch(p_evt->evt_type)
    {
        case BLE_HRS_EVT_NOTIFICATION_ENABLED:
        {
            NRF_LOG_DEBUG("Enable notification. Start sampling!");
        }   break;

        case BLE_HRS_EVT_NOTIFICATION_DISABLED:
        {
            NRF_LOG_DEBUG("Disable notification. Stop sampling!");
        }   break;

        default:
            break;
    }

}

Related