/* Function for sending service changed indications if it is pending on any connections.  */
static void service_changed_pending_flags_check(void)
/* Function for sending service changed indications if it is pending on any connections.  */
static void service_changed_pending_flags_check(void)
{
    sdk_mapped_flags_t service_changed_pending_flags;
    service_changed_pending_flags = ble_conn_state_user_flag_collection(m_gcm.flag_id_service_changed_pending);
    if (sdk_mapped_flags_any_set(service_changed_pending_flags))
    {
        sdk_mapped_flags_key_list_t conn_handle_list;
        conn_handle_list = ble_conn_state_conn_handles();
        for (uint32_t i = 0; i < conn_handle_list.len; i++)
        {
            if (    ble_conn_state_user_flag_get(conn_handle_list.flag_keys[i],
                                                 m_gcm.flag_id_service_changed_pending)
                && !ble_conn_state_user_flag_get(conn_handle_list.flag_keys[i],
                                                 m_gcm.flag_id_service_changed_sent))
            {
                service_changed_send_in_evt(conn_handle_list.flag_keys[i]);
            }
        }
    }
}