/* Function for parsing a Capabiliy Container area of a Type 2 Tag. 
This function reads data from a Capability Container area in the raw data buffer and fills the type_2_tag_capability_container_t structure within type_2_tag_t. */
static ret_code_t type_2_tag_cc_parse(type_2_tag_t *p_type_2_tag, uint8_t *p_raw_data)
/* Function for parsing a Capabiliy Container area of a Type 2 Tag. 
This function reads data from a Capability Container area in the raw data buffer and fills the type_2_tag_capability_container_t structure within type_2_tag_t. */
static ret_code_t type_2_tag_cc_parse(type_2_tag_t *p_type_2_tag, uint8_t *p_raw_data)
{
    uint8_t * p_cc_block = p_raw_data + T2T_CC_BLOCK_OFFSET;
    if (p_cc_block[0] != T2T_NFC_FORUM_DEFINED_DATA)
    {
        return NRF_ERROR_INVALID_DATA;
    }
    p_type_2_tag->cc.major_version  = MSN_GET(p_cc_block[1]);
    p_type_2_tag->cc.minor_version  = LSN_GET(p_cc_block[1]);
    p_type_2_tag->cc.data_area_size = p_cc_block[2] * 8;
    p_type_2_tag->cc.read_access    = MSN_GET(p_cc_block[3]);
    p_type_2_tag->cc.write_access   = LSN_GET(p_cc_block[3]);
    return NRF_SUCCESS;
}