/* Function for parsing the id of an iOS attribute. Used in the parse_get_notif_attrs_response state machine. 
We only request attributes that are registered with ble_ancs_c_attr_add once they have been reveiced we stop parsing. */
static ble_ancs_c_parse_state_t attr_id_parse(ble_ancs_c_t *p_ancs, const uint8_t *p_data_src, uint32_t *index)
/* Function for parsing the id of an iOS attribute. Used in the parse_get_notif_attrs_response state machine. 
We only request attributes that are registered with ble_ancs_c_attr_add once they have been reveiced we stop parsing. */
static ble_ancs_c_parse_state_t attr_id_parse(ble_ancs_c_t *p_ancs, const uint8_t *p_data_src, uint32_t *index)
{
    p_ancs->evt.attr.attr_id     = (ble_ancs_c_notif_attr_id_values_t) p_data_src[(*index)++];
    p_ancs->evt.attr.p_attr_data = p_ancs->ancs_attr_list[p_ancs->evt.attr.attr_id].p_attr_data;
    if (p_ancs->expected_number_of_attrs == 0)
    {
        ANCS_LOG("[ANCS]: All requested attributes received\n\r");
        return DONE;
    }
    else if (p_ancs->ancs_attr_list[p_ancs->evt.attr.attr_id].get == true)
    {
        ANCS_LOG("[ANCS]: Attribute ID %i \n\r", p_ancs->evt.attr.attr_id);
        return ATTR_LEN1;
    }
    else
    {
        p_ancs->expected_number_of_attrs--;
        return ATTR_ID;
    }
}