def check_heartbeat(tag_provider, timeout):
	current_time = system.date.now()
	tag_path = "%sSystem/wbsckt_heartbeat_interval" % (tag_provider)
	tag_to_read = system.tag.readBlocking([tag_path])
	heartbeat = tag_to_read[0].value
	time_diff = system.date.secondsBetween(heartbeat, current_time)
	if time_diff > timeout:
		return True
	else:
		return False
	

def get_heartbeat(provider):
	tag_to_write = "%sSystem/wbsckt_heartbeat_interval" % (provider)
	current_time = system.date.now()
	system.tag.writeAsync([tag_to_write], [current_time])
