/* Function for checking the checksum bytes of the UID stored in internal area. 
This function calculates the block check character (BCC) bytes based on the parsed serial number and compares them with bytes read from the Type 2 Tag. */
static bool type_2_tag_is_bcc_correct(type_2_tag_serial_number_t *p_sn)
/* Function for checking the checksum bytes of the UID stored in internal area. 
This function calculates the block check character (BCC) bytes based on the parsed serial number and compares them with bytes read from the Type 2 Tag. */
static bool type_2_tag_is_bcc_correct(type_2_tag_serial_number_t *p_sn)
{
    uint8_t bcc1 = (uint8_t)T2T_UID_BCC_CASCADE_BYTE                    ^
                   (uint8_t)p_sn->manufacturer_id                       ^
                   (uint8_t)((p_sn->serial_number_part_1 >> 8) & 0xFF)  ^
                   (uint8_t)(p_sn->serial_number_part_1 & 0xFF);
    uint8_t bcc2 = (uint8_t)((p_sn->serial_number_part_2 >> 24) & 0xFF) ^
                   (uint8_t)((p_sn->serial_number_part_2 >> 16) & 0xFF) ^
                   (uint8_t)((p_sn->serial_number_part_2 >>  8) & 0xFF) ^
                   (uint8_t)( p_sn->serial_number_part_2        & 0xFF);
    return (bcc1 == p_sn->check_byte_0) && (bcc2 == p_sn->check_byte_1);
}