/* Function for checking if the TLV block length is correct. 
Some TLV block has predefined length: TLV_NULL and TLV_TERMINATOR always have a length of 1 byte. TLV_LOCK_CONTROL and TLV_MEMORY_CONTROL always have a length of 3 bytes. */
static bool tlv_block_is_data_length_correct(tlv_block_t *p_block_to_check)
/* Function for checking if the TLV block length is correct. 
Some TLV block has predefined length: TLV_NULL and TLV_TERMINATOR always have a length of 1 byte. TLV_LOCK_CONTROL and TLV_MEMORY_CONTROL always have a length of 3 bytes. */
static bool tlv_block_is_data_length_correct(tlv_block_t *p_block_to_check)
{
    switch(p_block_to_check->tag)
    {
        case TLV_NULL:
        case TLV_TERMINATOR:
            if (p_block_to_check->length != TLV_NULL_TERMINATOR_LEN)
            {
                return false;
            }
            break;
        case TLV_LOCK_CONTROL:
        case TLV_MEMORY_CONTROL:
            if (p_block_to_check->length != TLV_LOCK_MEMORY_CTRL_LEN)
            {
                return false;
            }
            break;
        case TLV_NDEF_MESSAGE:
        case TLV_PROPRIETARY:
        default:
            break;
    }
    return true;
}