/* Function for parsing the length of an iOS attribute. Used in the parse_get_notif_attrs_response state machine. 
Second byte of the length field. If the length is zero, it means that the attribute is not present and the state machine is set to parse the next attribute. */
static ble_ancs_c_parse_state_t attr_len2_parse(ble_ancs_c_t *p_ancs, const uint8_t *p_data_src, uint32_t *index)
/* Function for parsing the length of an iOS attribute. Used in the parse_get_notif_attrs_response state machine. 
Second byte of the length field. If the length is zero, it means that the attribute is not present and the state machine is set to parse the next attribute. */
static ble_ancs_c_parse_state_t attr_len2_parse(ble_ancs_c_t *p_ancs, const uint8_t *p_data_src, uint32_t *index)
{
    p_ancs->evt.attr.attr_len |= (p_data_src[(*index)++] << 8);
    p_ancs->current_attr_index = 0;
    if (p_ancs->evt.attr.attr_len != 0)
    {
        return ATTR_DATA;
    }
    else
    {
        ANCS_LOG("[ANCS]: Attribute LEN %i \n\r", p_ancs->evt.attr.attr_len);
        p_ancs->evt.evt_type = BLE_ANCS_C_EVT_NOTIF_ATTRIBUTE;
        p_ancs->evt_handler(&p_ancs->evt);
        return ATTR_ID;
    }
}