def METHOD_NAME(self):
    """Handler for the heartbeat timeout.
    Compute the time span of the last heartbeat sequence.
    Set self.current_case.data_to_send to CASE_DATA_INVALID if no heartbeat was received.
    Set self.current_case.data_to_send to CASE_DATA_INSUFF_HB if only one heartbeat was
    received.
    """
    self.drop_heartbeat_messages = True
    dev_data = CASE_DATA_INVALID
    if len(self.hb_timestamps_us) == 1:
        dev_data = CASE_DATA_INSUFF_HB
        self.log('Not enough heartbeats received.')
    elif len(self.hb_timestamps_us) >= 2:
        dev_data = int(round(0.001 * (self.hb_timestamps_us[-1] - self.hb_timestamps_us[0])))
        self.log('Heartbeat time span was {} ms.'.format(dev_data))
    self.current_case = TestCaseData(self.current_case.index, dev_data)